From fc7b97877ca01587fe4b3e6c7ac2f9f5be8dcc53 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期三, 10 七月 2024 16:10:42 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/mapper/DownGlassInfoMapper.xml | 75 +++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/mapper/DownGlassInfoMapper.xml b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/mapper/DownGlassInfoMapper.xml
new file mode 100644
index 0000000..76a9216
--- /dev/null
+++ b/hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/mapper/DownGlassInfoMapper.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mes.downglassinfo.mapper.DownGlassInfoMapper">
+
+ <resultMap id="downGlassInfoDTO" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO">
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="layer" property="layer"/>
+ <result column="count" property="count"/>
+ </resultMap>
+ <resultMap id="downGlassInfo" type="com.mes.downworkstation.entity.dto.DownGlassInfoDTO">
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="layer" property="layer"/>
+ <result column="count" property="count"/>
+ <collection property="glassInfoList" ofType="com.mes.glassinfo.entity.GlassInfo">
+ <id column="id" property="id"/>
+ <result column="flow_card_id" property="flowCardId"/>
+ <result column="glass_type" property="glassType"/>
+ <result column="width" property="width"/>
+ <result column="height" property="height"/>
+ <result column="thickness" property="thickness"/>
+ <result column="filmsid" property="filmsid"/>
+ <result column="total_layer" property="totalLayer"/>
+ <result column="layer" property="layer"/>
+ </collection>
+ </resultMap>
+
+ <select id="queryDownGlassMaxLayer" resultMap="downGlassInfoDTO">
+ SELECT flow_card_id,
+ layer,
+ COUNT(layer) AS count
+ FROM
+ down_glass_info
+ WHERE
+ flow_card_id = #{flowCardId}
+ GROUP BY
+ flow_card_id,
+ layer
+ order by count desc limit 1
+ </select>
+ <select id="queryMaxSequence" resultType="java.lang.Integer">
+ SELECT max(sequence) + 1 as sequence
+ FROM down_glass_info
+ WHERE flow_card_id = #{flowCardId}
+ AND layer = #{layer}
+ </select>
+
+ <select id="queryWorkStationIsIn" resultMap="downGlassInfo">
+ SELECT T.*
+ <if test="!isDownload">
+ ,T1.*
+ </if>
+ FROM (
+ SELECT T.FLOW_CARD_ID,
+ T.LAYER,
+ COUNT(T.LAYER) AS COUNT
+ FROM
+ DOWN_WORKSTATION T
+ LEFT JOIN DOWN_GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID
+ GROUP BY T.FLOW_CARD_ID,LAYER
+ HAVING T.FLOW_CARD_ID IS NOT NULL
+ ) T
+ INNER JOIN GLASS_INFO T1 ON T.FLOW_CARD_ID = T1.FLOW_CARD_ID
+ AND T.LAYER = T1.LAYER
+ LEFT JOIN DOWN_GLASS_INFO T2 ON T1.GLASS_ID = T2.GLASS_ID
+ <where>
+ <if test="isDownload">
+ AND T2.GLASS_ID IS NULL
+ </if>
+ <if test="!isDownload">
+ AND T2.GLASS_ID IS not NULL
+ </if>
+ </where>
+ order by t.count desc
+ </select>
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0