Browse Source

项目历时统计相关

dev_shibei_match
wangchao 5 years ago
parent
commit
1c688d7b43
  1. 149
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java
  2. 128
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java
  3. 83
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java
  4. 49
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java
  5. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  6. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  7. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  8. 119
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java
  9. 98
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java
  11. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java
  12. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  13. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java
  14. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  15. 43
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  16. 61
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

149
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java

@ -0,0 +1,149 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
public class FactOriginGroupMainDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组的Id
*/
private String id;
private String customerId;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过
*/
private String groupState;
/**
* 小组所在网格Id
*/
private String gridId;
/**
* 小组所在机关Id
*/
private String agencyId;
/**
* 小组所在组织的父机关Id
*/
private String parentId;
/**
* 小组所在组织所有父类Id集合
*/
private String pids;
/**
* 建群申请审核通过的时期
*/
private String dateId;
/**
* 建群申请审核通过的周期
*/
private String weekId;
/**
* 建群申请审核通过的月份
*/
private String monthId;
/**
* 建群申请审核通过的季度
*/
private String quarterId;
/**
* 建群申请审核通过的年
*/
private String yearId;
/**
* 群众人数
*/
private Integer resiMemberCount;
/**
* 组内总人数
*/
private Integer memberTotal;
/**
* 群主ID
*/
private String groupOwnerId;
/**
* 群主是否热心居民 可以update
*/
private Integer isOwnerHearted;
/**
* 群主是否党员 可以update
*/
private Integer isOwnerParty;
/**
* 删除标识 默认为0
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
*
*/
private String createdBy;
/**
*
*/
private Date createdTime;
/**
*
*/
private String updatedBy;
/**
*
*/
private Date updatedTime;
}

128
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java

@ -0,0 +1,128 @@
/**
* 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.extract;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 业务数据抽取-机关项目响应时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
public class FactOriginProjectOrgPeriodDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
*
*/
private String orgId;
/**
* grid agenct dept
*/
private String orgType;
/**
* 如果是机关则为父级机关(若已是顶级机关则为0)如果是网格和部门则为所属机关
*/
private String pid;
/**
* 最后一个节点是PID若无则为空
*/
private String pids;
/**
* 流转到的日期
*/
private Date informedDate;
/**
* 流转走或结案的日期
*/
private Date handledDate;
/**
* 响应时长从流转到自己到流转走共耗时/小时(不算法定节假日和周末)
*/
private Integer totalPeriod;
/**
* 截至第一次响应时长从流转到第一次处理(响应结案流转)耗时大于等于上一项值
*/
private Integer periodTillReplyFirstly;
/**
* resloved unresolved
*/
private String isResolved;
/**
* 办结的操作return(回退)transfer(流转)closed(结案)但是不包括response(响应)
* */
private String operation;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
*
*/
private Date createdTime;
/**
*
*/
private String createdBy;
/**
*
*/
private Date updatedTime;
/**
*
*/
private String updatedBy;
}

83
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java

