Browse Source

设备档案bug修复-ysj

zhongwei
ty 8 months ago
parent
commit
856858c002
  1. 23
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml

23
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskMapper.xml

@ -218,24 +218,19 @@
</select> </select>
<select id="getRepairBill" resultType="com.hnac.hzims.operational.access.vo.RepairBillVO"> <select id="getRepairBill" resultType="com.hnac.hzims.operational.access.vo.RepairBillVO">
SELECT t.EM_CODE AS emCode,p.`GRADE_CODE`,count(t.ID) AS frequency, SELECT T.EM_CODE AS EMCODE,P.`GRADE_CODE`,COUNT(DISTINCT T.ID) AS FREQUENCY, IFNULL(SUM(M.NUMBER),0) AS AMOUNT,
sum(m.NUMBER) AS amount,sum(t.ACT_HOURS) actHours,max(t.PLAN_START_TIME) AS recently SUM(T.ACT_HOURS) ACTHOURS,MAX(T.PLAN_START_TIME) AS RECENTLY
FROM hzims_oper_access_task t FROM HZIMS_OPER_ACCESS_TASK T
LEFT JOIN hzims_oper_access_plan p ON t.PLAN_ID = p.ID LEFT JOIN HZIMS_OPER_ACCESS_PLAN P ON T.PLAN_ID = P.ID
LEFT JOIN hzims_oper_access_material m ON t.ID = m.TASK_ID LEFT JOIN (select TASK_ID,sum(NUMBER) NUMBER from HZIMS_OPER_ACCESS_MATERIAL where IS_DELETED = 0 GROUP BY TASK_ID) M ON T.ID = M.TASK_ID
<where> <where>
T.IS_DELETED = 0
<if test="deviceCodes != null"> <if test="deviceCodes != null">
and t.EM_CODE in and t.EM_CODE in
<foreach collection="deviceCodes" item="code" index="index" open="(" close=")" separator=","> <foreach collection="deviceCodes" item="code" index="index" open="(" close=")" separator=","> #{code} </foreach>
#{code}
</foreach>
</if>
<if test="startTime != null">
and t.PLAN_START_TIME &gt;= #{startTime}
</if>
<if test="endTime != null">
and t.PLAN_START_TIME &lt;= #{endTime}
</if> </if>
<if test="startTime != null"> and t.PLAN_START_TIME >= #{startTime} </if>
<if test="endTime != null"> and t.PLAN_START_TIME &lt;= #{endTime} </if>
</where> </where>
GROUP BY t.EM_CODE,p.`GRADE_CODE` GROUP BY t.EM_CODE,p.`GRADE_CODE`
</select> </select>

Loading…
Cancel
Save