Browse Source

缺陷月报bug代码提交

zhongwei
ty 11 months ago
parent
commit
73cb0d9736
  1. 39
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml

39
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml

@ -4,35 +4,28 @@
<select id="getStatisticByMonth"
resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsStatusDTO">
SELECT P.DEFECT_LEVEL,D.HANDLE_STATUS,COUNT(D.ID) AS DEFECT_NUM from hzims_oper_defect D LEFT JOIN
SELECT P.DEFECT_GRADING,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM from
hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE DATE_FORMAT(D.CREATE_TIME,'%Y-%m') = #{month}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
WHERE DATE_FORMAT(P.CREATE_TIME,'%Y-%m') = #{month}
<if test="createDept != null and createDept != ''">
AND P.CREATE_DEPT = #{createDept}
</if>
GROUP BY P.DEFECT_LEVEL,D.HANDLE_STATUS
ORDER BY P.DEFECT_LEVEL
AND P.IS_DELETED = '0'
GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS
ORDER BY P.DEFECT_GRADING
</select>
<select id="getStatisticBySeveralMonth"
resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsStatusDTO">
SELECT P.DEFECT_LEVEL,D.HANDLE_STATUS,COUNT(D.ID) AS DEFECT_NUM
from hzims_oper_defect D
LEFT JOIN hzims_oper_phenomenon P
ON D.DEFECT_CODE = P.DEFECT_CODE
WHERE D.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth}
<if test="createDept != null and createDept.size > 0">
and D.CREATE_DEPT in
<foreach collection="createDept" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY P.DEFECT_LEVEL,D.HANDLE_STATUS
ORDER BY P.DEFECT_LEVEL
SELECT P.DEFECT_GRADING,P.HANDLE_STATUS,COUNT(P.ID) AS DEFECT_NUM
from hzims_oper_phenomenon P
WHERE P.CREATE_TIME BETWEEN #{firstMonth} AND #{endMonth}
<if test="createDept != null and createDept != ''">
AND P.CREATE_DEPT = #{createDept}
</if>
AND P.IS_DELETED = 0
GROUP BY P.DEFECT_GRADING,P.HANDLE_STATUS
ORDER BY P.DEFECT_GRADING
</select>
<select id="getRepetStatistics"
resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsCodeDTO">

Loading…
Cancel
Save