From 56e8ccde7c982bc2a5b9746edb2e596c895f63e6 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 13 十二月 2023 15:20:07 +0800 Subject: [PATCH] 利用率页面添加平均值和合计值 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRepairMapper.xml | 39 ++++++++++++++++++++++++++++++--------- 1 files changed, 30 insertions(+), 9 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRepairMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRepairMapper.xml index 9159e09..80e6716 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRepairMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRepairMapper.xml @@ -5,30 +5,51 @@ <!-- 鏍规嵁杞﹂棿灞傜骇鏌ヨ璁惧缁翠慨鍒楄〃 --> <select id="pageList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRepair"> SELECT - mer.* + * FROM - MDC_EQUIPMENT_REPAIR mer - LEFT JOIN MDC_EQUIPMENT me ON mer.EQUIPMENT_ID = me.EQUIPMENT_ID + mdc_equipment_repair WHERE 1=1 <if test="repair.equipmentName != null and repair.equipmentName != '' "> - AND mer.EQUIPMENT_NAME LIKE CONCAT(CONCAT('%',#{repair.equipmentName}),'%') + AND equipment_name LIKE CONCAT(CONCAT('%',#{repair.equipmentName}),'%') </if> <if test="repair.equipmentId != null and repair.equipmentId != '' "> - AND mer.EQUIPMENT_ID LIKE CONCAT(CONCAT('%',#{repair.equipmentId}),'%') + AND equipment_id LIKE CONCAT(CONCAT('%',#{repair.equipmentId}),'%') </if> <if test="repair.startTime != null "> - AND mer.END_TIME >= #{ repair.startTime } + AND end_time >= #{ repair.startTime } </if> <if test="repair.endTime != null "> - AND mer.START_TIME <= #{ repair.endTime } + AND start_time <= #{ repair.endTime } </if> <if test="repair.mdcSectionIds != null and repair.mdcSectionIds.size() > 0 "> - AND mer.EQUIPMENT_ID IN + AND equipment_id IN <foreach collection="repair.mdcSectionIds" item="id" index="index" open="(" close=")" separator=","> #{ id } </foreach> </if> - ORDER BY START_TIME ASC + ORDER BY start_time ASC,equipment_id ASC + </select> + + <!--鏌ヨ鏌愭鏃堕棿鍐呮槸鍚︽湁缁翠慨浼戠彮鏁版嵁--> + <select id="selectByIdAndTime" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRepair"> + SELECT + * + FROM + mdc_equipment_repair + <where> + <if test="equipmentId != null and equipmentId!= ''"> + AND equipment_id = #{ equipmentId } + </if> + <if test="startTime != null and endTime!= null"> + AND ( + ( START_TIME <![CDATA[ >= ]]> #{ startTime } AND START_TIME <![CDATA[ <= ]]> #{ endTime } ) + OR ( START_TIME <![CDATA[ <= ]]> #{ startTime } AND END_TIME <![CDATA[ >= ]]> #{ endTime }) + OR ( END_TIME <![CDATA[ >= ]]> #{ startTime } AND END_TIME <![CDATA[ <= ]]> #{ endTime } ) + OR ( START_TIME <![CDATA[ <= ]]> #{ startTime } AND END_TIME <![CDATA[ >= ]]> #{ endTime } ) + ) + </if> + </where> + ORDER BY start_time ASC </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3