hdy
7 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
f47bd7 1 <?xml version="1.0" encoding="UTF-8" ?>
H 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.billion.main.bs.mapper.BsBomInfoMapper">
6     
7     <resultMap type="BsBomInfo" id="BsBomInfoResult">
8         <result property="id"    column="id"    />
9         <result property="bomCode"    column="bom_code"    />
10         <result property="bomName"    column="bom_name"    />
11         <result property="productCode"    column="product_code"    />
12         <result property="productName"    column="product_name"    />
13         <result property="version"    column="version"    />
14         <result property="status"    column="status"    />
15         <result property="remark"    column="remark"    />
3d0e64 16         <result property="createBy"    column="create_by"    />
f47bd7 17         <result property="createTime"    column="create_time"    />
3d0e64 18         <result property="updateBy"    column="update_by"    />
f47bd7 19         <result property="updateTime"    column="update_time"    />
H 20         <result property="dataSource"    column="data_source"    />
21         <result property="delFlag"    column="del_flag"    />
22     </resultMap>
23
24     <sql id="selectBsBomInfoVo">
3d0e64 25         select id, bom_code, bom_name, product_code, product_name, version, status, remark, create_by, create_time, update_by, update_time, data_source, del_flag from bs_bom_info
f47bd7 26     </sql>
H 27
28     <select id="selectBsBomInfoList" parameterType="BsBomInfo" resultMap="BsBomInfoResult">
29         <include refid="selectBsBomInfoVo"/>
30         <where>  
31             <if test="bomCode != null  and bomCode != ''"> and bom_code = #{bomCode}</if>
32             <if test="bomName != null  and bomName != ''"> and bom_name like concat('%', #{bomName}, '%')</if>
33             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
34             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
35             <if test="version != null  and version != ''"> and version = #{version}</if>
36             <if test="status != null  and status != ''"> and status = #{status}</if>
3d0e64 37             <if test="createBy != null  and createBy != ''"> and create_by = #{createBy}</if>
H 38             <if test="updateBy != null  and updateBy != ''"> and update_by = #{updateBy}</if>
f47bd7 39             <if test="dataSource != null  and dataSource != ''"> and data_source = #{dataSource}</if>
H 40         </where>
41     </select>
42     
43     <select id="selectBsBomInfoById" parameterType="Long" resultMap="BsBomInfoResult">
44         <include refid="selectBsBomInfoVo"/>
45         where id = #{id}
46     </select>
47
48     <insert id="insertBsBomInfo" parameterType="BsBomInfo">
49         insert into bs_bom_info
50         <trim prefix="(" suffix=")" suffixOverrides=",">
51             <if test="id != null">id,</if>
52             <if test="bomCode != null">bom_code,</if>
53             <if test="bomName != null">bom_name,</if>
54             <if test="productCode != null">product_code,</if>
55             <if test="productName != null">product_name,</if>
56             <if test="version != null">version,</if>
57             <if test="status != null">status,</if>
58             <if test="remark != null">remark,</if>
3d0e64 59             <if test="createBy != null">create_by,</if>
f47bd7 60             <if test="createTime != null">create_time,</if>
3d0e64 61             <if test="updateBy != null">update_by,</if>
f47bd7 62             <if test="updateTime != null">update_time,</if>
H 63             <if test="dataSource != null">data_source,</if>
64             <if test="delFlag != null">del_flag,</if>
65          </trim>
66         <trim prefix="values (" suffix=")" suffixOverrides=",">
67             <if test="id != null">#{id},</if>
68             <if test="bomCode != null">#{bomCode},</if>
69             <if test="bomName != null">#{bomName},</if>
70             <if test="productCode != null">#{productCode},</if>
71             <if test="productName != null">#{productName},</if>
72             <if test="version != null">#{version},</if>
73             <if test="status != null">#{status},</if>
74             <if test="remark != null">#{remark},</if>
3d0e64 75             <if test="createBy != null">#{createBy},</if>
f47bd7 76             <if test="createTime != null">#{createTime},</if>
3d0e64 77             <if test="updateBy != null">#{updateBy},</if>
f47bd7 78             <if test="updateTime != null">#{updateTime},</if>
H 79             <if test="dataSource != null">#{dataSource},</if>
80             <if test="delFlag != null">#{delFlag},</if>
81          </trim>
82     </insert>
83
84     <update id="updateBsBomInfo" parameterType="BsBomInfo">
85         update bs_bom_info
86         <trim prefix="SET" suffixOverrides=",">
87             <if test="bomCode != null">bom_code = #{bomCode},</if>
88             <if test="bomName != null">bom_name = #{bomName},</if>
89             <if test="productCode != null">product_code = #{productCode},</if>
90             <if test="productName != null">product_name = #{productName},</if>
91             <if test="version != null">version = #{version},</if>
92             <if test="status != null">status = #{status},</if>
93             <if test="remark != null">remark = #{remark},</if>
3d0e64 94             <if test="createBy != null">create_by = #{createBy},</if>
f47bd7 95             <if test="createTime != null">create_time = #{createTime},</if>
3d0e64 96             <if test="updateBy != null">update_by = #{updateBy},</if>
f47bd7 97             <if test="updateTime != null">update_time = #{updateTime},</if>
H 98             <if test="dataSource != null">data_source = #{dataSource},</if>
99             <if test="delFlag != null">del_flag = #{delFlag},</if>
100         </trim>
101         where id = #{id}
102     </update>
103
104     <delete id="deleteBsBomInfoById" parameterType="Long">
105         delete from bs_bom_info where id = #{id}
106     </delete>
107
108     <delete id="deleteBsBomInfoByIds" parameterType="String">
109         delete from bs_bom_info where id in 
110         <foreach item="id" collection="array" open="(" separator="," close=")">
111             #{id}
112         </foreach>
113     </delete>
114 </mapper>