提交 | 用户 | 时间
|
f6789a
|
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.jcdm.main.sc.materialConf.mapper.ScMaterialConfMapper"> |
|
6 |
|
|
7 |
<resultMap type="ScMaterialConf" id="ScMaterialConfResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="materialCode" column="material_code" /> |
|
10 |
<result property="materialName" column="material_name" /> |
|
11 |
<result property="remark" column="remark" /> |
|
12 |
<result property="sparefield1" column="sparefield1" /> |
|
13 |
<result property="sparefield2" column="sparefield2" /> |
|
14 |
<result property="createUser" column="create_user" /> |
|
15 |
<result property="createTime" column="create_time" /> |
|
16 |
<result property="updateUser" column="update_user" /> |
|
17 |
<result property="updateTime" column="update_time" /> |
|
18 |
<result property="status" column="status" /> |
|
19 |
<result property="modelCode" column="model_code" /> |
|
20 |
</resultMap> |
|
21 |
|
|
22 |
<sql id="selectScMaterialConfVo"> |
|
23 |
select id, material_code, material_name, remark, sparefield1, sparefield2, create_user, create_time, update_user, update_time, status, model_code from sc_material_conf |
|
24 |
</sql> |
|
25 |
|
|
26 |
<select id="selectScMaterialConfList" parameterType="ScMaterialConf" resultMap="ScMaterialConfResult"> |
|
27 |
<include refid="selectScMaterialConfVo"/> |
|
28 |
<where> |
|
29 |
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if> |
|
30 |
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
|
31 |
<if test="sparefield1 != null and sparefield1 != ''"> and sparefield1 = #{sparefield1}</if> |
|
32 |
<if test="sparefield2 != null and sparefield2 != ''"> and sparefield2 = #{sparefield2}</if> |
|
33 |
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
|
34 |
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
|
35 |
<if test="status != null and status != ''"> and status = #{status}</if> |
|
36 |
<if test="modelCode != null and modelCode != ''"> and model_code = #{modelCode}</if> |
|
37 |
</where> |
|
38 |
</select> |
|
39 |
|
|
40 |
<select id="selectScMaterialConfById" parameterType="Long" resultMap="ScMaterialConfResult"> |
|
41 |
<include refid="selectScMaterialConfVo"/> |
|
42 |
where id = #{id} |
|
43 |
</select> |
|
44 |
|
|
45 |
<insert id="insertScMaterialConf" parameterType="ScMaterialConf" useGeneratedKeys="true" keyProperty="id"> |
|
46 |
insert into sc_material_conf |
|
47 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
48 |
<if test="materialCode != null">material_code,</if> |
|
49 |
<if test="materialName != null">material_name,</if> |
|
50 |
<if test="remark != null">remark,</if> |
|
51 |
<if test="sparefield1 != null">sparefield1,</if> |
|
52 |
<if test="sparefield2 != null">sparefield2,</if> |
|
53 |
<if test="createUser != null">create_user,</if> |
|
54 |
<if test="createTime != null">create_time,</if> |
|
55 |
<if test="updateUser != null">update_user,</if> |
|
56 |
<if test="updateTime != null">update_time,</if> |
|
57 |
<if test="status != null">status,</if> |
|
58 |
<if test="modelCode != null">model_code,</if> |
|
59 |
</trim> |
|
60 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
61 |
<if test="materialCode != null">#{materialCode},</if> |
|
62 |
<if test="materialName != null">#{materialName},</if> |
|
63 |
<if test="remark != null">#{remark},</if> |
|
64 |
<if test="sparefield1 != null">#{sparefield1},</if> |
|
65 |
<if test="sparefield2 != null">#{sparefield2},</if> |
|
66 |
<if test="createUser != null">#{createUser},</if> |
|
67 |
<if test="createTime != null">#{createTime},</if> |
|
68 |
<if test="updateUser != null">#{updateUser},</if> |
|
69 |
<if test="updateTime != null">#{updateTime},</if> |
|
70 |
<if test="status != null">#{status},</if> |
|
71 |
<if test="modelCode != null">#{modelCode},</if> |
|
72 |
</trim> |
|
73 |
</insert> |
|
74 |
|
|
75 |
<update id="updateScMaterialConf" parameterType="ScMaterialConf"> |
|
76 |
update sc_material_conf |
|
77 |
<trim prefix="SET" suffixOverrides=","> |
|
78 |
<if test="materialCode != null">material_code = #{materialCode},</if> |
|
79 |
<if test="materialName != null">material_name = #{materialName},</if> |
|
80 |
<if test="remark != null">remark = #{remark},</if> |
|
81 |
<if test="sparefield1 != null">sparefield1 = #{sparefield1},</if> |
|
82 |
<if test="sparefield2 != null">sparefield2 = #{sparefield2},</if> |
|
83 |
<if test="createUser != null">create_user = #{createUser},</if> |
|
84 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
85 |
<if test="updateUser != null">update_user = #{updateUser},</if> |
|
86 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
87 |
<if test="status != null">status = #{status},</if> |
|
88 |
<if test="modelCode != null">model_code = #{modelCode},</if> |
|
89 |
</trim> |
|
90 |
where id = #{id} |
|
91 |
</update> |
|
92 |
|
|
93 |
<delete id="deleteScMaterialConfById" parameterType="Long"> |
|
94 |
delete from sc_material_conf where id = #{id} |
|
95 |
</delete> |
|
96 |
|
|
97 |
<delete id="deleteScMaterialConfByIds" parameterType="String"> |
|
98 |
delete from sc_material_conf where id in |
|
99 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
100 |
#{id} |
|
101 |
</foreach> |
|
102 |
</delete> |
|
103 |
</mapper> |