春风项目四线(合箱线、总装线)
yyt
2024-02-17 386e107222d673a1ea2781a03a7b1b1d28212f58
提交 | 用户 | 时间
64a177 1 <?xml version="1.0" encoding="UTF-8" ?>
J 2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.main.bs.modelNumber.mapper.BsModelNumberMapper">
6     
7     <resultMap type="BsModelNumber" id="BsModelNumberResult">
8         <result property="id"    column="id"    />
9         <result property="model"    column="model"    />
10         <result property="modelDate"    column="model_date"    />
11         <result property="maxnumValue"    column="maxnum_value"    />
12         <result property="saveTime"    column="save_time"    />
13         <result property="lastNumber"    column="last_number"    />
14         <result property="status"    column="status"    />
15         <result property="spareField1"    column="spare_field_1"    />
16         <result property="spareField2"    column="spare_field_2"    />
17         <result property="spareField3"    column="spare_field_3"    />
18         <result property="spareField4"    column="spare_field_4"    />
19         <result property="createUser"    column="create_user"    />
20         <result property="createTime"    column="create_time"    />
21         <result property="updateUser"    column="update_user"    />
22         <result property="updateTime"    column="update_time"    />
23         <result property="remarks"    column="remarks"    />
24     </resultMap>
25
26     <sql id="selectBsModelNumberVo">
27         select id, model, model_date, maxnum_value, save_time, last_number, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from bs_model_number
28     </sql>
29
30     <select id="selectBsModelNumberList" parameterType="BsModelNumber" resultMap="BsModelNumberResult">
31         <include refid="selectBsModelNumberVo"/>
32         <where>  
33             <if test="model != null  and model != ''"> and model = #{model}</if>
34             <if test="modelDate != null  and modelDate != ''"> and model_date = #{modelDate}</if>
35             <if test="maxnumValue != null  and maxnumValue != ''"> and maxnum_value = #{maxnumValue}</if>
36             <if test="saveTime != null  and saveTime != ''"> and save_time = #{saveTime}</if>
37             <if test="lastNumber != null  and lastNumber != ''"> and last_number = #{lastNumber}</if>
38             <if test="status != null  and status != ''"> and status = #{status}</if>
39             <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
40             <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
41             <if test="spareField3 != null  and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
42             <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
43             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
44             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
45             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
46         </where>
04cd5a 47         ORDER BY save_time DESC
64a177 48     </select>
J 49     
50     <select id="selectBsModelNumberById" parameterType="Long" resultMap="BsModelNumberResult">
51         <include refid="selectBsModelNumberVo"/>
52         where id = #{id}
53     </select>
54         
55     <insert id="insertBsModelNumber" parameterType="BsModelNumber" useGeneratedKeys="true" keyProperty="id">
56         insert into bs_model_number
57         <trim prefix="(" suffix=")" suffixOverrides=",">
58             <if test="model != null">model,</if>
59             <if test="modelDate != null">model_date,</if>
60             <if test="maxnumValue != null">maxnum_value,</if>
61             <if test="saveTime != null">save_time,</if>
62             <if test="lastNumber != null">last_number,</if>
63             <if test="status != null">status,</if>
64             <if test="spareField1 != null">spare_field_1,</if>
65             <if test="spareField2 != null">spare_field_2,</if>
66             <if test="spareField3 != null">spare_field_3,</if>
67             <if test="spareField4 != null">spare_field_4,</if>
68             <if test="createUser != null">create_user,</if>
69             <if test="createTime != null">create_time,</if>
70             <if test="updateUser != null">update_user,</if>
71             <if test="updateTime != null">update_time,</if>
72             <if test="remarks != null">remarks,</if>
73          </trim>
74         <trim prefix="values (" suffix=")" suffixOverrides=",">
75             <if test="model != null">#{model},</if>
76             <if test="modelDate != null">#{modelDate},</if>
77             <if test="maxnumValue != null">#{maxnumValue},</if>
78             <if test="saveTime != null">#{saveTime},</if>
79             <if test="lastNumber != null">#{lastNumber},</if>
80             <if test="status != null">#{status},</if>
81             <if test="spareField1 != null">#{spareField1},</if>
82             <if test="spareField2 != null">#{spareField2},</if>
83             <if test="spareField3 != null">#{spareField3},</if>
84             <if test="spareField4 != null">#{spareField4},</if>
85             <if test="createUser != null">#{createUser},</if>
86             <if test="createTime != null">#{createTime},</if>
87             <if test="updateUser != null">#{updateUser},</if>
88             <if test="updateTime != null">#{updateTime},</if>
89             <if test="remarks != null">#{remarks},</if>
90          </trim>
91     </insert>
92
93     <update id="updateBsModelNumber" parameterType="BsModelNumber">
94         update bs_model_number
95         <trim prefix="SET" suffixOverrides=",">
96             <if test="model != null">model = #{model},</if>
97             <if test="modelDate != null">model_date = #{modelDate},</if>
98             <if test="maxnumValue != null">maxnum_value = #{maxnumValue},</if>
99             <if test="saveTime != null">save_time = #{saveTime},</if>
100             <if test="lastNumber != null">last_number = #{lastNumber},</if>
101             <if test="status != null">status = #{status},</if>
102             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
103             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
104             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
105             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
106             <if test="createUser != null">create_user = #{createUser},</if>
107             <if test="createTime != null">create_time = #{createTime},</if>
108             <if test="updateUser != null">update_user = #{updateUser},</if>
109             <if test="updateTime != null">update_time = #{updateTime},</if>
110             <if test="remarks != null">remarks = #{remarks},</if>
111         </trim>
112         where id = #{id}
113     </update>
114
115     <delete id="deleteBsModelNumberById" parameterType="Long">
116         delete from bs_model_number where id = #{id}
117     </delete>
118
119     <delete id="deleteBsModelNumberByIds" parameterType="String">
120         delete from bs_model_number where id in 
121         <foreach item="id" collection="array" open="(" separator="," close=")">
122             #{id}
123         </foreach>
124     </delete>
125 </mapper>