@ -0,0 +1,83 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 从数据库中查询出的 项目 - 机关网格部门机关的响应时长
* FIXME 查询的全都是已经结案的项目如果查询流转中的项目需要修改逻辑较为复杂
* @ClassName ProjectOrgPeriodResultDTO
* @Auth wangc
* @Date 2020-09-16 15:28
*/
@Data
public class ProjectOrgPeriodResultDTO implements Serializable {
private static final long serialVersionUID = 6216112710806237600L;
/**
* 节点Id
* */
private String processId;
/**
* 项目Id
* */
private String projectId;
/**
* 是这个节点的操作相当于上一个人的操作而不是对于这个节点的处理
* created transfer close return response
* */
private String operation;
/**
* 对这个节点的处理如果未处理则为null
* created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联需要另取)
* */
private String selfAction;
/**
* 节点所属的机关即上个节点推到这个节点的负责部门
* */
private String departmentName;
/**
* 当前节点所属的Agency如果负责的是部门或者网格则是其所属的机关
* */
private String orgId;
/**
* 如果是部门处理则有值否则null
* */
private String departmentId;
/**
* 如果是网格处理则有值否则null
* */
private String gridId;
/**
* 当前所属的机关的所有Pid集合以及当前的机关Id所以此项不会未null至少也是它的所属Agency
* */
private String orgIdPath;
/**
* 从节点流入到节点流出且当前负责单位确实解决包括退回了的情况下所耗费的时间(以分钟为单位)
* 如果未当前负责单位一直停留在unresolved状态即使做出response或者项目被其他单位结案该项依旧是0不参与办结的计时
* 如果负责单位只是做出回应但未处理(即没有让节点流走)需要查出其相应的第一次响应时间另取
* */
private Integer totalPeriod;
/**
* 节点流入时间
* */
private Date informedDate;
/**
* 节点流出时间如果未解决则未null
* */
private Date handledDate;
}

49
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 查询机关在项目节点上响应的结果
* 查询的是存在响应的所有相关工作人员节点如果同一个人对同一个项目已经做过一次处理并未做出响应而在第二次流转到自己时
* 做出了响应也会连带查询出其第一次未响应过的数据
* @ClassName ProjectOrgRelationWhenResponseResultDTO
* @Auth wangc
* @Date 2020-09-16 17:27
*/
@Data
public class ProjectOrgRelationWhenResponseResultDTO implements Serializable {
private static final long serialVersionUID = 1962332392048752037L;
/**
* 项目Id
* */
private String projectId;
/**
* 节点Id
* */
private String processId;
/**
* 节点动作的发起人
* */
private String staffId;
/**
* 负责人所属的单位名称:xx机关-xx部门 xx机关-xx网格 xx机关
* */
private String departmentName;
/**
* 动作分类
* */
private String operation;
/**
* 节点创建时间动作发起时间
* */
private Date createdTime;
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -0,0 +1,33 @@
/**
* 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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Mapper
public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMainDailyEntity> {
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -0,0 +1,51 @@
/**
* 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.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 业务数据抽取-机关项目响应时间
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Mapper
public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginProjectOrgPeriodDailyEntity> {
/**
* @Description 查询是否存在数据如果没有则视为第一次扫描该表需要根据业务查询全部数据
* @param
* @return
* @author wangc
* @date 2020.09.17 13:43
**/
int selectIfExisted(@Param("customerId") String customerId);
/**
* @Description 在插入之前先删除所有与这个项目相关的历时信息
* @param projectId
* @return
* @author wangc
* @date 2020.09.17 14:43
**/
void deleteByProjectId(@Param("projectId") String projectId);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
@ -41,4 +42,15 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
**/
List<ProjectProcessEntity> selectProcessList(ProjectEntity projectEntity);
/**
* @Description 查询项目-机关各个节点历时详情
* @param customerId
* @param projectStatus 项目状态 pending closed 如果是null则全查
* @param dateId
* @return
* @author wangc
* @date 2020.09.17 09:43
**/
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
}

119
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java

@ -0,0 +1,119 @@
/**
* 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.evaluationindex.extract;
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 2020-09-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_group_main_daily")
public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
private String customerId;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过
*/
private String groupState;
/**
* 小组所在网格Id
*/
private String gridId;
/**
* 小组所在机关Id
*/
private String agencyId;
/**
* 小组所在组织的父机关Id
*/
private String parentId;
/**
* 小组所在组织所有父类Id集合
*/
private String pids;
/**
* 建群申请审核通过的时期
*/
private String dateId;
/**
* 建群申请审核通过的周期
*/
private String weekId;
/**
* 建群申请审核通过的月份
*/
private String monthId;
/**
* 建群申请审核通过的季度
*/
private String quarterId;
/**
* 建群申请审核通过的年
*/
private String yearId;
/**
* 群众人数
*/
private Integer resiMemberCount;
/**
* 组内总人数
*/
private Integer memberTotal;
/**
* 群主ID
*/
private String groupOwnerId;
/**
* 建组时群主是否热心居民不更新
*/
private Integer isOwnerHearted;
/**
* 建组时群主是否党员不更新
*/
private Integer isOwnerParty;
}

