-
懒羊羊
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.beatSetting.mapper.BsBeatSettingMapper">
6     
7     <resultMap type="BsBeatSetting" id="BsBeatSettingResult">
8         <result property="id"    column="id"    />
9         <result property="productCode"    column="product_code"    />
10         <result property="productName"    column="product_name"    />
11         <result property="beat"    column="beat"    />
12         <result property="spareField1"    column="spare_field_1"    />
13         <result property="spareField2"    column="spare_field_2"    />
14         <result property="remark"    column="remark"    />
15         <result property="createUser"    column="create_user"    />
16         <result property="createTime"    column="create_time"    />
17         <result property="updateUser"    column="update_user"    />
18         <result property="updateTime"    column="update_time"    />
19         <result property="dataSource"    column="data_source"    />
20     </resultMap>
21
22     <sql id="selectBsBeatSettingVo">
23         select id, product_code, product_name, beat, spare_field_1, spare_field_2, remark, create_user, create_time, update_user, update_time, data_source from bs_beat_setting
24     </sql>
25
26     <select id="selectBsBeatSettingList" parameterType="BsBeatSetting" resultMap="BsBeatSettingResult">
27         <include refid="selectBsBeatSettingVo"/>
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="beat != null  and beat != ''"> and beat = #{beat}</if>
32             <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
33             <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
34             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
35             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
36             <if test="dataSource != null  and dataSource != ''"> and data_source = #{dataSource}</if>
37         </where>
38     </select>
39     
40     <select id="selectBsBeatSettingById" parameterType="Long" resultMap="BsBeatSettingResult">
41         <include refid="selectBsBeatSettingVo"/>
42         where id = #{id}
43     </select>
44         
45     <insert id="insertBsBeatSetting" parameterType="BsBeatSetting" useGeneratedKeys="true" keyProperty="id">
46         insert into bs_beat_setting
47         <trim prefix="(" suffix=")" suffixOverrides=",">
48             <if test="productCode != null">product_code,</if>
49             <if test="productName != null">product_name,</if>
50             <if test="beat != null and beat != ''">beat,</if>
51             <if test="spareField1 != null">spare_field_1,</if>
52             <if test="spareField2 != null">spare_field_2,</if>
53             <if test="remark != null">remark,</if>
54             <if test="createUser != null">create_user,</if>
55             <if test="createTime != null">create_time,</if>
56             <if test="updateUser != null">update_user,</if>
57             <if test="updateTime != null">update_time,</if>
58             <if test="dataSource != null">data_source,</if>
59          </trim>
60         <trim prefix="values (" suffix=")" suffixOverrides=",">
61             <if test="productCode != null">#{productCode},</if>
62             <if test="productName != null">#{productName},</if>
63             <if test="beat != null and beat != ''">#{beat},</if>
64             <if test="spareField1 != null">#{spareField1},</if>
65             <if test="spareField2 != null">#{spareField2},</if>
66             <if test="remark != null">#{remark},</if>
67             <if test="createUser != null">#{createUser},</if>
68             <if test="createTime != null">#{createTime},</if>
69             <if test="updateUser != null">#{updateUser},</if>
70             <if test="updateTime != null">#{updateTime},</if>
71             <if test="dataSource != null">#{dataSource},</if>
72          </trim>
73     </insert>
74
75     <update id="updateBsBeatSetting" parameterType="BsBeatSetting">
76         update bs_beat_setting
77         <trim prefix="SET" suffixOverrides=",">
78             <if test="productCode != null">product_code = #{productCode},</if>
79             <if test="productName != null">product_name = #{productName},</if>
80             <if test="beat != null and beat != ''">beat = #{beat},</if>
81             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
82             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
83             <if test="remark != null">remark = #{remark},</if>
84             <if test="createUser != null">create_user = #{createUser},</if>
85             <if test="createTime != null">create_time = #{createTime},</if>
86             <if test="updateUser != null">update_user = #{updateUser},</if>
87             <if test="updateTime != null">update_time = #{updateTime},</if>
88             <if test="dataSource != null">data_source = #{dataSource},</if>
89         </trim>
90         where id = #{id}
91     </update>
92
93     <delete id="deleteBsBeatSettingById" parameterType="Long">
94         delete from bs_beat_setting where id = #{id}
95     </delete>
96
97     <delete id="deleteBsBeatSettingByIds" parameterType="String">
98         delete from bs_beat_setting where id in 
99         <foreach item="id" collection="array" open="(" separator="," close=")">
100             #{id}
101         </foreach>
102     </delete>
103 </mapper>