提交 | 用户 | 时间
|
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" /> |
fd2207
|
26 |
</resultMap> |
懒 |
27 |
|
|
28 |
<sql id="selectBsMaterialInfoVo"> |
2e964f
|
29 |
select id, material_code, mark, material_name, 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
|
30 |
</sql> |
懒 |
31 |
|
|
32 |
<select id="selectBsMaterialInfoList" parameterType="BsMaterialInfo" resultMap="BsMaterialInfoResult"> |
|
33 |
<include refid="selectBsMaterialInfoVo"/> |
|
34 |
<where> |
|
35 |
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if> |
|
36 |
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
2e964f
|
37 |
<if test="mark != null and mark != ''"> and mark like concat('%', #{mark}, '%')</if> |
fd2207
|
38 |
<if test="materialView != null and materialView != ''"> and material_view = #{materialView}</if> |
懒 |
39 |
<if test="typeZ != null and typeZ != ''"> and type_z = #{typeZ}</if> |
|
40 |
<if test="typeL != null and typeL != ''"> and type_l = #{typeL}</if> |
|
41 |
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
|
42 |
<if test="matterVersion != null and matterVersion != ''"> and matter_version = #{matterVersion}</if> |
|
43 |
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> |
|
44 |
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
|
45 |
<if test="createTime != null "> and create_time = #{createTime}</if> |
|
46 |
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
|
47 |
<if test="erpSpec != null and erpSpec != ''"> and erp_spec = #{erpSpec}</if> |
|
48 |
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if> |
|
49 |
<if test="version != null and version != ''"> and version = #{version}</if> |
|
50 |
<if test="status != null and status != ''"> and status = #{status}</if> |
|
51 |
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if> |
|
52 |
</where> |
|
53 |
</select> |
|
54 |
|
|
55 |
<select id="selectBsMaterialInfoById" parameterType="Long" resultMap="BsMaterialInfoResult"> |
|
56 |
<include refid="selectBsMaterialInfoVo"/> |
|
57 |
where id = #{id} |
|
58 |
</select> |
|
59 |
|
|
60 |
<insert id="insertBsMaterialInfo" parameterType="BsMaterialInfo"> |
|
61 |
insert into bs_material_info |
|
62 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
63 |
<if test="id != null">id,</if> |
|
64 |
<if test="materialCode != null">material_code,</if> |
|
65 |
<if test="materialName != null">material_name,</if> |
2e964f
|
66 |
<if test="mark != null">mark,</if> |
fd2207
|
67 |
<if test="materialView != null">material_view,</if> |
懒 |
68 |
<if test="typeZ != null">type_z,</if> |
|
69 |
<if test="typeL != null">type_l,</if> |
|
70 |
<if test="unit != null">unit,</if> |
|
71 |
<if test="matterVersion != null">matter_version,</if> |
|
72 |
<if test="remarks != null">remarks,</if> |
|
73 |
<if test="createUser != null">create_user,</if> |
|
74 |
<if test="createTime != null">create_time,</if> |
|
75 |
<if test="updateUser != null">update_user,</if> |
|
76 |
<if test="updateTime != null">update_time,</if> |
|
77 |
<if test="erpSpec != null">erp_spec,</if> |
|
78 |
<if test="dataSource != null">data_source,</if> |
|
79 |
<if test="version != null">version,</if> |
|
80 |
<if test="status != null">status,</if> |
|
81 |
<if test="supplier != null">supplier,</if> |
|
82 |
</trim> |
|
83 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
84 |
<if test="id != null">#{id},</if> |
|
85 |
<if test="materialCode != null">#{materialCode},</if> |
|
86 |
<if test="materialName != null">#{materialName},</if> |
2e964f
|
87 |
<if test="mark != null">#{mark},</if> |
fd2207
|
88 |
<if test="materialView != null">#{materialView},</if> |
懒 |
89 |
<if test="typeZ != null">#{typeZ},</if> |
|
90 |
<if test="typeL != null">#{typeL},</if> |
|
91 |
<if test="unit != null">#{unit},</if> |
|
92 |
<if test="matterVersion != null">#{matterVersion},</if> |
|
93 |
<if test="remarks != null">#{remarks},</if> |
|
94 |
<if test="createUser != null">#{createUser},</if> |
|
95 |
<if test="createTime != null">#{createTime},</if> |
|
96 |
<if test="updateUser != null">#{updateUser},</if> |
|
97 |
<if test="updateTime != null">#{updateTime},</if> |
|
98 |
<if test="erpSpec != null">#{erpSpec},</if> |
|
99 |
<if test="dataSource != null">#{dataSource},</if> |
|
100 |
<if test="version != null">#{version},</if> |
|
101 |
<if test="status != null">#{status},</if> |
|
102 |
<if test="supplier != null">#{supplier},</if> |
|
103 |
</trim> |
|
104 |
</insert> |
|
105 |
|
|
106 |
<update id="updateBsMaterialInfo" parameterType="BsMaterialInfo"> |
|
107 |
update bs_material_info |
|
108 |
<trim prefix="SET" suffixOverrides=","> |
|
109 |
<if test="materialCode != null">material_code = #{materialCode},</if> |
|
110 |
<if test="materialName != null">material_name = #{materialName},</if> |
2e964f
|
111 |
<if test="mark != null">mark = #{mark},</if> |
fd2207
|
112 |
<if test="materialView != null">material_view = #{materialView},</if> |
懒 |
113 |
<if test="typeZ != null">type_z = #{typeZ},</if> |
|
114 |
<if test="typeL != null">type_l = #{typeL},</if> |
|
115 |
<if test="unit != null">unit = #{unit},</if> |
|
116 |
<if test="matterVersion != null">matter_version = #{matterVersion},</if> |
|
117 |
<if test="remarks != null">remarks = #{remarks},</if> |
|
118 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
119 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
120 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
121 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
122 |
<if test="erpSpec != null">erp_spec = #{erpSpec},</if> |
|
123 |
<if test="dataSource != null">data_source = #{dataSource},</if> |
|
124 |
<if test="version != null">version = #{version},</if> |
|
125 |
<if test="status != null">status = #{status},</if> |
|
126 |
<if test="supplier != null">supplier = #{supplier},</if> |
|
127 |
</trim> |
|
128 |
where id = #{id} |
|
129 |
</update> |
|
130 |
|
|
131 |
<delete id="deleteBsMaterialInfoById" parameterType="Long"> |
|
132 |
delete from bs_material_info where id = #{id} |
|
133 |
</delete> |
|
134 |
|
|
135 |
<delete id="deleteBsMaterialInfoByIds" parameterType="String"> |
|
136 |
delete from bs_material_info where id in |
|
137 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
138 |
#{id} |
|
139 |
</foreach> |
|
140 |
</delete> |
|
141 |
</mapper> |