@@ -14,4 +14,6 @@ public interface StatisticsMapper extends BaseMapper { | |||||
TodoCenterStatisticsPO mysubmitNum(@Param("employeeCode") String employeeCode); | TodoCenterStatisticsPO mysubmitNum(@Param("employeeCode") String employeeCode); | ||||
TodoCenterStatisticsPO ccNums(@Param("employeeCode") String employeeCode); | TodoCenterStatisticsPO ccNums(@Param("employeeCode") String employeeCode); | ||||
TodoCenterStatisticsPO getIdo(String employeeCode); | |||||
} | } |
@@ -27,12 +27,18 @@ | |||||
<select id="getTodoOrIdo" parameterType="java.lang.String" | <select id="getTodoOrIdo" parameterType="java.lang.String" | ||||
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | ||||
SELECT | 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 | FROM | ||||
act_hi_taskinst ht | act_hi_taskinst ht | ||||
</select> | </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" | <select id="mysubmitNum" parameterType="java.lang.String" | ||||
resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | resultType="com.ningdatech.pmapi.todocenter.model.po.TodoCenterStatisticsPO"> | ||||
SELECT | SELECT | ||||
@@ -24,12 +24,14 @@ public class StatisticsServiceImpl implements StatisticsService { | |||||
public TodoCenterStatisticsPO getStatistics(String employeeCode) { | public TodoCenterStatisticsPO getStatistics(String employeeCode) { | ||||
TodoCenterStatisticsPO res = new TodoCenterStatisticsPO(); | 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); | TodoCenterStatisticsPO submit = mapper.mysubmitNum(employeeCode); | ||||
if(Objects.nonNull(submit)){ | if(Objects.nonNull(submit)){ | ||||
res.setMysubmitNum(submit.getMysubmitNum()); | res.setMysubmitNum(submit.getMysubmitNum()); | ||||