春风项目四线(合箱线、总装线)
wujian
2024-09-10 51b05b093fa15dd477981372f67ae7b3b2747733
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?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.jcdm.main.da.passingStationCollection.mapper.ProductNewPassStationMapper">
    
    <resultMap type="ProductNewPassStation" id="ProductNewPassStationResult">
        <result property="id"    column="id"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="rodCode"    column="rod_code"    />
        <result property="finishFlag"    column="finish_flag"    />
        <result property="productType"    column="product_type"    />
        <result property="createTime"    column="create_time"    />
        <result property="boxCode"    column="box_code"    />
        <result property="balanceCode"    column="balance_code"    />
    </resultMap>
 
    <sql id="selectProductNewPassStationVo">
        select id, sfc_code,rod_code, finish_flag,product_type,create_time,box_code,balance_code from product_new_pass_station
    </sql>
    <insert id="insertPassStation">
        insert into product_new_pass_station
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="rodCode != null">rod_code,</if>
            <if test="finishFlag != null">finish_flag,</if>
            <if test="createTime != null">create_time,</if>
            <if test="productType != null">product_type,</if>
            <if test="boxCode != null">box_code,</if>
            <if test="balanceCode != null">balance_code,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="rodCode != null">#{rodCode},</if>
            <if test="finishFlag != null">#{finishFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="productType != null">#{productType},</if>
            <if test="boxCode != null">#{boxCode},</if>
            <if test="balanceCode != null">#{balanceCode},</if>
        </trim>
    </insert>
    <update id="updatePassStation">
        update product_new_pass_station
        <trim prefix="SET" suffixOverrides=",">
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="rodCode != null">#{rodCode},</if>
            <if test="finishFlag != null">#{finishFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="productType != null">#{productType},</if>
            <if test="boxCode != null">#{boxCode},</if>
            <if test="balanceCode != null">#{balanceCode},</if>
        </trim>
        where id = #{productNewPassStation.id}
    </update>
    <update id="updatePassStationBySfcCode">
        update product_new_pass_station set finish_flag = '1' where sfc_code = #{sfcCode}
    </update>
    <update id="updatePassStationRodCodeBySfcCode"> update product_new_pass_station set finish_flag = '1' where sfc_code = #{sfcCode}</update>
    <update id="updatePassStationBalanceCode">
        update product_new_pass_station set balance_code = #{balanceCode} where sfc_code = #{sfcCode}
    </update>
    <update id="updatePassStationRodCode">
        update product_new_pass_station set rod_code = #{rodCode} where sfc_code = #{sfcCode}
    </update>
    <update id="updateBoxCodeBySfcCode">
        update product_new_pass_station set box_code = #{newBoxCode} where sfc_code = #{sfcCode}
    </update>
    <select id="getPassStation"
            resultMap="ProductNewPassStationResult">
        <include refid="selectProductNewPassStationVo"/>
        <where>
            <if test="sfcCode != null">and sfc_code = #{sfcCode}</if>
            <if test="rodCode != null">and rod_code = #{rodCode}</if>
            <if test="finishFlag != null">and finish_flag = #{finishFlag}</if>
            <if test="productType != null">and product_type = #{productType}</if>
            <if test="boxCode != null">and box_code = #{boxCode}</if>
            <if test="balanceCode != null">and balance_code = #{balanceCode}</if>
        </where>
    </select>
    <select id="getProductPassStationList"
            resultMap="ProductNewPassStationResult">
        <include refid="selectProductNewPassStationVo"/>
        <where>
            <if test="sfcCode != null">and sfc_code = #{sfcCode}</if>
            <if test="rodCode != null">and rod_code = #{rodCode}</if>
            <if test="finishFlag != null">and finish_flag = #{finishFlag}</if>
            <if test="productType != null">and product_type = #{productType}</if>
            <if test="boxCode != null">and box_code = #{boxCode}</if>
            <if test="balanceCode != null">and balance_code = #{balanceCode}</if>
        </where>
    </select>
    <select id="getProductPassStationListByEngineList"
            resultMap="ProductNewPassStationResult">
        <include refid="selectProductNewPassStationVo"/>
            <where>
                sfc_code in
                <foreach collection="engineNoList" item="sfcCode" open="(" separator="," close=")">
                    #{sfcCode}
                </foreach>
            </where>
    </select>
 
 
</mapper>