75 lines
3.9 KiB
XML
75 lines
3.9 KiB
XML
<?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.alonginfo.project.business.mapper.MxGroupSettingMapper">
|
|
|
|
<resultMap type="MxGroupSetting" id="MxGroupSettingResult">
|
|
<result property="settingId" column="setting_id" />
|
|
<result property="settingName" column="setting_name" />
|
|
<result property="autoSwitch" column="auto_switch" />
|
|
<result property="switchAnimation" column="switch_animation" />
|
|
<result property="switchTime" column="switch_time" />
|
|
<result property="description" column="description" />
|
|
</resultMap>
|
|
|
|
<sql id="selectMxGroupSettingVo">
|
|
select setting_id, setting_name, auto_switch, switch_animation, switch_time, description from mx_group_setting
|
|
</sql>
|
|
|
|
<!-- 查询列表 -->
|
|
<select id="selectMxGroupSettingList" parameterType="MxGroupSetting" resultMap="MxGroupSettingResult">
|
|
<include refid="selectMxGroupSettingVo"/>
|
|
<where>
|
|
<if test="settingName != null and settingName != ''"> and setting_name like concat('%', #{settingName}, '%')</if>
|
|
<if test="autoSwitch != null and autoSwitch != ''"> and auto_switch = #{autoSwitch}</if>
|
|
<if test="switchAnimation != null "> and switch_animation = #{switchAnimation}</if>
|
|
<if test="switchTime != null "> and switch_time = #{switchTime}</if>
|
|
<if test="description != null and description != ''"> and description = #{description}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<!-- 根据ID 查询 -->
|
|
<select id="selectMxGroupSettingById" parameterType="String" resultMap="MxGroupSettingResult">
|
|
<include refid="selectMxGroupSettingVo"/>
|
|
where setting_id = #{settingId}
|
|
</select>
|
|
<!--插入配置-->
|
|
<insert id="insertMxGroupSetting" parameterType="MxGroupSetting">
|
|
insert into mx_group_setting
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="settingId != null and settingId != ''">setting_id,</if>
|
|
<if test="settingName != null and settingName != ''">setting_name,</if>
|
|
<if test="autoSwitch != null and autoSwitch != ''">auto_switch,</if>
|
|
<if test="switchAnimation != null ">switch_animation,</if>
|
|
<if test="switchTime != null ">switch_time,</if>
|
|
<if test="description != null and description != ''">description,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="settingId != null and settingId != ''">#{settingId},</if>
|
|
<if test="settingName != null and settingName != ''">#{settingName},</if>
|
|
<if test="autoSwitch != null and autoSwitch != ''">#{autoSwitch},</if>
|
|
<if test="switchAnimation != null ">#{switchAnimation},</if>
|
|
<if test="switchTime != null ">#{switchTime},</if>
|
|
<if test="description != null and description != ''">#{description},</if>
|
|
</trim>
|
|
</insert>
|
|
<!--更新配置-->
|
|
<update id="updateMxGroupSetting" parameterType="MxGroupSetting">
|
|
update mx_group_setting
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="settingName != null and settingName != ''">setting_name = #{settingName},</if>
|
|
<if test="autoSwitch != null and autoSwitch != ''">auto_switch = #{autoSwitch},</if>
|
|
<if test="switchAnimation != null ">switch_animation = #{switchAnimation},</if>
|
|
<if test="switchTime != null ">switch_time = #{switchTime},</if>
|
|
<if test="description != null and description != ''">description = #{description},</if>
|
|
</trim>
|
|
where setting_id = #{settingId}
|
|
</update>
|
|
<!--删除配置-->
|
|
<delete id="deleteMxGroupSettingById" parameterType="String">
|
|
delete from mx_group_setting where setting_id = #{settingId}
|
|
</delete>
|
|
|
|
|
|
</mapper> |