提交 | 用户 | 时间
|
0cceb6
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
Y |
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.productBom.mapper.BsProductBomInfoMapper"> |
|
6 |
|
|
7 |
<resultMap type="BsProductBomInfo" id="BsProductBomInfoResult"> |
|
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="spareField1" column="spare_field_1" /> |
|
16 |
<result property="spareField2" column="spare_field_2" /> |
|
17 |
<result property="remark" column="remark" /> |
|
18 |
<result property="createUser" column="create_user" /> |
|
19 |
<result property="createTime" column="create_time" /> |
|
20 |
<result property="updateUser" column="update_user" /> |
|
21 |
<result property="updateTime" column="update_time" /> |
|
22 |
<result property="dataSource" column="data_source" /> |
|
23 |
</resultMap> |
|
24 |
|
|
25 |
<sql id="selectBsProductBomInfoVo"> |
|
26 |
select id, bom_code, bom_name, product_code, product_name, version, status, spare_field_1, spare_field_2, remark, create_user, create_time, update_user, update_time, data_source from bs_product_bom_info |
|
27 |
</sql> |
|
28 |
|
|
29 |
<select id="selectBsProductBomInfoList" parameterType="BsProductBomInfo" resultMap="BsProductBomInfoResult"> |
|
30 |
<include refid="selectBsProductBomInfoVo"/> |
|
31 |
<where> |
|
32 |
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if> |
|
33 |
<if test="bomName != null and bomName != ''"> and bom_name like concat('%', #{bomName}, '%')</if> |
|
34 |
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if> |
|
35 |
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> |
|
36 |
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if> |
|
37 |
</where> |
|
38 |
</select> |
|
39 |
|
|
40 |
<select id="selectBsProductBomInfoById" parameterType="Long" resultMap="BsProductBomInfoResult"> |
|
41 |
<include refid="selectBsProductBomInfoVo"/> |
|
42 |
where id = #{id} |
|
43 |
</select> |
|
44 |
|
|
45 |
<insert id="insertBsProductBomInfo" parameterType="BsProductBomInfo"> |
|
46 |
insert into bs_product_bom_info |
|
47 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
48 |
<if test="id != null">id,</if> |
|
49 |
<if test="bomCode != null and bomCode != ''">bom_code,</if> |
|
50 |
<if test="bomName != null">bom_name,</if> |
|
51 |
<if test="productCode != null and productCode != ''">product_code,</if> |
|
52 |
<if test="productName != null">product_name,</if> |
|
53 |
<if test="version != null">version,</if> |
|
54 |
<if test="status != null and status != ''">status,</if> |
|
55 |
<if test="spareField1 != null">spare_field_1,</if> |
|
56 |
<if test="spareField2 != null">spare_field_2,</if> |
|
57 |
<if test="remark != null">remark,</if> |
|
58 |
<if test="createUser != null">create_user,</if> |
|
59 |
<if test="createTime != null">create_time,</if> |
|
60 |
<if test="updateUser != null">update_user,</if> |
|
61 |
<if test="updateTime != null">update_time,</if> |
|
62 |
<if test="dataSource != null">data_source,</if> |
|
63 |
</trim> |
|
64 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
65 |
<if test="id != null">#{id},</if> |
|
66 |
<if test="bomCode != null and bomCode != ''">#{bomCode},</if> |
|
67 |
<if test="bomName != null">#{bomName},</if> |
|
68 |
<if test="productCode != null and productCode != ''">#{productCode},</if> |
|
69 |
<if test="productName != null">#{productName},</if> |
|
70 |
<if test="version != null">#{version},</if> |
|
71 |
<if test="status != null and status != ''">#{status},</if> |
|
72 |
<if test="spareField1 != null">#{spareField1},</if> |
|
73 |
<if test="spareField2 != null">#{spareField2},</if> |
|
74 |
<if test="remark != null">#{remark},</if> |
|
75 |
<if test="createUser != null">#{createUser},</if> |
|
76 |
<if test="createTime != null">#{createTime},</if> |
|
77 |
<if test="updateUser != null">#{updateUser},</if> |
|
78 |
<if test="updateTime != null">#{updateTime},</if> |
|
79 |
<if test="dataSource != null">#{dataSource},</if> |
|
80 |
</trim> |
|
81 |
</insert> |
|
82 |
|
|
83 |
<update id="updateBsProductBomInfo" parameterType="BsProductBomInfo"> |
|
84 |
update bs_product_bom_info |
|
85 |
<trim prefix="SET" suffixOverrides=","> |
|
86 |
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if> |
|
87 |
<if test="bomName != null">bom_name = #{bomName},</if> |
|
88 |
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if> |
|
89 |
<if test="productName != null">product_name = #{productName},</if> |
|
90 |
<if test="version != null">version = #{version},</if> |
|
91 |
<if test="status != null and status != ''">status = #{status},</if> |
|
92 |
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
|
93 |
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
|
94 |
<if test="remark != null">remark = #{remark},</if> |
|
95 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
96 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
97 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
98 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
99 |
<if test="dataSource != null">data_source = #{dataSource},</if> |
|
100 |
</trim> |
|
101 |
where id = #{id} |
|
102 |
</update> |
|
103 |
|
|
104 |
<delete id="deleteBsProductBomInfoById" parameterType="Long"> |
|
105 |
delete from bs_product_bom_info where id = #{id} |
|
106 |
</delete> |
|
107 |
|
|
108 |
<delete id="deleteBsProductBomInfoByIds" parameterType="String"> |
|
109 |
delete from bs_product_bom_info where id in |
|
110 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
111 |
#{id} |
|
112 |
</foreach> |
|
113 |
</delete> |
|
114 |
</mapper> |