sfd
2025-05-26 2a64b537e8e3bce9ce030585a3da17d48379c0ad
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
135
136
<?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.ApsStandardProcessMapper">
    
    <resultMap type="com.aps.core.domain.ApsStandardProcess" id="ApsStandardProcessResult">
        <result property="id"    column="id"    />
        <result property="processNumber"    column="process_number"    />
        <result property="processName"    column="process_name"    />
        <result property="resourceGroupName"    column="resource_group_name"    />
        <result property="model"    column="model"    />
        <result property="designCapacity"    column="design_capacity"    />
        <result property="plantId"    column="plant_id"    />
        <result property="plant"    column="plant"    />
        <result property="workShopId"    column="work_shop_id"    />
        <result property="workShop"    column="work_shop"    />
        <result property="workCalenderId"    column="work_calender_id"    />
        <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="modelId"    column="model_id"    />
        <result property="workCalender"    column="work_calender"    />
        <result property="major"    column="major"    />
    </resultMap>
 
    <sql id="selectApsStandardProcessVo">
        select id, process_number, process_name, resource_group_name, model, design_capacity, plant_id, plant, work_shop_id, work_shop, work_calender_id, del_flag, create_by, create_time, update_by, update_time, model_id, work_calender,major from aps_standard_process
    </sql>
 
    <select id="selectApsStandardProcessList" parameterType="com.aps.core.domain.ApsStandardProcess" resultMap="ApsStandardProcessResult">
        <include refid="selectApsStandardProcessVo"/>
        <where>  
            <if test="processNumber != null  and processNumber != ''"> and process_number = #{processNumber}</if>
            <if test="processName != null  and processName != ''"> and process_name like '%' || #{processName} ||  '%'</if>
            <if test="resourceGroupName != null  and resourceGroupName != ''"> and resource_group_name like '%' || #{resourceGroupName} || '%'</if>
            <if test="model != null  and model != ''"> and model = #{model}</if>
            <if test="designCapacity != null  and designCapacity != ''"> and design_capacity = #{designCapacity}</if>
            <if test="plantId != null  and plantId != ''"> and plant_id = #{plantId}</if>
            <if test="plant != null  and plant != ''"> and plant = #{plant}</if>
            <if test="workShopId != null  and workShopId != ''"> and work_shop_id = #{workShopId}</if>
            <if test="workShop != null  and workShop != ''"> and work_shop = #{workShop}</if>
            <if test="workCalenderId != null "> and work_calender_id = #{workCalenderId}</if>
            <if test="modelId != null "> and model_id = #{modelId}</if>
            <if test="workCalender != null  and workCalender != ''"> and work_calender = #{workCalender}</if>
            <if test="major != null  and major != ''"> and major = #{major}</if>
        </where>
    </select>
    
    <select id="selectApsStandardProcessById" parameterType="Long" resultMap="ApsStandardProcessResult">
        <include refid="selectApsStandardProcessVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess">
        insert into aps_standard_process
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="processNumber != null">process_number,</if>
            <if test="processName != null">process_name,</if>
            <if test="resourceGroupName != null">resource_group_name,</if>
            <if test="model != null">model,</if>
            <if test="designCapacity != null">design_capacity,</if>
            <if test="plantId != null">plant_id,</if>
            <if test="plant != null">plant,</if>
            <if test="workShopId != null">work_shop_id,</if>
            <if test="workShop != null">work_shop,</if>
            <if test="workCalenderId != null">work_calender_id,</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="modelId != null">model_id,</if>
            <if test="workCalender != null">work_calender,</if>
            <if test="major != null">major,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="processNumber != null">#{processNumber},</if>
            <if test="processName != null">#{processName},</if>
            <if test="resourceGroupName != null">#{resourceGroupName},</if>
            <if test="model != null">#{model},</if>
            <if test="designCapacity != null">#{designCapacity},</if>
            <if test="plantId != null">#{plantId},</if>
            <if test="plant != null">#{plant},</if>
            <if test="workShopId != null">#{workShopId},</if>
            <if test="workShop != null">#{workShop},</if>
            <if test="workCalenderId != null">#{workCalenderId},</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="modelId != null">#{modelId},</if>
            <if test="workCalender != null">#{workCalender},</if>
            <if test="major != null">#{major},</if>
         </trim>
    </insert>
 
    <update id="updateApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess">
        update aps_standard_process
        <trim prefix="SET" suffixOverrides=",">
            <if test="processNumber != null">process_number = #{processNumber},</if>
            <if test="processName != null">process_name = #{processName},</if>
            <if test="resourceGroupName != null">resource_group_name = #{resourceGroupName},</if>
            <if test="model != null">model = #{model},</if>
            <if test="designCapacity != null">design_capacity = #{designCapacity},</if>
            <if test="plantId != null">plant_id = #{plantId},</if>
            <if test="plant != null">plant = #{plant},</if>
            <if test="workShopId != null">work_shop_id = #{workShopId},</if>
            <if test="workShop != null">work_shop = #{workShop},</if>
            <if test="workCalenderId != null">work_calender_id = #{workCalenderId},</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>
            <if test="modelId != null">model_id = #{modelId},</if>
            <if test="workCalender != null">work_calender = #{workCalender},</if>
            <if test="major != null">major = #{major},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteApsStandardProcessById" parameterType="Long">
        delete from aps_standard_process where id = #{id}
    </delete>
 
    <delete id="deleteApsStandardProcessByIds" parameterType="String">
        delete from aps_standard_process where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>