Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 11 months ago
parent
commit
a489e37b90
  1. 37
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperDefectMapper.xml

37
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">
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="getRepetStatistics" <select id="getRepetStatistics"
resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsCodeDTO"> resultType="com.hnac.hzims.operational.defect.dto.OperDefectStatisticsCodeDTO">

Loading…
Cancel
Save