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

Loading…
Cancel
Save