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/MdcHomeMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml index ad5cadb..b809b98 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml @@ -47,6 +47,7 @@ <select id="getUtilizationByMonth" resultType="java.util.Map"> SELECT SUM(process_long) processLong, + SUM(open_long) openLong, COUNT(*) processDay FROM mdc_equipment_statistical_info @@ -102,4 +103,56 @@ </where> </select> + <select id="getUtilizationByDay" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo"> + SELECT + the_date, + SUM ( process_long ) processLong, + SUM ( open_long ) openLong + FROM + mdc_equipment_statistical_info + <where> + AND the_date = #{date} + <if test="equipmentIdList != null and equipmentIdList.size() > 0 "> + AND equipment_id IN + <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + </where> + GROUP BY + the_date + </select> + + <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo"> + SELECT + equipment_id, + SUM ( process_long ) processLong, + SUM ( open_long ) openLong + FROM + mdc_equipment_statistical_info + <where> + AND the_date BETWEEN #{start} AND #{end} + <if test="equipmentIdList != null and equipmentIdList.size() > 0 "> + AND equipment_id IN + <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + </where> + GROUP BY + equipment_id + </select> + + + <select id="getEquipmentList" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> + SELECT + t1.* + FROM + mdc_equipment t1 + LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id + WHERE + t2.production_id = #{productionId} + </select> + + </mapper> \ No newline at end of file -- Gitblit v1.9.3