From c6cb57f307b0c62a05cac78cfd828c313f10e611 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 15 四月 2025 10:58:25 +0800
Subject: [PATCH] 1、卧式理片笼新增任务逻辑 2、入参时间加入时区
---
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 11 deletions(-)
diff --git a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml
index 00ab0ae..5d7d496 100644
--- a/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml
+++ b/hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/mapper/EdgStorageCageDetailsMapper.xml
@@ -74,19 +74,57 @@
</select>
<select id="querySlotRemainWidth" resultType="com.mes.edgstoragecage.entity.vo.EdgSlotRemainVO">
- select device_id,slot, if(#{cellLength} - sum(GREATEST(width,height)+#{glassGap}) < 0 ,0,#{cellLength} -
- sum(GREATEST(width,height)+#{glassGap}) )as
- remain_width from edg_storage_cage_details where state = 100 group by device_id,slot
+ select device_id,
+ slot,
+ if(#{cellLength} - sum(GREATEST(width, height) + #{glassGap}) < 0, 0, #{cellLength} -
+ sum(GREATEST(width, height) + #{glassGap})) as
+ remain_width
+ from edg_storage_cage_details
+ where state = 100
+ group by device_id, slot
+ </select>
+ <select id="queryEdgStorageDetailsByLimitSize" resultMap="baseMap">
+ SELECT t1.*
+ FROM edg_storage_cage t
+ LEFT JOIN edg_storage_cage_details t1 ON t.device_id = t1.device_id
+ AND t.slot = t1.slot
+ <where>
+ t.enable_state = 1
+ AND t1.state = 100
+ AND t1.device_id = #{deviceId}
+ <if test="width != 0">
+ and t.width = #{width}
+ </if>
+ <if test="height != 0">
+ and t.height = #{height}
+ </if>
+ <if test="cell == 1">
+ and #{minOneFirstLength} <= GREATEST(t.width, t.width)
+ and #{minOneSecondLength} <= least(t.width, t.width)
+ </if>
+ <if test="cell == 2">
+ and #{maxTwoFirstLength} >= GREATEST(t.width, t.width)
+ and #{maxTwoSecondLength} >= least(t.width, t.width)
+ </if>
+ </where>
+ ORDER BY abs(t.slot - #{currentCell})
+ limit 1
</select>
<select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO">
- SELECT
- round(sum( CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END ),2) as oneCompletedQuantity,
- round(sum( CASE WHEN e.station_cell = 5 THEN escd.width*escd.height/1000000 ELSE 0 END ),2) as oneCompletedArea,
- round(sum( CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END ),2) as twoCompletedQuantity,
- round(sum( CASE WHEN e.station_cell = 6 THEN escd.width*escd.height/1000000 ELSE 0 END ),2) as twoCompletedArea,
- round(sum( CASE WHEN e.station_cell = 5 and escd.device_id is null THEN 1 ELSE 0 END ),2) as oneUncompletedQuantity,
- round(sum( CASE WHEN e.station_cell = 5 and escd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as oneUncompletedArea,
- round(sum( CASE WHEN e.station_cell = 6 and escd.device_id is null THEN 1 ELSE 0 END ),2) as twoUncompletedQuantity,
+ SELECT round(sum(CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END), 2) as oneCompletedQuantity,
+ round(sum(CASE WHEN e.station_cell = 5 THEN escd.width * escd.height / 1000000 ELSE 0 END),
+ 2) as oneCompletedArea,
+ round(sum(CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END), 2) as twoCompletedQuantity,
+ round(sum(CASE WHEN e.station_cell = 6 THEN escd.width * escd.height / 1000000 ELSE 0 END),
+ 2) as twoCompletedArea,
+ round(sum(CASE WHEN e.station_cell = 5 and escd.device_id is null THEN 1 ELSE 0 END),
+ 2) as oneUncompletedQuantity,
+ round(sum(CASE
+ WHEN e.station_cell = 5 and escd.device_id is null THEN gi.width * gi.height / 1000000
+ ELSE 0 END),
+ 2) as oneUncompletedArea,
+ round(sum(CASE WHEN e.station_cell = 6 and escd.device_id is null THEN 1 ELSE 0 END),
+ 2) as twoUncompletedQuantity,
round(sum( CASE WHEN e.station_cell = 6 and escd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as twoUncompletedArea
FROM
glass_info gi
--
Gitblit v1.8.0