wenwj
2025-04-11 b89faef13acb23d42d8f2f53b493cf90286c8e23
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
<?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.ApsProcessRouteMapper">
 
    <resultMap type="ApsProcessRoute" id="ApsProcessRouteResult">
        <result property="id"    column="id"    />
        <result property="itemNo"    column="item_no"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="processNumber"    column="process_number"    />
        <result property="processName"    column="process_name"    />
        <result property="processPlanStartDay"    column="process_plan_start_day"    />
        <result property="processPlanEndDay"    column="process_plan_end_day"    />
        <result property="notStartWorkCount"    column="not_start_work_count"    />
        <result property="completedCount"    column="completed_count"    />
        <result property="discardCount"    column="discard_count"    />
        <result property="integrationDay"    column="integration_day"    />
        <result property="plant"    column="plant"    />
        <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"    />
    </resultMap>
 
    <sql id="selectApsProcessRouteVo">
        select id, item_no, work_order_no, process_number, process_name, process_plan_start_day, process_plan_end_day, not_start_work_count, completed_count, discard_count, integration_day, plant, del_flag, create_by, create_time, update_by, update_time from aps_process_route
    </sql>
 
    <select id="selectApsProcessRouteList" parameterType="ApsProcessRoute" resultMap="ApsProcessRouteResult">
        <include refid="selectApsProcessRouteVo"/>
        <where>
            <if test="itemNo != null  and itemNo != ''"> and item_no like  '%' || #{itemNo} || '%' </if>
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="processNumber != null "> and process_number = #{processNumber}</if>
            <if test="processName != null  and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
            <if test="processPlanStartDay != null "> and process_plan_start_day = #{processPlanStartDay}</if>
            <if test="processPlanEndDay != null "> and process_plan_end_day = #{processPlanEndDay}</if>
            <if test="notStartWorkCount != null "> and not_start_work_count = #{notStartWorkCount}</if>
            <if test="completedCount != null "> and completed_count = #{completedCount}</if>
            <if test="discardCount != null "> and discard_count = #{discardCount}</if>
            <if test="integrationDay != null "> and integration_day = #{integrationDay}</if>
            <if test="plant != null  and plant != ''"> and plant = #{plant}</if>
        </where>
    </select>
 
    <select id="selectApsProcessRouteById" parameterType="String" resultMap="ApsProcessRouteResult">
    </select>
 
    <insert id="insertApsProcessRoute" parameterType="ApsProcessRoute">
        insert into aps_process_route
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="itemNo != null">item_no,</if>
            <if test="workOrderNo != null">work_order_no,</if>
            <if test="processNumber != null">process_number,</if>
            <if test="processName != null">process_name,</if>
            <if test="processPlanStartDay != null">process_plan_start_day,</if>
            <if test="processPlanEndDay != null">process_plan_end_day,</if>
            <if test="notStartWorkCount != null">not_start_work_count,</if>
            <if test="completedCount != null">completed_count,</if>
            <if test="discardCount != null">discard_count,</if>
            <if test="integrationDay != null">integration_day,</if>
            <if test="plant != null">plant,</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>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="itemNo != null">#{itemNo},</if>
            <if test="workOrderNo != null">#{workOrderNo},</if>
            <if test="processNumber != null">#{processNumber},</if>
            <if test="processName != null">#{processName},</if>
            <if test="processPlanStartDay != null">#{processPlanStartDay},</if>
            <if test="processPlanEndDay != null">#{processPlanEndDay},</if>
            <if test="notStartWorkCount != null">#{notStartWorkCount},</if>
            <if test="completedCount != null">#{completedCount},</if>
            <if test="discardCount != null">#{discardCount},</if>
            <if test="integrationDay != null">#{integrationDay},</if>
            <if test="plant != null">#{plant},</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>
        </trim>
    </insert>
 
    <update id="updateApsProcessRoute" parameterType="ApsProcessRoute">
        update aps_process_route
        <trim prefix="SET" suffixOverrides=",">
            <if test="itemNo != null">item_no = #{itemNo},</if>
            <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
            <if test="processNumber != null">process_number = #{processNumber},</if>
            <if test="processName != null">process_name = #{processName},</if>
            <if test="processPlanStartDay != null">process_plan_start_day = #{processPlanStartDay},</if>
            <if test="processPlanEndDay != null">process_plan_end_day = #{processPlanEndDay},</if>
            <if test="notStartWorkCount != null">not_start_work_count = #{notStartWorkCount},</if>
            <if test="completedCount != null">completed_count = #{completedCount},</if>
            <if test="discardCount != null">discard_count = #{discardCount},</if>
            <if test="integrationDay != null">integration_day = #{integrationDay},</if>
            <if test="plant != null">plant = #{plant},</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="deleteApsProcessRouteById" parameterType="String">
        delete from aps_process_route where id = #{id}
    </delete>
 
    <delete id="deleteApsProcessRouteByIds" parameterType="String">
        delete from aps_process_route where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>