From d799fbde44cc568a3e15d78dc6e582ff244ffa89 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期六, 29 三月 2025 16:05:44 +0800
Subject: [PATCH] 1、卧式理片重置任务调整,避免无任务情况下无法将任务交互表的数据清掉 2、中空领取任务界面新增产品名称,便于识别产品 3、调整部分定时任务间隔时间 4、定时任务分隔开,按照两个/多个界面的websocket由一个分为多个 5、取消钢化功能开发中z

---
 hangzhoumesParent/common/servicebase/src/main/resources/mapper/RawGlassStorageDetailsMapper.xml |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/RawGlassStorageDetailsMapper.xml b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/RawGlassStorageDetailsMapper.xml
index e9fc32e..e84942f 100644
--- a/hangzhoumesParent/common/servicebase/src/main/resources/mapper/RawGlassStorageDetailsMapper.xml
+++ b/hangzhoumesParent/common/servicebase/src/main/resources/mapper/RawGlassStorageDetailsMapper.xml
@@ -2,9 +2,26 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.mes.rawglassdetails.mapper.RawGlassStorageDetailsMapper">
 
-    <select id="listBySlotState" resultType="java.lang.Integer">
+    <resultMap id="baseMap" type="com.mes.rawglassdetails.entity.RawGlassStorageDetails">
+        <result column="DEVICE_ID" property="deviceId"/>
+        <result column="SLOT" property="slot"/>
+    </resultMap>
+    <resultMap id="RawGlassStorageDetailsDTO" type="com.mes.rawglassdetails.entity.dto.RawGlassStorageDetailsDTO">
+        <result property="patternWidth" column="pattern_width"/>
+        <result property="patternHeight" column="pattern_height"/>
+        <result property="patternThickness" column="pattern_thickness"/>
+        <result property="filmsId" column="films_id"/>
+        <result property="count" column="count"/>
+        <result property="finishCount" column="finishCount"/>
+        <result property="damageCount" column="damageCount"/>
+        <!-- 濡傛灉鏈夊叾浠栧瓧娈碉紝璇风户缁坊鍔� -->
+    </resultMap>
+
+
+    <select id="listBySlotState" resultMap="baseMap">
         SELECT
-        T.SLOT
+        T.SLOT,
+        T.DEVICE_ID
         FROM
         RAW_GLASS_STORAGE_STATION T
         LEFT JOIN RAW_GLASS_STORAGE_DETAILS AS T1 ON T.DEVICE_ID = T1.DEVICE_ID
@@ -21,4 +38,43 @@
         </foreach>
         AND T1.SLOT IS NULL
     </select>
+
+    <select id="patternUsage" resultMap="RawGlassStorageDetailsDTO">
+        select rgsd.pattern_width,
+        rgsd.pattern_height,
+        rgsd.pattern_thickness,
+        rgsd.films_id,
+        ifnull(rgsd.count,0) + ifnull(sum(lgdth.finish_count),0) + ifnull(sum(damage_count),0) as totalCount,
+        ifnull(rgsd.count,0) as count,
+        ifnull(sum(lgdth.finish_count),0) as finishCount,
+        ifnull(sum(damage_count),0) as damageCount
+        from (select pattern_width,
+        pattern_height,
+        pattern_thickness,
+        films_id,
+        sum(case when state = 100 then remain_quantity else 0 end) as count
+        from raw_glass_storage_details
+        group by pattern_width, pattern_height, pattern_thickness, films_id) as rgsd
+        left JOIN load_glass_device_task_history as lgdth
+        on rgsd.pattern_width = lgdth.raw_glass_width
+        and rgsd.pattern_height = lgdth.raw_glass_height
+        and rgsd.pattern_thickness = lgdth.raw_glass_thickness
+        and rgsd.films_id = lgdth.raw_glass_films_id
+        <where>
+            1=1
+            <if test="width != null and width != ''">
+                and rgsd.pattern_width like concat('%', #{width}, '%')
+            </if>
+            <if test="height != null and height != ''">
+                and rgsd.pattern_height like concat('%', #{height}, '%')
+            </if>
+            <if test="thickness != null and thickness != ''">
+                and rgsd.pattern_thickness like concat('%', #{thickness}, '%')
+            </if>
+            <if test="films != null and films != ''">
+                and rgsd.films_id like concat('%', #{films}, '%')
+            </if>
+        </where>
+        group by rgsd.pattern_width, rgsd.pattern_height, rgsd.pattern_thickness, rgsd.films_id
+    </select>
 </mapper>

--
Gitblit v1.8.0