zhoushihao
2024-07-24 9b3f76e38ea10241625cee9ea6e9fa69e792d38b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?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.downstorage.mapper.DownStorageCageDetailsMapper">
 
    <resultMap id="downStorageCageDetails" type="com.mes.downstorage.entity.DownStorageCageDetails">
        <id column="id" property="id"/>
        <result column="slot" property="slot"/>
        <result column="glass_id" property="glassId"/>
        <result column="sequence" property="sequence"/>
        <result column="filmsid" property="filmsid"/>
        <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="tempering_layout_id" property="temperingLayoutId"/>
        <result column="tempering_feed_sequence" property="temperingFeedSequence"/>
        <result column="state" property="state"/>
        <result column="gap" property="gap"/>
        <result column="total_layer" property="totalLayer"/>
        <result column="layer" property="layer"/>
    </resultMap>
 
    <select id="getGlassInfoMaxCount" resultMap="downStorageCageDetails">
        SELECT *
        FROM DOWN_STORAGE_CAGE_DETAILS
        WHERE (FLOW_CARD_ID, LAYER) = (SELECT FLOW_CARD_ID, LAYER
        FROM DOWN_STORAGE_CAGE_DETAILS
        WHERE STATE = 100
        and (FLOW_CARD_ID, LAYER) not in (
        select FLOW_CARD_ID, LAYER from down_workstation where workstation_id in
        <foreach collection="workList" item="item" open='(' close=')' separator=','>
            #{item}
        </foreach>
        )
 
        GROUP BY FLOW_CARD_ID, LAYER
        ORDER BY COUNT(FLOW_CARD_ID) DESC
        LIMIT 1 )
        AND STATE = 100
        ORDER BY
        WIDTH DESC,
        HEIGHT DESC
        LIMIT 1
    </select>
 
 
</mapper>