wangfei
2025-10-14 d271d4f365b0f76b415d49725652d8a575028fba
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
<?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.uppattenusage.mapper.UpPattenUsageMapper">
 
    <resultMap id="baseMap" type="com.mes.uppattenusage.entity.vo.UpPattenUsageVO">
        <result column="id" property="id"/>
        <result column="engineering_id" property="engineeringId"/>
        <result column="films_id" property="filmsId"/>
        <result column="width" property="width"/>
        <result column="height" property="height"/>
        <result column="thickness" property="thickness"/>
        <result column="layout_sequence" property="layoutSequence"/>
        <result column="state" property="state"/>
        <result column="group_number" property="groupNumber"/>
    </resultMap>
    <select id="queryRawGlassByEngineeringId" resultMap="baseMap">
        SET @prev_width := NULL;
        SET @prev_height := NULL;
        SET @counter := 0;
        SELECT t.*,
               @counter := IF(@prev_width = width and @prev_height = height, @counter, @counter + 1) AS group_number,
               @prev_width := width,
               @prev_height := height
        FROM up_patten_usage t
        where t.engineering_id = #{engineeringId}
          and t.state = 0
        ORDER BY t.layout_sequence
    </select>
    <select id="queryFinishByEngineering" resultType="java.lang.Integer">
        SELECT id
        FROM up_patten_usage
        WHERE engineering_id IN (SELECT engineer_id FROM engineering WHERE station_cell = #{stationCell} AND state = 1)
          and state = 0
        order by id
        LIMIT ${finishCount}
    </select>
 
 
</mapper>