瀏覽代碼

驾驶舱-样式优化

wanglt 3 月之前
父節點
當前提交
e1505234f7
共有 1 個文件被更改,包括 14 次插入24 次删除
  1. 14 24
      ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

+ 14 - 24
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -692,10 +692,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 wo.model,
                 IF(wo.repair_method='2', 1, null) AS restart_flag,
                 wo.mis_no AS `system`,
---                 d.dept_name AS pcs,
-                p.dept_name AS center,
+                wo.gxt_center AS center,
                 '维保工单' AS orderType,
-                m.nick_name AS chargePerson,
+                wo.team_leader_name AS chargePerson,
                 <if test="repairPerson != null and repairPerson == 'true'">wop.nick_name AS repairPerson,ROUND(wop.score,2) AS score,</if>
                 <if test="repairPerson == null or repairPerson == '' or repairPerson == 'false'">ROUND(wo.score,2) AS score,</if>
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.create_time, wo.assign_time ) / 60,2) AS xfsc,
@@ -707,28 +706,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_in_work_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
             FROM
                 gxt_work_order wo
-                LEFT JOIN sys_dept d ON wo.pcs_station_pid = d.dept_id
-                LEFT JOIN sys_dept p ON d.parent_id = p.dept_id
                 <if test="repairPerson != null and repairPerson == 'true'">
                     LEFT JOIN gxt_work_order_person wop ON wo.id = wop.order_id
                 </if>
-                LEFT JOIN sys_user m ON wo.team_leader_id = m.user_id
-                LEFT JOIN ( SELECT order_id, COUNT(*) AS order_num FROM gxt_work_order_person GROUP BY order_id ) t ON t.order_id = wo.id
                 LEFT JOIN gxt_work_order_flow_records_next gq ON gq.order_id = wo.id
                 LEFT JOIN (SELECT order_id,COUNT(*) AS wop_num FROM gxt_work_order_person GROUP BY order_id) wopp ON wopp.order_id=wo.id
             <where>
                 <if test="startTime != null "> AND wo.create_time > #{startTime}</if>
                 <if test="endTime != null "> AND wo.create_time <![CDATA[<]]> #{endTime}</if>
                 <if test="pcsId != null "> AND wo.pcs_station_pid = #{pcsId}</if>
-                <if test="centerId != null "> AND d.parent_id = #{centerId}</if>
+                <if test="centerId != null "> AND wo.gxt_center_id = #{centerId}</if>
                 <if test="remark != null and remark != '' ">
                     AND (
                     wo.pcs_device_name LIKE concat('%', #{remark}, '%')
                     OR wo.brand LIKE concat('%', #{remark}, '%')
                     OR wo.model LIKE concat('%', #{remark}, '%')
-                    OR m.nick_name LIKE concat('%', #{remark}, '%')
-                    OR d.dept_name LIKE concat('%', #{remark}, '%')
-                    OR p.dept_name LIKE concat('%', #{remark}, '%')
+                    OR wo.gxt_center LIKE concat('%', #{remark}, '%')
+                    OR wo.pcs_station_name LIKE concat('%', #{remark}, '%')
+                    OR wo.team_leader_name LIKE concat('%', #{remark}, '%')
                     )
                 </if>
                 <if test="devices != null and devices != ''">
@@ -738,7 +733,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     </foreach>
                 </if>
                 <if test="dataPermission != null and dataPermission != ''">${dataPermission}</if>
-                AND p.dept_name IS NOT NULL AND wopp.wop_num>0 AND wo.work_order_status IS NOT NULL AND wo.work_order_status IN ('completed','archived')
+                AND wopp.wop_num>0 AND wo.work_order_status IS NOT NULL AND wo.work_order_status IN ('completed','archived')
             </where>
 
             UNION ALL
@@ -752,10 +747,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 wo.model,
                 IF(wo.repair_method='2', 1, 0) AS restart_flag,
                 NULL AS `system`,
---                 d.dept_name AS pcs,
-                p.dept_name AS center,
+                wo.gxt_center AS center,
                 '维修工单' AS orderType,
-                m.nick_name AS chargePerson,
+                wo.team_leader_name AS chargePerson,
                 <if test="repairPerson != null and repairPerson == 'true'">wop.nick_name AS repairPerson,ROUND(wop.score,2) AS score,</if>
                 <if test="repairPerson == null or repairPerson == '' or repairPerson == 'false'">ROUND(wo.score,2) AS score,</if>
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.occur_time, wo.assign_time ) / 60,2) AS xfsc,
@@ -767,28 +761,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_before_start_suspend_seconds + gq.total_in_work_suspend_seconds + gq.total_night_auto_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
             FROM
                 gxt_repair_order wo
-                LEFT JOIN sys_dept d ON wo.pcs_station_pid = d.dept_id
-                LEFT JOIN sys_dept p ON d.parent_id = p.dept_id
                 <if test="repairPerson != null and repairPerson == 'true'">
                     LEFT JOIN gxt_repair_order_person wop ON wo.id = wop.order_id
                 </if>
-                LEFT JOIN sys_user m ON wo.team_leader_id = m.user_id
-                LEFT JOIN ( SELECT order_id, COUNT(*) AS order_num FROM gxt_repair_order_person GROUP BY order_id ) t ON t.order_id = wo.id
                 LEFT JOIN gxt_repair_order_flow_records_next gq ON gq.order_id = wo.id
                 LEFT JOIN (SELECT order_id,COUNT(*) AS wop_num FROM gxt_repair_order_person GROUP BY order_id) wopp ON wopp.order_id=wo.id
             <where>
                 <if test="startTime != null "> AND wo.occur_time > #{startTime}</if>
                 <if test="endTime != null "> AND wo.occur_time <![CDATA[<]]> #{endTime}</if>
                 <if test="pcsId != null "> AND wo.pcs_station_pid = #{pcsId}</if>
-                <if test="centerId != null "> AND d.parent_id = #{centerId}</if>
+                <if test="centerId != null "> AND wo.gxt_center_id = #{centerId}</if>
                 <if test="remark != null and remark != '' ">
                     AND (
                     wo.pcs_device_name LIKE concat('%', #{remark}, '%')
                     OR wo.brand LIKE concat('%', #{remark}, '%')
                     OR wo.model LIKE concat('%', #{remark}, '%')
-                    OR m.nick_name LIKE concat('%', #{remark}, '%')
-                    OR d.dept_name LIKE concat('%', #{remark}, '%')
-                    OR p.dept_name LIKE concat('%', #{remark}, '%')
+                    OR wo.gxt_center LIKE concat('%', #{remark}, '%')
+                    OR wo.pcs_station_name LIKE concat('%', #{remark}, '%')
+                    OR wo.team_leader_name LIKE concat('%', #{remark}, '%')
                     )
                 </if>
                 <if test="devices != null and devices != ''">
@@ -798,7 +788,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     </foreach>
                 </if>
                 <if test="dataPermission != null and dataPermission != ''">${dataPermission}</if>
-                AND p.dept_name IS NOT NULL AND wopp.wop_num>0 AND wo.work_order_status IS NOT NULL AND wo.work_order_status IN ('completed','archived')
+                AND wopp.wop_num>0 AND wo.work_order_status IS NOT NULL AND wo.work_order_status IN ('completed','archived')
             </where>
             ) o
         <where>