98
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java

@ -0,0 +1,98 @@
/**
* 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.evaluationindex.extract;
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 2020-09-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_project_org_period_daily")
public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
*
*/
private String orgId;
/**
* grid agenct dept
*/
private String orgType;
/**
* 如果是机关则为父级机关(若已是顶级机关则为0)如果是网格和部门则为所属机关
*/
private String pid;
/**
* 最后一个节点是PID若无则为空
*/
private String pids;
/**
* 流转到的日期
*/
private Date informedDate;
/**
* 流转走或结案的日期
*/
private Date handledDate;
/**
* 响应时长从流转到自己到流转走共耗时/小时(不算法定节假日和周末)
*/
private Integer totalPeriod;
/**
* 截至第一次响应时长从流转到第一次处理(响应结案流转)耗时大于等于上一项值
*/
private Integer periodTillReplyFirstly;
/**
* resloved unresolved
*/
private String isResolved;
/**
* 办结的操作return(回退)transfer(流转)closed(结案)但是不包括response(响应)
* */
private String operation;
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java

@ -0,0 +1,9 @@
package com.epmet.service.evaluationindex.extract;
/**
* @Desc 业务数据抽取 - 组相关
* @Author wangc
* @DateTime 2020/9/14 5:07 下午
*/
public interface GroupExtractService {
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java

@ -0,0 +1,21 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 项目节点历时
* @Author wangc
* @DateTime 2020/9/14 5:07 下午
*/
public interface ProjectPeriodExtractService {
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractFormDTO param);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java

@ -0,0 +1,17 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.service.evaluationindex.extract.GroupExtractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Description 业务数据抽取 - 组相关
* @ClassName GroupExtractServiceImpl
* @Auth wangc
* @Date 2020-09-16 14:47
*/
@Service
@Slf4j
public class GroupExtractServiceImpl implements GroupExtractService {
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java

@ -0,0 +1,51 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 业务数据抽取 - 项目节点历时
* @ClassName ProjectPeriodExtractServiceImpl
* @Auth wangc
* @Date 2020-09-17 13:52
*/
@Service
@Slf4j
public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService {
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
/**
* @Description 抽取项目节点历时逻辑
* @param param
* @return
* @author wangc
* @date 2020.09.17 14:05
**/
@Override
public void extractProjectPeriodData(ExtractFormDTO param) {
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId());
List<ProjectOrgPeriodResultDTO> periods;
List<ProjectOrgRelationWhenResponseResultDTO> responseList;
if(trace <= NumConstant.ZERO){
//数据初始化
}else{
//日常统计
}
}
}

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -0,0 +1,33 @@
<?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.evaluationindex.extract.FactOriginGroupMainDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity" id="factOriginGroupMainDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID" />
<result property="groupState" column="GROUP_STATE"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="pids" column="PIDS"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="resiMemberCount" column="RESI_MEMBER_COUNT"/>
<result property="memberTotal" column="MEMBER_TOTAL"/>
<result property="groupOwnerId" column="GROUP_OWNER_ID"/>
<result property="isOwnerHearted" column="IS_OWNER_HEARTED"/>
<result property="isOwnerParty" column="IS_OWNER_PARTY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

43
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -0,0 +1,43 @@
<?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.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity" id="factOriginProjectOrgPeriodDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID" />
<result property="projectId" column="PROJECT_ID"/>
<result property="orgId" column="ORG_ID"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="informedDate" column="INFORMED_DATE"/>
<result property="handledDate" column="HANDLED_DATE"/>
<result property="totalPeriod" column="TOTAL_PERIOD"/>
<result property="periodTillReplyFirstly" column="PERIOD_TILL_REPLY_FIRSTLY"/>
<result property="isResolved" column="IS_RESOLVED"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
</resultMap>
<!-- 查询是否存在数据 -->
<select id="selectIfExisted" resultType="int">
SELECT COUNT(*) FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0'
<if test='null != customerId and "" != customerId'>
CUSTOMER_ID = #{customerId}
</if>
</select>
<!-- 在插入之前,先删除所有与这个项目相关的历时信息 -->
<delete id="deleteByProjectId">
DELETE FROM
fact_origin_project_org_period_daily
WHERE PROJECT_ID = #{projectId}
</delete>
</mapper>

61
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -20,4 +20,65 @@
ORDER BY pro.project_id,pro.CREATED_TIME ASC
</select>
<!-- 查询项目-机关各个节点历时详情 -->
<select id="selectProjectOrgPeriod" resultType="com.epmet.dto.project.result.ProjectOrgPeriodResultDTO">
SELECT
process.ID AS processId,
process.PROJECT_ID,
process.OPERATION,
IF(staff.IS_HANDLE='handle',selfAction.OPERATION,null) AS selfAction,
staff.DEPARTMENT_NAME,
staff.ORG_ID,
staff.DEPARTMENT_ID,
staff.GRID_ID,
staff.ORG_ID_PATH,
IF(staff.IS_HANDLE='handle',timestampdiff(MINUTE , staff.CREATED_TIME , staff.UPDATED_TIME),0) AS TOTAL_PERIOD,
staff.CREATED_TIME AS informedDate,
-- 转入时间
IF(staff.IS_HANDLE='handle',staff.UPDATED_TIME,null) AS handledDate
FROM PROJECT_STAFF staff
LEFT JOIN PROJECT project ON staff.PROJECT_ID = project.ID AND project.DEL_FLAG = '0'
LEFT JOIN PROJECT_PROCESS process ON staff.PROCESS_ID = process.ID AND process.DEL_FLAG = '0'
LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0' AND staff.UPDATED_TIME = selfAction.CREATED_TIME AND staff.STAFF_ID = selfAction.STAFF_ID
WHERE staff.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
<!-- 如果不传projectStatus则默认查全部 -->
<if test='null != projectStatus and "" != projectStatus'>
AND project.STATUS = #{projectStatus}
</if>
<if test='null != dateId and "" != dateId'>
AND (
DATE_FORMAT(project.CREATED_TIME , '%Y%m%d') = #{dateId}
OR
DATE_FORMAT(project.UPDATED_TIME , '%Y%m%d') = #{dateId}
)
</if>
AND process.OPERATION <![CDATA[ <> ]]> 'response'
ORDER BY process.PROJECT_ID,staff.CREATED_TIME ASC -- 按照立项-流转的顺序
</select>
<!-- 查询项目-机关各个节点的响应列表 -->
<select id="selectResponseTrace" resultType="com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO">
SELECT
process.PROJECT_ID,
process.ID AS PROCESS_ID,
process.STAFF_ID,
process.DEPARTMENT_NAME,
process.OPERATION,
process.CREATED_TIME
FROM
PROJECT_PROCESS process
WHERE
process.DEL_FLAG = '0'
AND
process.PROJECT_ID = '9400300725bdf49f8958f585555929af'
AND
EXISTS(
SELECT * FROM PROJECT_PROCESS WHERE DEL_FLAG = '0' AND PROJECT_ID = '9400300725bdf49f8958f585555929af' AND OPERATION = 'response'
AND STAFF_ID = process.STAFF_ID AND DEPARTMENT_NAME = process.DEPARTMENT_NAME
)
ORDER BY process.STAFF_ID , process.CREATED_TIME ASC
</select>
</mapper>
Loading…
Cancel
Save