hdy
7 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
fb3b3e 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.billion.main.bs.mapper.BsFormulaInfoMapper">
6     
7     <resultMap type="BsFormulaInfo" id="BsFormulaInfoResult">
8         <result property="id"    column="id"    />
9         <result property="productCode"    column="product_code"    />
10         <result property="productName"    column="product_name"    />
11         <result property="formulaCode"    column="formula_code"    />
12         <result property="formulaName"    column="formula_name"    />
13         <result property="status"    column="status"    />
14         <result property="remark"    column="remark"    />
15         <result property="createBy"    column="create_by"    />
16         <result property="createTime"    column="create_time"    />
17         <result property="updateBy"    column="update_by"    />
18         <result property="updateTime"    column="update_time"    />
19         <result property="delFlag"    column="del_flag"    />
20     </resultMap>
21
22     <sql id="selectBsFormulaInfoVo">
23         select id, product_code, product_name, formula_code, formula_name, status, remark, create_by, create_time, update_by, update_time, del_flag from bs_formula_info
24     </sql>
25
26     <select id="selectBsFormulaInfoList" parameterType="BsFormulaInfo" resultMap="BsFormulaInfoResult">
27         <include refid="selectBsFormulaInfoVo"/>
28         <where>  
29             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
30             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
31             <if test="formulaCode != null  and formulaCode != ''"> and formula_code = #{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             and del_flag = "0"
35         </where>
36     </select>
37     
38     <select id="selectBsFormulaInfoById" parameterType="Long" resultMap="BsFormulaInfoResult">
39         <include refid="selectBsFormulaInfoVo"/>
40         where id = #{id}
41         and del_flag = "0"
42     </select>
43
44     <insert id="insertBsFormulaInfo" parameterType="BsFormulaInfo">
45         insert into bs_formula_info
46         <trim prefix="(" suffix=")" suffixOverrides=",">
47             <if test="id != null">id,</if>
48             <if test="productCode != null and productCode != ''">product_code,</if>
49             <if test="productName != null and productName != ''">product_name,</if>
50             <if test="formulaCode != null and formulaCode != ''">formula_code,</if>
51             <if test="formulaName != null and formulaName != ''">formula_name,</if>
52             <if test="status != null and status != ''">status,</if>
53             <if test="remark != null">remark,</if>
54             <if test="createBy != null">create_by,</if>
55             <if test="createTime != null">create_time,</if>
56             <if test="updateBy != null">update_by,</if>
57             <if test="updateTime != null">update_time,</if>
58             <if test="delFlag != null">del_flag,</if>
59          </trim>
60         <trim prefix="values (" suffix=")" suffixOverrides=",">
61             <if test="id != null">#{id},</if>
62             <if test="productCode != null and productCode != ''">#{productCode},</if>
63             <if test="productName != null and productName != ''">#{productName},</if>
64             <if test="formulaCode != null and formulaCode != ''">#{formulaCode},</if>
65             <if test="formulaName != null and formulaName != ''">#{formulaName},</if>
66             <if test="status != null and status != ''">#{status},</if>
67             <if test="remark != null">#{remark},</if>
68             <if test="createBy != null">#{createBy},</if>
69             <if test="createTime != null">#{createTime},</if>
70             <if test="updateBy != null">#{updateBy},</if>
71             <if test="updateTime != null">#{updateTime},</if>
72             <if test="delFlag != null">#{delFlag},</if>
73          </trim>
74     </insert>
75
76     <update id="updateBsFormulaInfo" parameterType="BsFormulaInfo">
77         update bs_formula_info
78         <trim prefix="SET" suffixOverrides=",">
79             <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
80             <if test="productName != null and productName != ''">product_name = #{productName},</if>
81             <if test="formulaCode != null and formulaCode != ''">formula_code = #{formulaCode},</if>
82             <if test="formulaName != null and formulaName != ''">formula_name = #{formulaName},</if>
83             <if test="status != null and status != ''">status = #{status},</if>
84             <if test="remark != null">remark = #{remark},</if>
85             <if test="createBy != null">create_by = #{createBy},</if>
86             <if test="createTime != null">create_time = #{createTime},</if>
87             <if test="updateBy != null">update_by = #{updateBy},</if>
88             <if test="updateTime != null">update_time = #{updateTime},</if>
89             <if test="delFlag != null">del_flag = #{delFlag},</if>
90         </trim>
91         where id = #{id}
92     </update>
93
94     <update id="deleteBsFormulaInfoById" parameterType="Long">
95         update bs_formula_info set del_flag = "1" where id = #{id}
96     </update>
97
98     <update id="deleteBsFormulaInfoByIds" parameterType="String">
99         update bs_formula_info set del_flag = "1" where id in
100         <foreach item="id" collection="array" open="(" separator="," close=")">
101             #{id}
102         </foreach>
103     </update>
104 </mapper>