春风项目四线(合箱线、总装线)
hdy
2024-01-18 2cc5a1afe8296d148f0a32989395d538e5323a8e
提交 | 用户 | 时间
fd2207 1 <?xml version="1.0" encoding="UTF-8" ?>
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.material.mapper.BsMaterialInfoMapper">
6     <resultMap type="BsMaterialInfo" id="BsMaterialInfoResult">
7         <result property="id"    column="id"    />
8         <result property="materialCode"    column="material_code"    />
9         <result property="materialName"    column="material_name"    />
10         <result property="materialView"    column="material_view"    />
11         <result property="typeZ"    column="type_z"    />
12         <result property="typeL"    column="type_l"    />
13         <result property="unit"    column="unit"    />
14         <result property="matterVersion"    column="matter_version"    />
15         <result property="remarks"    column="remarks"    />
16         <result property="createUser"    column="create_user"    />
17         <result property="createTime"    column="create_time"    />
18         <result property="updateUser"    column="update_user"    />
19         <result property="updateTime"    column="update_time"    />
20         <result property="erpSpec"    column="erp_spec"    />
21         <result property="dataSource"    column="data_source"    />
22         <result property="version"    column="version"    />
23         <result property="status"    column="status"    />
24         <result property="supplier"    column="supplier"    />
2e964f 25         <result property="mark"    column="mark"    />
b26334 26         <result property="carType"    column="car_type"    />
H 27
fd2207 28     </resultMap>
29
30     <sql id="selectBsMaterialInfoVo">
b26334 31         select id, material_code, mark, material_name,car_type, material_view, type_z, type_l, unit, matter_version, remarks, create_user, create_time, update_user, update_time, erp_spec, data_source, version, status, supplier from bs_material_info
fd2207 32     </sql>
33
34     <select id="selectBsMaterialInfoList" parameterType="BsMaterialInfo" resultMap="BsMaterialInfoResult">
35         <include refid="selectBsMaterialInfoVo"/>
36         <where>  
37             <if test="materialCode != null  and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
38             <if test="materialName != null  and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
2e964f 39             <if test="mark != null  and mark != ''"> and mark like concat('%', #{mark}, '%')</if>
fd2207 40             <if test="materialView != null  and materialView != ''"> and material_view = #{materialView}</if>
41             <if test="typeZ != null  and typeZ != ''"> and type_z = #{typeZ}</if>
42             <if test="typeL != null  and typeL != ''"> and type_l = #{typeL}</if>
43             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
44             <if test="matterVersion != null  and matterVersion != ''"> and matter_version = #{matterVersion}</if>
45             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
b26334 46             <if test="carType != null  and carType != ''"> and car_type = #{carType}</if>
fd2207 47             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
48             <if test="createTime != null "> and create_time = #{createTime}</if>
49             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
50             <if test="erpSpec != null  and erpSpec != ''"> and erp_spec = #{erpSpec}</if>
51             <if test="dataSource != null  and dataSource != ''"> and data_source = #{dataSource}</if>
52             <if test="version != null  and version != ''"> and version = #{version}</if>
53             <if test="status != null  and status != ''"> and status = #{status}</if>
54             <if test="supplier != null  and supplier != ''"> and supplier = #{supplier}</if>
55         </where>
56     </select>
57     
58     <select id="selectBsMaterialInfoById" parameterType="Long" resultMap="BsMaterialInfoResult">
59         <include refid="selectBsMaterialInfoVo"/>
60         where id = #{id}
61     </select>
62         
63     <insert id="insertBsMaterialInfo" parameterType="BsMaterialInfo">
64         insert into bs_material_info
65         <trim prefix="(" suffix=")" suffixOverrides=",">
66             <if test="id != null">id,</if>
67             <if test="materialCode != null">material_code,</if>
68             <if test="materialName != null">material_name,</if>
b26334 69             <if test="carType != null">car_type,</if>
2e964f 70             <if test="mark != null">mark,</if>
fd2207 71             <if test="materialView != null">material_view,</if>
72             <if test="typeZ != null">type_z,</if>
73             <if test="typeL != null">type_l,</if>
74             <if test="unit != null">unit,</if>
75             <if test="matterVersion != null">matter_version,</if>
76             <if test="remarks != null">remarks,</if>
77             <if test="createUser != null">create_user,</if>
78             <if test="createTime != null">create_time,</if>
79             <if test="updateUser != null">update_user,</if>
80             <if test="updateTime != null">update_time,</if>
81             <if test="erpSpec != null">erp_spec,</if>
82             <if test="dataSource != null">data_source,</if>
83             <if test="version != null">version,</if>
84             <if test="status != null">status,</if>
85             <if test="supplier != null">supplier,</if>
86          </trim>
87         <trim prefix="values (" suffix=")" suffixOverrides=",">
88             <if test="id != null">#{id},</if>
89             <if test="materialCode != null">#{materialCode},</if>
90             <if test="materialName != null">#{materialName},</if>
b26334 91             <if test="carType != null">#{carType},</if>
2e964f 92             <if test="mark != null">#{mark},</if>
fd2207 93             <if test="materialView != null">#{materialView},</if>
94             <if test="typeZ != null">#{typeZ},</if>
95             <if test="typeL != null">#{typeL},</if>
96             <if test="unit != null">#{unit},</if>
97             <if test="matterVersion != null">#{matterVersion},</if>
98             <if test="remarks != null">#{remarks},</if>
99             <if test="createUser != null">#{createUser},</if>
100             <if test="createTime != null">#{createTime},</if>
101             <if test="updateUser != null">#{updateUser},</if>
102             <if test="updateTime != null">#{updateTime},</if>
103             <if test="erpSpec != null">#{erpSpec},</if>
104             <if test="dataSource != null">#{dataSource},</if>
105             <if test="version != null">#{version},</if>
106             <if test="status != null">#{status},</if>
107             <if test="supplier != null">#{supplier},</if>
108          </trim>
109     </insert>
110
111     <update id="updateBsMaterialInfo" parameterType="BsMaterialInfo">
112         update bs_material_info
113         <trim prefix="SET" suffixOverrides=",">
114             <if test="materialCode != null">material_code = #{materialCode},</if>
115             <if test="materialName != null">material_name = #{materialName},</if>
b26334 116             <if test="carType != null">car_type = #{carType},</if>
2e964f 117             <if test="mark != null">mark = #{mark},</if>
fd2207 118             <if test="materialView != null">material_view = #{materialView},</if>
119             <if test="typeZ != null">type_z = #{typeZ},</if>
120             <if test="typeL != null">type_l = #{typeL},</if>
121             <if test="unit != null">unit = #{unit},</if>
122             <if test="matterVersion != null">matter_version = #{matterVersion},</if>
123             <if test="remarks != null">remarks = #{remarks},</if>
124             <if test="createUser != null">create_user = #{createUser},</if>
125             <if test="createTime != null">create_time = #{createTime},</if>
126             <if test="updateUser != null">update_user = #{updateUser},</if>
127             <if test="updateTime != null">update_time = #{updateTime},</if>
128             <if test="erpSpec != null">erp_spec = #{erpSpec},</if>
129             <if test="dataSource != null">data_source = #{dataSource},</if>
130             <if test="version != null">version = #{version},</if>
131             <if test="status != null">status = #{status},</if>
132             <if test="supplier != null">supplier = #{supplier},</if>
133         </trim>
134         where id = #{id}
135     </update>
136
137     <delete id="deleteBsMaterialInfoById" parameterType="Long">
138         delete from bs_material_info where id = #{id}
139     </delete>
140
141     <delete id="deleteBsMaterialInfoByIds" parameterType="String">
142         delete from bs_material_info where id in 
143         <foreach item="id" collection="array" open="(" separator="," close=")">
144             #{id}
145         </foreach>
146     </delete>
147 </mapper>