提交 | 用户 | 时间
|
dea0a3
|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
A |
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.BsMaterialInfoMapper"> |
|
6 |
|
|
7 |
<resultMap type="BsMaterialInfo" id="BsMaterialInfoResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="materialCode" column="material_code" /> |
|
10 |
<result property="materialName" column="material_name" /> |
|
11 |
<result property="materialView" column="material_view" /> |
|
12 |
<result property="typeZ" column="type_z" /> |
|
13 |
<result property="typeL" column="type_l" /> |
|
14 |
<result property="unit" column="unit" /> |
|
15 |
<result property="version" column="version" /> |
|
16 |
<result property="status" column="status" /> |
|
17 |
<result property="supplier" column="supplier" /> |
|
18 |
<result property="remark" column="remark" /> |
|
19 |
<result property="dataSource" column="data_source" /> |
|
20 |
<result property="createBy" column="create_by" /> |
|
21 |
<result property="createTime" column="create_time" /> |
|
22 |
<result property="updateBy" column="update_by" /> |
|
23 |
<result property="updateTime" column="update_time" /> |
|
24 |
<result property="delFlag" column="del_flag" /> |
|
25 |
</resultMap> |
|
26 |
|
|
27 |
<sql id="selectBsMaterialInfoVo"> |
|
28 |
select id, material_code, material_name, material_view, type_z, type_l, unit, version, status, supplier, remark, data_source, create_by, create_time, update_by, update_time, del_flag from bs_material_info |
|
29 |
</sql> |
|
30 |
|
|
31 |
<select id="selectBsMaterialInfoList" parameterType="BsMaterialInfo" resultMap="BsMaterialInfoResult"> |
|
32 |
<include refid="selectBsMaterialInfoVo"/> |
|
33 |
<where> |
|
34 |
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if> |
|
35 |
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
|
36 |
<if test="materialView != null and materialView != ''"> and material_view = #{materialView}</if> |
|
37 |
<if test="typeZ != null and typeZ != ''"> and type_z = #{typeZ}</if> |
|
38 |
<if test="typeL != null and typeL != ''"> and type_l = #{typeL}</if> |
|
39 |
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
|
40 |
<if test="status != null and status != ''"> and status = #{status}</if> |
|
41 |
</where> |
|
42 |
</select> |
|
43 |
|
|
44 |
<select id="selectBsMaterialInfoById" parameterType="Long" resultMap="BsMaterialInfoResult"> |
|
45 |
<include refid="selectBsMaterialInfoVo"/> |
|
46 |
where id = #{id} |
|
47 |
</select> |
|
48 |
|
|
49 |
<insert id="insertBsMaterialInfo" parameterType="BsMaterialInfo"> |
|
50 |
insert into bs_material_info |
|
51 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
52 |
<if test="id != null">id,</if> |
|
53 |
<if test="materialCode != null and materialCode != ''">material_code,</if> |
|
54 |
<if test="materialName != null and materialName != ''">material_name,</if> |
|
55 |
<if test="materialView != null">material_view,</if> |
|
56 |
<if test="typeZ != null">type_z,</if> |
|
57 |
<if test="typeL != null">type_l,</if> |
|
58 |
<if test="unit != null">unit,</if> |
|
59 |
<if test="version != null">version,</if> |
|
60 |
<if test="status != null">status,</if> |
|
61 |
<if test="supplier != null">supplier,</if> |
|
62 |
<if test="remark != null">remark,</if> |
|
63 |
<if test="dataSource != null">data_source,</if> |
|
64 |
<if test="createBy != null">create_by,</if> |
|
65 |
<if test="createTime != null">create_time,</if> |
|
66 |
<if test="updateBy != null">update_by,</if> |
|
67 |
<if test="updateTime != null">update_time,</if> |
|
68 |
<if test="delFlag != null">del_flag,</if> |
|
69 |
</trim> |
|
70 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
71 |
<if test="id != null">#{id},</if> |
|
72 |
<if test="materialCode != null and materialCode != ''">#{materialCode},</if> |
|
73 |
<if test="materialName != null and materialName != ''">#{materialName},</if> |
|
74 |
<if test="materialView != null">#{materialView},</if> |
|
75 |
<if test="typeZ != null">#{typeZ},</if> |
|
76 |
<if test="typeL != null">#{typeL},</if> |
|
77 |
<if test="unit != null">#{unit},</if> |
|
78 |
<if test="version != null">#{version},</if> |
|
79 |
<if test="status != null">#{status},</if> |
|
80 |
<if test="supplier != null">#{supplier},</if> |
|
81 |
<if test="remark != null">#{remark},</if> |
|
82 |
<if test="dataSource != null">#{dataSource},</if> |
|
83 |
<if test="createBy != null">#{createBy},</if> |
|
84 |
<if test="createTime != null">#{createTime},</if> |
|
85 |
<if test="updateBy != null">#{updateBy},</if> |
|
86 |
<if test="updateTime != null">#{updateTime},</if> |
|
87 |
<if test="delFlag != null">#{delFlag},</if> |
|
88 |
</trim> |
|
89 |
</insert> |
|
90 |
|
|
91 |
<update id="updateBsMaterialInfo" parameterType="BsMaterialInfo"> |
|
92 |
update bs_material_info |
|
93 |
<trim prefix="SET" suffixOverrides=","> |
|
94 |
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if> |
|
95 |
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if> |
|
96 |
<if test="materialView != null">material_view = #{materialView},</if> |
|
97 |
<if test="typeZ != null">type_z = #{typeZ},</if> |
|
98 |
<if test="typeL != null">type_l = #{typeL},</if> |
|
99 |
<if test="unit != null">unit = #{unit},</if> |
|
100 |
<if test="version != null">version = #{version},</if> |
|
101 |
<if test="status != null">status = #{status},</if> |
|
102 |
<if test="supplier != null">supplier = #{supplier},</if> |
|
103 |
<if test="remark != null">remark = #{remark},</if> |
|
104 |
<if test="dataSource != null">data_source = #{dataSource},</if> |
|
105 |
<if test="createBy != null">create_by = #{createBy},</if> |
|
106 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
107 |
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
108 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
109 |
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|
110 |
</trim> |
|
111 |
where id = #{id} |
|
112 |
</update> |
|
113 |
|
|
114 |
<delete id="deleteBsMaterialInfoById" parameterType="Long"> |
|
115 |
delete from bs_material_info where id = #{id} |
|
116 |
</delete> |
|
117 |
|
|
118 |
<delete id="deleteBsMaterialInfoByIds" parameterType="String"> |
|
119 |
delete from bs_material_info where id in |
|
120 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
121 |
#{id} |
|
122 |
</foreach> |
|
123 |
</delete> |
|
124 |
</mapper> |