From 9b015b51b72ba050b4c38a6ba79eb45b7065e67d Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 25 七月 2024 10:11:52 +0800 Subject: [PATCH] 调整sql --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcProcessQuantityMapper.xml | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcProcessQuantityMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcProcessQuantityMapper.xml index 33b8dc0..5935c84 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcProcessQuantityMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcProcessQuantityMapper.xml @@ -6,7 +6,7 @@ <select id="pageList" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> SELECT t1.id id, - t1.equipment_id equipmentId, + t3.equipment_id equipmentId, t3.equipment_name equipmentName, t2.parts_code partsCode, t2.batch_code batchCode, @@ -23,10 +23,10 @@ FROM mdc_process_quantity t1 LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id - LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id + LEFT JOIN mdc_equipment t3 ON t2.equipment_id = t3.equipment_id <where> <if test="mdcProcessQuantity.equipmentId != null and mdcProcessQuantity.equipmentId != ''"> - AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') + AND t3.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') </if> <if test="mdcProcessQuantity.equipmentName != null and mdcProcessQuantity.equipmentName != ''"> AND t3.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') @@ -47,7 +47,7 @@ AND t1.process_quantity = #{ mdcProcessQuantity.processQuantity } </if> <if test="mdcProcessQuantity.mdcSectionIds != null and mdcProcessQuantity.mdcSectionIds.size() > 0 "> - AND t1.equipment_id IN + AND t3.equipment_id IN <foreach collection="mdcProcessQuantity.mdcSectionIds" item="id" index="index" open="(" close=")" separator=","> #{ id } </foreach> @@ -60,7 +60,7 @@ <select id="list" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> SELECT t1.id id, - t1.equipment_id equipmentId, + t3.equipment_id equipmentId, t3.equipment_name equipmentName, t2.parts_code partsCode, t2.batch_code batchCode, @@ -77,10 +77,10 @@ FROM mdc_process_quantity t1 LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id - LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id + LEFT JOIN mdc_equipment t3 ON t2.equipment_id = t3.equipment_id <where> <if test="mdcProcessQuantity.equipmentId != null and mdcProcessQuantity.equipmentId != ''"> - AND t1.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') + AND t3.equipment_id LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentId }),'%') </if> <if test="mdcProcessQuantity.equipmentName != null and mdcProcessQuantity.equipmentName != ''"> AND t3.equipment_name LIKE CONCAT(CONCAT('%',#{ mdcProcessQuantity.equipmentName }),'%') @@ -101,7 +101,7 @@ AND t1.process_quantity = #{ mdcProcessQuantity.processQuantity } </if> <if test="mdcProcessQuantity.mdcSectionIds != null and mdcProcessQuantity.mdcSectionIds.size() > 0 "> - AND t1.equipment_id IN + AND t3.equipment_id IN <foreach collection="mdcProcessQuantity.mdcSectionIds" item="id" index="index" open="(" close=")" separator=","> #{ id } </foreach> @@ -114,7 +114,7 @@ <select id="findById" resultType="org.jeecg.modules.mdc.dto.MdcProcessQuantityDto"> SELECT t1.id id, - t1.equipment_id equipmentId, + t3.equipment_id equipmentId, t3.equipment_name equipmentName, t2.parts_code partsCode, t2.batch_code batchCode, @@ -130,7 +130,7 @@ t1.update_time updateTime FROM mdc_process_quantity t1 LEFT JOIN mdc_standard_process_duration t2 ON t1.standard_id = t2.id - LEFT JOIN mdc_equipment t3 ON t1.equipment_id = t3.equipment_id + LEFT JOIN mdc_equipment t3 ON t2.equipment_id = t3.equipment_id WHERE t1.id = #{ id } </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3