<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.jcdm.main.bs.beatSetting.mapper.BsBeatSettingMapper">
|
|
<resultMap type="BsBeatSetting" id="BsBeatSettingResult">
|
<result property="id" column="id" />
|
<result property="productCode" column="product_code" />
|
<result property="productName" column="product_name" />
|
<result property="beat" column="beat" />
|
<result property="remark" column="remark" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="dataSource" column="data_source" />
|
</resultMap>
|
|
<sql id="selectBsBeatSettingVo">
|
select id, product_code, product_name, beat, remark, create_user, create_time, update_user, update_time, data_source from bs_beat_setting
|
</sql>
|
|
<select id="selectBsBeatSettingList" parameterType="BsBeatSetting" resultMap="BsBeatSettingResult">
|
<include refid="selectBsBeatSettingVo"/>
|
<where>
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
<if test="beat != null and beat != ''"> and beat = #{beat}</if>
|
<if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
|
<if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if>
|
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if>
|
</where>
|
</select>
|
|
<select id="selectBsBeatSettingById" parameterType="Long" resultMap="BsBeatSettingResult">
|
<include refid="selectBsBeatSettingVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsBeatSetting" parameterType="BsBeatSetting" useGeneratedKeys="true" keyProperty="id">
|
insert into bs_beat_setting
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="productCode != null">product_code,</if>
|
<if test="productName != null">product_name,</if>
|
<if test="beat != null and beat != ''">beat,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="dataSource != null">data_source,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="productCode != null">#{productCode},</if>
|
<if test="productName != null">#{productName},</if>
|
<if test="beat != null and beat != ''">#{beat},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="dataSource != null">#{dataSource},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsBeatSetting" parameterType="BsBeatSetting">
|
update bs_beat_setting
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="productCode != null">product_code = #{productCode},</if>
|
<if test="productName != null">product_name = #{productName},</if>
|
<if test="beat != null and beat != ''">beat = #{beat},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="dataSource != null">data_source = #{dataSource},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsBeatSettingById" parameterType="Long">
|
delete from bs_beat_setting where id = #{id}
|
</delete>
|
|
<delete id="deleteBsBeatSettingByIds" parameterType="String">
|
delete from bs_beat_setting where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|