7 changed files with 402 additions and 0 deletions
@ -0,0 +1,146 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class StatsStaffPatrolRecordDailyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 统计日期 关联日期dim表 |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 周ID |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 月ID |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季ID |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年ID |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织id=网格所属的组织id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格所有上级id |
||||
|
*/ |
||||
|
private String gridPids; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员用户id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 巡查次数 |
||||
|
*/ |
||||
|
private Integer patrolTotal; |
||||
|
|
||||
|
/** |
||||
|
* 巡查时长 单位:秒 |
||||
|
*/ |
||||
|
private Integer totalTime; |
||||
|
|
||||
|
/** |
||||
|
* 巡查期间直接立项项目数 |
||||
|
*/ |
||||
|
private Integer reportProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 最新的巡查开始时间 |
||||
|
*/ |
||||
|
private Date latestPatrolTime; |
||||
|
|
||||
|
/** |
||||
|
* 最新的巡查状态 正在巡查中:patrolling;结束:end |
||||
|
*/ |
||||
|
private String latestPatrolStatus; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.dto.StatsStaffPatrolRecordDailyDTO; |
||||
|
import com.epmet.service.StatsStaffPatrolRecordDailyService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("statsstaffpatrolrecorddaily") |
||||
|
public class StatsStaffPatrolRecordDailyController { |
||||
|
|
||||
|
@Autowired |
||||
|
private StatsStaffPatrolRecordDailyService statsStaffPatrolRecordDailyService; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface StatsStaffPatrolRecordDailyDao extends BaseDao<StatsStaffPatrolRecordDailyEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 校验今天某人是不是有数据 |
||||
|
* @Param staffId |
||||
|
* @Param dateId |
||||
|
* @author zxc |
||||
|
* @date 2021/6/30 2:41 下午 |
||||
|
*/ |
||||
|
Integer checkStatsCount(@Param("staffId")String staffId, @Param("dateId")String dateId); |
||||
|
|
||||
|
} |
@ -0,0 +1,116 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("stats_staff_patrol_record_daily") |
||||
|
public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 统计日期 关联日期dim表 |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 周ID |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 月ID |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季ID |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年ID |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 网格id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员所属组织id=网格所属的组织id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格所有上级id |
||||
|
*/ |
||||
|
private String gridPids; |
||||
|
|
||||
|
/** |
||||
|
* 工作人员用户id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 巡查次数 |
||||
|
*/ |
||||
|
private Integer patrolTotal; |
||||
|
|
||||
|
/** |
||||
|
* 巡查时长 单位:秒 |
||||
|
*/ |
||||
|
private Integer totalTime; |
||||
|
|
||||
|
/** |
||||
|
* 巡查期间直接立项项目数 |
||||
|
*/ |
||||
|
private Integer reportProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 最新的巡查开始时间 |
||||
|
*/ |
||||
|
private Date latestPatrolTime; |
||||
|
|
||||
|
/** |
||||
|
* 最新的巡查状态 正在巡查中:patrolling;结束:end |
||||
|
*/ |
||||
|
private String latestPatrolStatus; |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; |
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
public interface StatsStaffPatrolRecordDailyService extends BaseService<StatsStaffPatrolRecordDailyEntity> { |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.dao.StatsStaffPatrolRecordDailyDao; |
||||
|
import com.epmet.dto.StatsStaffPatrolRecordDailyDTO; |
||||
|
import com.epmet.entity.StatsStaffPatrolRecordDailyEntity; |
||||
|
import com.epmet.service.StatsStaffPatrolRecordDailyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* [天]工作人员巡查记录统计 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-06-30 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl<StatsStaffPatrolRecordDailyDao, StatsStaffPatrolRecordDailyEntity> implements StatsStaffPatrolRecordDailyService { |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.StatsStaffPatrolRecordDailyDao"> |
||||
|
|
||||
|
<!-- 校验今天某人是不是有数据 --> |
||||
|
<select id="checkStatsCount" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
FROM |
||||
|
stats_staff_patrol_record_daily |
||||
|
WHERE |
||||
|
DEL_FLAG = 0 |
||||
|
AND DATE_ID = #{dateId} |
||||
|
AND STAFF_ID = #{staffId} |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue