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