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-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml | 161 +++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 129 insertions(+), 32 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml index 0a1d0b9..50d892f 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EquipmentReportRepairMapper.xml @@ -3,42 +3,52 @@ <mapper namespace="org.jeecg.modules.eam.mapper.EquipmentReportRepairMapper"> <select id="getReportRepairList" parameterType="Map" resultType="Map"> SELECT - t1.id, - t1.err_uda1 errUda1, - t1.err_uda2 errUda2, - t1.num num, - t1.equipment_id equipmentId, - t1.fault_reason faultReason, - t1.fault_description faultDescription, - t1.photo photo, - t1.is_stop isStop, - t1.approval approval, - t1.fault_time faultTime, - t1.source source, - t1.source_id sourceId, - t1.urgency urgency, - t1.is_create_order isCreateOrder, - t1.use_depart_id useDepartId, - t1.remark remark, - t1.status status, - t1.create_by createBy, - t1.create_time createTime, - t1.update_by updateBy, - t1.update_time updateTime, - t2.num equipmentNum, - t2.name equipmentName, - t2.model equipmentModel, - t2.team_id teamId, - t2.specification equipmentSpecification, - t3.depart_name departName, - t4.item_text urgencyName, - t5.item_text statusName, - t6.item_text isStopName, - t7.item_text errUda1_dictText + t1.id, + t1.err_uda1 errUda1, + t1.err_uda2 errUda2, + t1.num num, + t1.equipment_id equipmentId, + t1.fault_reason faultReason, + t1.fault_description faultDescription, + t1.photo photo, + t1.is_stop isStop, + t1.approval approval, + t1.fault_time faultTime, + t1.type, + t1.source source, + t1.source_id sourceId, + t1.urgency urgency, + t1.is_create_order isCreateOrder, + t1.use_depart_id useDepartId, + t1.remark remark, + t1.status status, + t1.create_by createBy, + t1.create_time createTime, + t1.update_by updateBy, + t1.update_time updateTime, + t1.accept_time acceptTime, + t1.fault_hour faultHour, + t2.num equipmentNum, + t2.name equipmentName, + t2.model equipmentModel, + t2.specific_equipment specificEquipment, + t2.team_id teamId, + t2.specification equipmentSpecification, + t3.depart_name departName, + t4.item_text urgencyName, + t5.item_text statusName, + t6.item_text isStopName, + t7.item_text errUda1_dictText, + t8.id quanlityId, + t9.id faultInfoId, + t8.is_confirm isConfirm1, + t9.is_confirm isConfirm2 FROM mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id left join sys_depart t3 on t1.use_depart_id = t3.id + left join mom_eam_quanlity_confirm t8 on t1.id = t8.report_id + left join mom_eam_fault_info t9 on t8.id = t9.quanlity_id left join (select * from v_sys_dict where dict_code='urgency') t4 on t1.urgency = t4.item_value left join (select * from v_sys_dict where dict_code='equipment_report_repair_status') t5 on t1.status = t5.item_value left join (select * from v_sys_dict where dict_code='is_stop') t6 on t1.is_stop = t6.item_value @@ -86,6 +96,9 @@ <if test="params.model != null and params.model != ''"> and t2.model like concat('%',#{params.model},'%') </if> + <if test="params.specificEquipment != null and params.specificEquipment != ''"> + and t2.specific_equipment = #{params.specificEquipment} + </if> <if test="params.specification != null and params.specification != ''"> and t2.specification like concat('%',#{params.specification},'%') </if> @@ -103,4 +116,88 @@ </if> ORDER BY t1.create_time desc </select> + <select id="exportList" resultType="org.jeecg.modules.eam.vo.RepairReportExportVo"> + SELECT + t1.id, + t1.err_uda1 errUda1, + t1.err_uda2 errUda2, + t1.num num, + t1.equipment_id equipmentId, + t1.fault_reason faultReason, + t1.fault_description faultDescription, + t1.photo photo, + t1.is_stop isStop, + t1.approval approval, + t1.fault_time faultTime, + t1.source source, + t1.source_id sourceId, + t1.urgency urgency, + t1.is_create_order isCreateOrder, + t1.use_depart_id useDepartId, + t1.remark remark, + t1.status status, + t1.create_by createBy, + t1.create_time createTime, + t1.update_by updateBy, + t1.update_time updateTime, + t1.accept_time acceptTime, + t1.fault_hour faultHour, + t2.num equipmentNum, + t2.name equipmentName, + t2.model equipmentModel, + t2.team_id teamId, + t2.specification specification, + t2.use_id useId, + t2.specific_equipment specificEquipment + FROM + mom_eam_equipment_report_repair t1 + left join mom_eam_equipment t2 on t1.equipment_id = t2.id + WHERE t1.del_flag = 0 + <if test="num != null and num != ''"> + and t1.num like concat('%',#{num},'%') + </if> + <if test="faultStartTime != null and faultStartTime != ''"> + and t1.fault_time >= #{faultStartTime} + </if> + <if test="faultEndTime != null and faultEndTime != ''"> + and t1.fault_time <= #{faultEndTime} + </if> + <if test="isStop != null and isStop != ''"> + and t1.is_stop = #{isStop} + </if> + <if test="status != null and status != ''"> + and t1.status = #{status} + </if> + <if test="errUda2 != null and errUda2 != ''"> + and t1.err_uda2 like concat('%',#{errUda2},'%') + </if> + <if test="errUda1 != null and errUda1 != ''"> + and t1.err_uda1 = #{errUda1} + </if> + <if test="createBy!= null and createBy != ''"> + and t1.create_by like concat('%',#{createBy},'%') + </if> + <if test="equipmentNum != null and equipmentNum != ''"> + and t2.num like concat('%',#{equipmentNum},'%') + </if> + <if test="equipmentName != null and equipmentName != ''"> + and t2.name like concat('%',#{equipmentName},'%') + </if> + <if test="equipmentModel != null and equipmentModel != ''"> + and t2.model like concat('%',#{model},'%') + </if> + <if test="specification != null and specification != ''"> + and t2.specification like concat('%',#{specification},'%') + </if> + <if test="useId != null and useId != ''"> + and t2.use_id = #{useId} + </if> + <if test="equipNums.size!=0"> + and t2.num in + <foreach collection="equipNums" open="(" separator="," close=")" item="num"> + #{num} + </foreach> + </if> + ORDER BY t1.create_time desc + </select> </mapper> -- Gitblit v1.9.3