zhanghl
2025-05-19 61eb6b9768f341be77fa02e527a817caf3521bfb
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?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.aps.core.mapper.ApsPlateProcessShopStatMapper">
    
    <resultMap type="com.aps.core.domain.ApsPlate.ApsPlateProcessShopStat" id="ApsPlateProcessShopStatResult">
        <result property="id"    column="id"    />
        <result property="docNo"    column="doc_no"    />
        <result property="shopCode"    column="shop_code"    />
        <result property="shopName"    column="shop_name"    />
        <result property="planStartDate"    column="plan_start_date"    />
        <result property="planEndDate"    column="plan_end_date"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="processNumber"    column="process_number"    />
        <result property="workCenter"    column="work_center"    />
 
    </resultMap>
 
    <sql id="selectApsPlateProcessShopStatVo">
        select id, doc_no, shop_code, shop_name, plan_start_date, plan_end_date, del_flag, create_by, create_time, update_by, update_time,
               process_number,work_center
        from aps_plate_process_shop_stat
    </sql>
 
    <select id="selectApsPlateProcessShopStatList" parameterType="com.aps.core.domain.ApsPlate.ApsPlateProcessShopStat" resultMap="ApsPlateProcessShopStatResult">
        <include refid="selectApsPlateProcessShopStatVo"/>
        <where>  
            <if test="docNo != null  and docNo != ''"> and doc_no = #{docNo}</if>
            <if test="shopCode != null  and shopCode != ''"> and shop_code = #{shopCode}</if>
            <if test="shopName != null  and shopName != ''"> and shop_name = #{shopName}</if>
            <if test="planStartDate != null  and planStartDate != ''"> and plan_start_date = #{planStartDate}</if>
            <if test="planEndDate != null  and planEndDate != ''"> and plan_end_date = #{planEndDate}</if>
 
            <if test="processNumber != null  and processNumber != ''"> and process_number = #{processNumber}</if>
            <if test="workCenter != null  and workCenter != ''"> and work_center = #{workCenter}</if>
            and del_flag='0'
        </where>
    </select>
    
    <select id="selectApsPlateProcessShopStatById" parameterType="Long" resultMap="ApsPlateProcessShopStatResult">
        <include refid="selectApsPlateProcessShopStatVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertApsPlateProcessShopStat" parameterType="com.aps.core.domain.ApsPlate.ApsPlateProcessShopStat" useGeneratedKeys="true" keyProperty="id">
        insert into aps_plate_process_shop_stat
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="docNo != null">doc_no,</if>
            <if test="shopCode != null">shop_code,</if>
            <if test="shopName != null">shop_name,</if>
            <if test="planStartDate != null">plan_start_date,</if>
            <if test="planEndDate != null">plan_end_date,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="processNumber != null">process_number,</if>
            <if test="workCenter != null">work_center,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="docNo != null">#{docNo},</if>
            <if test="shopCode != null">#{shopCode},</if>
            <if test="shopName != null">#{shopName},</if>
            <if test="planStartDate != null">#{planStartDate},</if>
            <if test="planEndDate != null">#{planEndDate},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="processNumber != null">#{processNumber},</if>
            <if test="workCenter != null">#{workCenter},</if>
         </trim>
    </insert>
 
    <update id="updateApsPlateProcessShopStat" parameterType="com.aps.core.domain.ApsPlate.ApsPlateProcessShopStat">
        update aps_plate_process_shop_stat
        <trim prefix="SET" suffixOverrides=",">
            <if test="docNo != null">doc_no = #{docNo},</if>
            <if test="shopCode != null">shop_code = #{shopCode},</if>
            <if test="shopName != null">shop_name = #{shopName},</if>
            <if test="planStartDate != null">plan_start_date = #{planStartDate},</if>
            <if test="planEndDate != null">plan_end_date = #{planEndDate},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteApsPlateProcessShopStatById" parameterType="Long">
        delete from aps_plate_process_shop_stat where id = #{id}
    </delete>
 
    <delete id="deleteApsPlateProcessShopStatByIds" parameterType="String">
        delete from aps_plate_process_shop_stat where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <delete id="deleteAll" >
        delete from aps_plate_process_shop_stat where del_flag in ('0','1')
    </delete>
 
    <insert id="batchInsert" parameterType="java.util.List">
        insert into aps_plate_process_shop_stat
        (doc_no, shop_code, shop_name, plan_start_date, plan_end_date, del_flag, create_by, create_time,
         process_number, work_center
        )
        values
        <foreach collection="list" item="item" separator=",">
        (
            #{item.docNo},
            #{item.shopCode},
            #{item.shopName},
            #{item.planStartDate},
            #{item.planEndDate},
            #{item.delFlag},
            #{item.createBy},
            #{item.createTime},
            #{item.processNumber},
            #{item.workCenter}
        )
        </foreach>
    </insert>
</mapper>