|
|
@@ -61,6 +61,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY po.real_end_time DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectGxtScoreDetailList" parameterType="GxtOrderPerson" resultMap="GxtOrderPersonResult">
|
|
|
+ SELECT
|
|
|
+ CASE WHEN t.order_type=1 THEN ro.work_order_project_no ELSE wo.work_order_project_no END AS order_code,
|
|
|
+ CASE WHEN t.order_type=1 THEN ro.gxt_center ELSE wo.gxt_center END AS center,
|
|
|
+ d.dept_name AS parent,DATE( t.create_time ) AS finish_date,t.user_id,
|
|
|
+ CASE WHEN t.order_type=1 THEN ro.pcs_station_name ELSE wo.pcs_station_name END AS pcs,
|
|
|
+ CASE WHEN t.order_type=1 THEN '维修工单' ELSE '维保工单' END AS order_type,
|
|
|
+ CASE WHEN t.score_type=1 THEN '工单得分' WHEN t.score_type=2 THEN '运行得分' ELSE '停机扣分' END,t.score
|
|
|
+ FROM gxt_order_score_detail t
|
|
|
+ LEFT JOIN gxt_repair_order ro ON t.order_id=ro.id
|
|
|
+ LEFT JOIN gxt_work_order wo ON wo.id=t.order_id
|
|
|
+ LEFT JOIN sys_dept d ON
|
|
|
+ d.dept_id=CASE WHEN t.order_type=1 THEN ro.pcs_station_pid ELSE wo.pcs_station_pid END
|
|
|
+ WHERE DATE_FORMAT(t.create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')
|
|
|
+ <if test="userId != null">
|
|
|
+ AND t.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="orderCode != null and orderCode != ''">
|
|
|
+ AND t.order_code LIKE CONCAT( '%', #{orderCode}, '%' )
|
|
|
+ </if>
|
|
|
+ ORDER BY t.create_time DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
<delete id="delRepairOrderFlowRecords">
|
|
|
DELETE FROM gxt_repair_order_flow_records
|
|
|
</delete>
|