懒羊羊
2024-01-31 e57a8990ae56f657a59c435a0613c5f7a8728003
提交 | 用户 | 时间
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.formula.mapper.BsFormulaInfoMapper">
6     
7     <resultMap type="BsFormulaInfo" id="BsFormulaInfoResult">
8         <result property="id"    column="id"    />
9         <result property="formulaCode"    column="formula_code"    />
10         <result property="formulaName"    column="formula_name"    />
11         <result property="status"    column="status"    />
12         <result property="productCode"    column="product_code"    />
13         <result property="remark"    column="remark"    />
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="spareField1"    column="spare_field_1"    />
19         <result property="spareField2"    column="spare_field_2"    />
20         <result property="spareField3"    column="spare_field_3"    />
21         <result property="spareField4"    column="spare_field_4"    />
22     </resultMap>
23
24     <sql id="selectBsFormulaInfoVo">
25         select id, formula_code, formula_name, status, product_code, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from bs_formula_info
26     </sql>
27
28     <select id="selectBsFormulaInfoList" parameterType="BsFormulaInfo" resultMap="BsFormulaInfoResult">
29         <include refid="selectBsFormulaInfoVo"/>
30         <where>  
31             <if test="formulaCode != null  and formulaCode != ''"> and formula_code like concat('%', #{formulaCode}, '%')</if>
32             <if test="formulaName != null  and formulaName != ''"> and formula_name like concat('%', #{formulaName}, '%')</if>
33             <if test="status != null  and status != ''"> and status = #{status}</if>
34             <if test="productCode != null  and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
35         </where>
36     </select>
37     
38     <select id="selectBsFormulaInfoById" parameterType="Long" resultMap="BsFormulaInfoResult">
39         <include refid="selectBsFormulaInfoVo"/>
40         where id = #{id}
41     </select>
42         
43     <insert id="insertBsFormulaInfo" parameterType="BsFormulaInfo">
44         insert into bs_formula_info
45         <trim prefix="(" suffix=")" suffixOverrides=",">
46             <if test="id != null">id,</if>
47             <if test="formulaCode != null and formulaCode != ''">formula_code,</if>
48             <if test="formulaName != null">formula_name,</if>
49             <if test="status != null and status != ''">status,</if>
50             <if test="productCode != null and productCode != ''">product_code,</if>
51             <if test="remark != null">remark,</if>
52             <if test="createUser != null">create_user,</if>
53             <if test="createTime != null">create_time,</if>
54             <if test="updateUser != null">update_user,</if>
55             <if test="updateTime != null">update_time,</if>
56             <if test="spareField1 != null">spare_field_1,</if>
57             <if test="spareField2 != null">spare_field_2,</if>
58             <if test="spareField3 != null">spare_field_3,</if>
59             <if test="spareField4 != null">spare_field_4,</if>
60          </trim>
61         <trim prefix="values (" suffix=")" suffixOverrides=",">
62             <if test="id != null">#{id},</if>
63             <if test="formulaCode != null and formulaCode != ''">#{formulaCode},</if>
64             <if test="formulaName != null">#{formulaName},</if>
65             <if test="status != null and status != ''">#{status},</if>
66             <if test="productCode != null and productCode != ''">#{productCode},</if>
67             <if test="remark != null">#{remark},</if>
68             <if test="createUser != null">#{createUser},</if>
69             <if test="createTime != null">#{createTime},</if>
70             <if test="updateUser != null">#{updateUser},</if>
71             <if test="updateTime != null">#{updateTime},</if>
72             <if test="spareField1 != null">#{spareField1},</if>
73             <if test="spareField2 != null">#{spareField2},</if>
74             <if test="spareField3 != null">#{spareField3},</if>
75             <if test="spareField4 != null">#{spareField4},</if>
76          </trim>
77     </insert>
78
79     <update id="updateBsFormulaInfo" parameterType="BsFormulaInfo">
80         update bs_formula_info
81         <trim prefix="SET" suffixOverrides=",">
82             <if test="formulaCode != null and formulaCode != ''">formula_code = #{formulaCode},</if>
83             <if test="formulaName != null">formula_name = #{formulaName},</if>
84             <if test="status != null and status != ''">status = #{status},</if>
85             <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
86             <if test="remark != null">remark = #{remark},</if>
87             <if test="createUser != null">create_user = #{createUser},</if>
88             <if test="createTime != null">create_time = #{createTime},</if>
89             <if test="updateUser != null">update_user = #{updateUser},</if>
90             <if test="updateTime != null">update_time = #{updateTime},</if>
91             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
92             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
93             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
94             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
95         </trim>
96         where id = #{id}
97     </update>
98
99     <delete id="deleteBsFormulaInfoById" parameterType="Long">
100         delete from bs_formula_info where id = #{id}
101     </delete>
102
103     <delete id="deleteBsFormulaInfoByIds" parameterType="String">
104         delete from bs_formula_info where id in 
105         <foreach item="id" collection="array" open="(" separator="," close=")">
106             #{id}
107         </foreach>
108     </delete>
109 </mapper>