Prechádzať zdrojové kódy

驾驶舱-处理时长修改

wanglt 5 mesiacov pred
rodič
commit
22a383830f

+ 33 - 22
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -568,7 +568,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.accept_time, wo.real_start_time ) / 60,2) AS zbsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.real_start_time, wo.real_end_time ) / 60,2) AS tjsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.real_end_time, wo.restart_time ) / 60,2) AS qjbwsc,
-                ROUND(( TIMESTAMPDIFF( MINUTE, wo.create_time, wo.restart_time ) / 60 ) - ( TIMESTAMPDIFF( MINUTE, approved.approved_time, resume.resume_time ) / 60 ),2) AS clsc,
+                ROUND(( TIMESTAMPDIFF( MINUTE, wo.create_time, wo.restart_time ) / 60 ) - (IFNULL(TIMESTAMPDIFF(MINUTE, approved.approved_time, resume.resume_time), 0) / 60),2) AS clsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, approved.approved_time, resume.resume_time ) / 60,2) AS gqsc
             FROM
                 gxt_work_order wo
@@ -627,7 +627,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.accept_time, wo.real_start_time ) / 60,2) AS zbsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.real_start_time, wo.real_end_time ) / 60,2) AS tjsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, wo.real_end_time, wo.restart_time ) / 60,2) AS qjbwsc,
-                ROUND(( TIMESTAMPDIFF( MINUTE, wo.occur_time, wo.restart_time ) / 60 ) - ( TIMESTAMPDIFF( MINUTE, approved.approved_time, resume.resume_time ) / 60 ),2) AS clsc,
+                ROUND(( TIMESTAMPDIFF( MINUTE, wo.occur_time, wo.restart_time ) / 60 ) - (IFNULL(TIMESTAMPDIFF(MINUTE, approved.approved_time, resume.resume_time), 0) / 60),2) AS clsc,
                 ROUND(TIMESTAMPDIFF( MINUTE, approved.approved_time, resume.resume_time ) / 60,2) AS gqsc
             FROM
                 gxt_repair_order wo
@@ -670,7 +670,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <choose>
             <when test="(xfsc != null and xfsc == 'true') or (xysc != null and xysc == 'true') or (zbsc != null and zbsc == 'true') or (tjsc != null and tjsc == 'true') or (qjbwsc != null and qjbwsc == 'true') or (clsc != null and clsc == 'true') or (gqsc != null and gqsc == 'true') or (score != null and score == 1)">
-
+                <trim prefix="ORDER BY" suffixOverrides=",">
+                    <if test="center != null and center == 'true'">o.center,</if>
+                    <if test="pcs != null and pcs == 'true'">o.pcs,</if>
+                    <if test="(workOrder != null and workOrder == true) or (repairOrder != null and repairOrder==true)">o.orderType,</if>
+                    o.work_order_project_no,
+                    <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
+                    <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
+                    <if test="brand != null and brand == 'true'">o.brand,</if>
+                    <if test="model != null and model == 'true'">o.model,</if>
+                    <if test="system != null and system == 'true'">o.`system`,</if>
+                    <if test="code != null and code == 'true'">o.`code`,</if>
+                </trim>
             </when>
             <otherwise>
                 <trim prefix="GROUP BY" suffixOverrides=",">
@@ -692,26 +703,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     <if test="clsc != null and clsc == 'true'">o.clsc,</if>
                     <if test="gqsc != null and gqsc == 'true'">o.gqsc,</if>
                 </trim>
+                <trim prefix="ORDER BY" suffixOverrides=",">
+                    <if test="center != null and center == 'true'">o.center,</if>
+                    <if test="pcs != null and pcs == 'true'">o.pcs,</if>
+                    <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
+                    <if test="(workOrder != null and workOrder == true) or (repairOrder != null and repairOrder==true)">o.orderType,</if>
+                    <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
+                    <if test="brand != null and brand == 'true'">o.brand,</if>
+                    <if test="model != null and model == 'true'">o.model,</if>
+                    <if test="system != null and system == 'true'">o.`system`,</if>
+                    <if test="code != null and code == 'true'">o.`code`,</if>
+                    <if test="score != null and score == 1">o.score,</if>
+                    <if test="xfsc != null and xfsc == 'true'">o.xfsc,</if>
+                    <if test="xysc != null and xysc == 'true'">o.xysc,</if>
+                    <if test="zbsc != null and zbsc == 'true'">o.zbsc,</if>
+                    <if test="tjsc != null and tjsc == 'true'">o.tjsc,</if>
+                    <if test="qjbwsc != null and qjbwsc == 'true'">o.qjbwsc,</if>
+                    <if test="clsc != null and clsc == 'true'">o.clsc,</if>
+                    <if test="gqsc != null and gqsc == 'true'">o.gqsc,</if>
+                </trim>
             </otherwise>
         </choose>
-        <trim prefix="ORDER BY" suffixOverrides=",">
-            <if test="center != null and center == 'true'">o.center,</if>
-            <if test="pcs != null and pcs == 'true'">o.pcs,</if>
-            <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
-            <if test="(workOrder != null and workOrder == true) or (repairOrder != null and repairOrder==true)">o.orderType,</if>
-            <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
-            <if test="brand != null and brand == 'true'">o.brand,</if>
-            <if test="model != null and model == 'true'">o.model,</if>
-            <if test="system != null and system == 'true'">o.`system`,</if>
-            <if test="code != null and code == 'true'">o.`code`,</if>
-            <if test="score != null and score == 1">o.score,</if>
-            <if test="xfsc != null and xfsc == 'true'">o.xfsc,</if>
-            <if test="xysc != null and xysc == 'true'">o.xysc,</if>
-            <if test="zbsc != null and zbsc == 'true'">o.zbsc,</if>
-            <if test="tjsc != null and tjsc == 'true'">o.tjsc,</if>
-            <if test="qjbwsc != null and qjbwsc == 'true'">o.qjbwsc,</if>
-            <if test="clsc != null and clsc == 'true'">o.clsc,</if>
-            <if test="gqsc != null and gqsc == 'true'">o.gqsc,</if>
-        </trim>
     </select>
 </mapper>