admin
2024-07-01 768498719683f85e5ed19c73eb3d14cdbf420df4
提交 | 用户 | 时间
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="remark"    column="remark"    />
13         <result property="createUser"    column="create_user"    />
14         <result property="createTime"    column="create_time"    />
15         <result property="updateUser"    column="update_user"    />
16         <result property="updateTime"    column="update_time"    />
17         <result property="dataSource"    column="data_source"    />
18     </resultMap>
19
20     <sql id="selectBsBeatSettingVo">
768498 21         select id, product_code, product_name, beat, remark, create_user, create_time, update_user, update_time, data_source from bs_beat_setting
e57a89 22     </sql>
23
24     <select id="selectBsBeatSettingList" parameterType="BsBeatSetting" resultMap="BsBeatSettingResult">
25         <include refid="selectBsBeatSettingVo"/>
26         <where>  
27             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
28             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
29             <if test="beat != null  and beat != ''"> and beat = #{beat}</if>
30             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
31             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
32             <if test="dataSource != null  and dataSource != ''"> and data_source = #{dataSource}</if>
33         </where>
34     </select>
35     
36     <select id="selectBsBeatSettingById" parameterType="Long" resultMap="BsBeatSettingResult">
37         <include refid="selectBsBeatSettingVo"/>
38         where id = #{id}
39     </select>
40         
41     <insert id="insertBsBeatSetting" parameterType="BsBeatSetting" useGeneratedKeys="true" keyProperty="id">
42         insert into bs_beat_setting
43         <trim prefix="(" suffix=")" suffixOverrides=",">
44             <if test="productCode != null">product_code,</if>
45             <if test="productName != null">product_name,</if>
46             <if test="beat != null and beat != ''">beat,</if>
47             <if test="remark != null">remark,</if>
48             <if test="createUser != null">create_user,</if>
49             <if test="createTime != null">create_time,</if>
50             <if test="updateUser != null">update_user,</if>
51             <if test="updateTime != null">update_time,</if>
52             <if test="dataSource != null">data_source,</if>
53          </trim>
54         <trim prefix="values (" suffix=")" suffixOverrides=",">
55             <if test="productCode != null">#{productCode},</if>
56             <if test="productName != null">#{productName},</if>
57             <if test="beat != null and beat != ''">#{beat},</if>
58             <if test="remark != null">#{remark},</if>
59             <if test="createUser != null">#{createUser},</if>
60             <if test="createTime != null">#{createTime},</if>
61             <if test="updateUser != null">#{updateUser},</if>
62             <if test="updateTime != null">#{updateTime},</if>
63             <if test="dataSource != null">#{dataSource},</if>
64          </trim>
65     </insert>
66
67     <update id="updateBsBeatSetting" parameterType="BsBeatSetting">
68         update bs_beat_setting
69         <trim prefix="SET" suffixOverrides=",">
70             <if test="productCode != null">product_code = #{productCode},</if>
71             <if test="productName != null">product_name = #{productName},</if>
72             <if test="beat != null and beat != ''">beat = #{beat},</if>
73             <if test="remark != null">remark = #{remark},</if>
74             <if test="createUser != null">create_user = #{createUser},</if>
75             <if test="createTime != null">create_time = #{createTime},</if>
76             <if test="updateUser != null">update_user = #{updateUser},</if>
77             <if test="updateTime != null">update_time = #{updateTime},</if>
78             <if test="dataSource != null">data_source = #{dataSource},</if>
79         </trim>
80         where id = #{id}
81     </update>
82
83     <delete id="deleteBsBeatSettingById" parameterType="Long">
84         delete from bs_beat_setting where id = #{id}
85     </delete>
86
87     <delete id="deleteBsBeatSettingByIds" parameterType="String">
88         delete from bs_beat_setting where id in 
89         <foreach item="id" collection="array" open="(" separator="," close=")">
90             #{id}
91         </foreach>
92     </delete>
93 </mapper>