Parcourir la source

优化 撤回处理的代码

master
PoffyZhang il y a 1 an
Parent
révision
10b2bd7aa2
3 fichiers modifiés avec 17 ajouts et 7 suppressions
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java
  2. +8
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml
  3. +7
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.java Voir le fichier

@@ -14,4 +14,6 @@ public interface StatisticsMapper extends BaseMapper {
TodoCenterStatisticsPO mysubmitNum(@Param("employeeCode") String employeeCode);

TodoCenterStatisticsPO ccNums(@Param("employeeCode") String employeeCode);

TodoCenterStatisticsPO getIdo(String employeeCode);
}

+ 8
- 2
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/mapper/StatisticsMapper.xml Voir le fichier

@@ -27,12 +27,18 @@
<select id="getTodoOrIdo" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ is NULL THEN 1 end) todoNum,
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ IS not NULL THEN 1 end) idoNum
sum(CASE WHEN ht.assignee_ = #{employeeCode} AND ht.end_time_ is NULL THEN 1 end) todoNum
FROM
act_hi_taskinst ht
</select>

<select id="getIdo" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT count(0) idoNum
FROM act_hi_taskinst ht WHERE ht.assignee_ = #{employeeCode}
AND ht.end_time_ IN (SELECT max(end_time_) FROM act_hi_taskinst WHERE ht.end_time_ is not NULL GROUP BY PROC_INST_ID_)
</select>

<select id="mysubmitNum" parameterType="java.lang.String"
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO">
SELECT


+ 7
- 5
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/service/impl/StatisticsServiceImpl.java Voir le fichier

@@ -24,12 +24,14 @@ public class StatisticsServiceImpl implements StatisticsService {
public TodoCenterStatisticsPO getStatistics(String employeeCode) {
TodoCenterStatisticsPO res = new TodoCenterStatisticsPO();

TodoCenterStatisticsPO todoOrIdo = mapper.getTodoOrIdo(employeeCode);
if(Objects.nonNull(todoOrIdo)){
res.setTodoNum(todoOrIdo.getTodoNum());
res.setIdoNum(todoOrIdo.getIdoNum());
TodoCenterStatisticsPO todo = mapper.getTodoOrIdo(employeeCode);
if(Objects.nonNull(todo)){
res.setTodoNum(todo.getTodoNum());
}
TodoCenterStatisticsPO ido = mapper.getIdo(employeeCode);
if(Objects.nonNull(ido)){
res.setIdoNum(ido.getIdoNum());
}

TodoCenterStatisticsPO submit = mapper.mysubmitNum(employeeCode);
if(Objects.nonNull(submit)){
res.setMysubmitNum(submit.getMysubmitNum());


Chargement…
Annuler
Enregistrer