From 05c50d1f3ccddeffe8d1b5be173d01e553b6d01e Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期一, 26 五月 2025 16:59:42 +0800 Subject: [PATCH] 时间条件修改 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/InspectionOrderMapper.xml | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 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 9022659..794eca5 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 @@ -292,7 +292,14 @@ LEFT JOIN mom_eam_inspection_project t3 ON t1.inspection_project_id = t3.id LEFT JOIN mom_eam_equipment t4 ON t2.equipment_id = t4.id left join mom_eam_inspection_cycle t5 on t1.inspection_cycle_id = t5.id - WHERE t4.num = '0526' + WHERE 1=1 + <if test="equipmentNum != null and equipmentNum != ''"> + and t4.num = #{equipmentNum} + </if> + <if test="equipmentNum == null and equipmentNum == ''"> + and t4.num = '-1' + </if> + AND t2.version_status = '2' and t5.cycle_unit = #{cycleUnit} </select> @@ -315,15 +322,20 @@ <if test="equipmentNum != null and equipmentNum != ''"> and t4.num = #{equipmentNum} </if> - <if test="equipmentNum == null and equipmentNum == ''"> and t4.num = '-1' </if> + <if test="equipmentNum == null and equipmentNum == ''"> + 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} </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 @@ -334,7 +346,22 @@ mom_eam_inspection_order t1 LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id LEFT JOIN mom_eam_inspection_cycle t3 ON t1.inspection_cycle_id = t3.id - WHERE 1=1 and - t2.num = '0526' and t3.cycle_unit = #{cycleUnit} + WHERE 1=1 + <if test="equipmentNum != null and equipmentNum != ''"> + and t2.num = #{equipmentNum} + </if> + <if test="equipmentNum == null and equipmentNum == ''"> + and t2.num = '-1' + </if> + <if test="dataTime != null and dataTime != ''"> + 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} </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