From 6af39126be72254a049b85f3bcd1e97ad2e48f40 Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Wed, 30 Jun 2021 15:02:52 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E7=BB=9F=E8=AE=A1=E8=A1=A8?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dto/StatsStaffPatrolRecordDailyDTO.java | 146 ++++++++++++++++++
...StatsStaffPatrolRecordDailyController.java | 32 ++++
.../dao/StatsStaffPatrolRecordDailyDao.java | 43 ++++++
.../StatsStaffPatrolRecordDailyEntity.java | 116 ++++++++++++++
.../StatsStaffPatrolRecordDailyService.java | 15 ++
...tatsStaffPatrolRecordDailyServiceImpl.java | 32 ++++
.../mapper/StatsStaffPatrolRecordDailyDao.xml | 18 +++
7 files changed, 402 insertions(+)
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java
new file mode 100644
index 0000000000..43a8cdf336
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/StatsStaffPatrolRecordDailyDTO.java
@@ -0,0 +1,146 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
new file mode 100644
index 0000000000..b2dad2bce4
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsStaffPatrolRecordDailyController.java
@@ -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;
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
new file mode 100644
index 0000000000..ac7ea8b7da
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StatsStaffPatrolRecordDailyDao.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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 {
+
+ /**
+ * @Description 校验今天某人是不是有数据
+ * @Param staffId
+ * @Param dateId
+ * @author zxc
+ * @date 2021/6/30 2:41 下午
+ */
+ Integer checkStatsCount(@Param("staffId")String staffId, @Param("dateId")String dateId);
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java
new file mode 100644
index 0000000000..2bb2e583e3
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/StatsStaffPatrolRecordDailyEntity.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+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;
+
+}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
new file mode 100644
index 0000000000..4eb51384d9
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsStaffPatrolRecordDailyService.java
@@ -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 {
+
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
new file mode 100644
index 0000000000..a53fc8e3a5
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsStaffPatrolRecordDailyServiceImpl.java
@@ -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 implements StatsStaffPatrolRecordDailyService {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml
new file mode 100644
index 0000000000..3c51b767fb
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StatsStaffPatrolRecordDailyDao.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ SELECT
+ COUNT(1)
+ FROM
+ stats_staff_patrol_record_daily
+ WHERE
+ DEL_FLAG = 0
+ AND DATE_ID = #{dateId}
+ AND STAFF_ID = #{staffId}
+
+
+
\ No newline at end of file