From 1bf6cb4c0bfc149737afa37a1df1c809b29c6139 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期二, 10 六月 2025 13:57:43 +0800
Subject: [PATCH] 点检测试修改

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
index 3bd99b9..ae2d1f5 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml
@@ -311,7 +311,8 @@
             t2.inspection_order_uda2 as inspectionUserName,
             t2.inspection_order_uda1 AS repairConfirmPerson,
             case t1.inspection_project_result  when '1' then '鈭�' when '2' then 'x' when '3' then '鈻�'  when '4' then 'T' else '' end as insResult,
-            CONVERT(VARCHAR, DATEPART(DAY, t2.create_time)) as dayTime
+            CONVERT(VARCHAR, DATEPART(DAY, t2.create_time)) as dayTime,
+            DATEPART(WEEK, t2.create_time) - DATEPART(WEEK, DATEADD(DAY, 1 - DAY(t2.create_time), t2.create_time)) + 1 AS weekOfMonth
         FROM
             mom_eam_inspection_order_detail t1
                 LEFT JOIN mom_eam_inspection_order t2 ON t1.inspection_order_id= t2.id
@@ -326,19 +327,23 @@
                 and t4.num = '-1'
            </if>
            <if test="dataTime != null and dataTime != ''">
-                AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), #{dataTime}, 120 ), 2, 7 )
+                AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = #{dataTime}
            </if>
            <if test="dataTime == null and dataTime == ''">
                 AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), GETDATE( ), 120 ), 1, 7 )
           </if>
-            and t3.name = #{name} and t3.detection_standard = #{detectionStandard}
+            and t3.name = #{name} and t3.detection_standard = #{detectionStandard} order by t2.create_time desc
     </select>
+<!--    <if test="dataTime != null and dataTime != ''">-->
+<!--        AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), #{dataTime}, 120 ), 2, 7 )-->
+<!--    </if>-->
 
     <select id="getUserQianzi"  parameterType="String" resultType="Map">
         SELECT
             t1.inspection_order_uda2 AS inspectionUserName,
             t1.inspection_order_uda1 AS repairConfirmPerson,
-            CONVERT ( VARCHAR, DATEPART( DAY, t1.create_time ) ) AS dayTime
+            CONVERT ( VARCHAR, DATEPART( DAY, t1.create_time ) ) AS dayTime,
+            DATEPART(WEEK, t1.create_time) - DATEPART(WEEK, DATEADD(DAY, 1 - DAY(t1.create_time), t1.create_time)) + 1 AS weekOfMonth
         FROM
             mom_eam_inspection_order t1
         LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id
@@ -351,11 +356,14 @@
             and t2.num = '-1'
         </if>
         <if test="dataTime != null and dataTime != ''">
-            AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), #{dataTime}, 120 ), 2, 7 )
+            AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = #{dataTime}
         </if>
         <if test="dataTime == null and dataTime == ''">
             AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), GETDATE( ), 120 ), 1, 7 )
         </if>
-          and t3.cycle_unit = #{cycleUnit}
+          and t3.cycle_unit = #{cycleUnit} order by t1.create_time desc
     </select>
+<!--    <if test="dataTime != null and dataTime != ''">-->
+<!--        AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.create_time, 120 ), 1, 7 ) = SUBSTRING ( CONVERT ( VARCHAR ( 10 ), #{dataTime}, 120 ), 2, 7 )-->
+<!--    </if>-->
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3