|
|
|
@ -218,24 +218,19 @@
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<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, |
|
|
|
|
sum(m.NUMBER) AS amount,sum(t.ACT_HOURS) actHours,max(t.PLAN_START_TIME) AS recently |
|
|
|
|
FROM hzims_oper_access_task t |
|
|
|
|
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 |
|
|
|
|
SELECT T.EM_CODE AS EMCODE,P.`GRADE_CODE`,COUNT(DISTINCT T.ID) AS FREQUENCY, IFNULL(SUM(M.NUMBER),0) AS AMOUNT, |
|
|
|
|
SUM(T.ACT_HOURS) ACTHOURS,MAX(T.PLAN_START_TIME) AS RECENTLY |
|
|
|
|
FROM HZIMS_OPER_ACCESS_TASK T |
|
|
|
|
LEFT JOIN HZIMS_OPER_ACCESS_PLAN P ON T.PLAN_ID = P.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> |
|
|
|
|
T.IS_DELETED = 0 |
|
|
|
|
<if test="deviceCodes != null"> |
|
|
|
|
and t.EM_CODE in |
|
|
|
|
<foreach collection="deviceCodes" item="code" index="index" open="(" close=")" separator=","> |
|
|
|
|
#{code} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="startTime != null"> |
|
|
|
|
and t.PLAN_START_TIME >= #{startTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="endTime != null"> |
|
|
|
|
and t.PLAN_START_TIME <= #{endTime} |
|
|
|
|
<foreach collection="deviceCodes" item="code" index="index" open="(" close=")" separator=","> #{code} </foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="startTime != null"> and t.PLAN_START_TIME >= #{startTime} </if> |
|
|
|
|
<if test="endTime != null"> and t.PLAN_START_TIME <= #{endTime} </if> |
|
|
|
|
</where> |
|
|
|
|
GROUP BY t.EM_CODE,p.`GRADE_CODE` |
|
|
|
|
</select> |
|
|
|
|