151 lines
5.0 KiB
XML
151 lines
5.0 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.zhwl.vip.mapper.ZdyVipLabelMapper">
|
|
|
|
<resultMap type="ZdyVipLabel" id="ZdyVipLabelResult">
|
|
<result property="id" column="id"/>
|
|
<result property="name" column="name"/>
|
|
<result property="enable" column="enable"/>
|
|
<result property="delFlag" column="del_flag"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="remark" column="remark"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectZdyVipLabelVo">
|
|
select id,
|
|
name,
|
|
enable,
|
|
del_flag,
|
|
create_time,
|
|
create_by,
|
|
update_time,
|
|
update_by,
|
|
remark
|
|
from zdy_vip_label
|
|
</sql>
|
|
|
|
<select id="selectZdyVipLabelList" parameterType="ZdyVipLabel" resultMap="ZdyVipLabelResult">
|
|
<include refid="selectZdyVipLabelVo"/>
|
|
<where>
|
|
and del_flag = 0
|
|
<if test="name != null and name != ''">
|
|
and name like concat('%', #{name}, '%')
|
|
</if>
|
|
<if test="enable != null and enable != ''">
|
|
and enable = #{enable}
|
|
</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="selectZdyVipLabelById" parameterType="Long"
|
|
resultMap="ZdyVipLabelResult">
|
|
<include refid="selectZdyVipLabelVo"/>
|
|
where id = #{id} and del_flag = 0
|
|
</select>
|
|
|
|
<select id="selectZdyVipLabelByIds" parameterType="Long"
|
|
resultMap="ZdyVipLabelResult">
|
|
<include refid="selectZdyVipLabelVo"/>
|
|
<where>
|
|
and del_flag = 0
|
|
<if test="ids != null and ids.length > 0">
|
|
and id in
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<insert id="insertZdyVipLabel" parameterType="ZdyVipLabel" useGeneratedKeys="true"
|
|
keyProperty="id">
|
|
insert into zdy_vip_label
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name,
|
|
</if>
|
|
<if test="enable != null and enable != ''">enable,
|
|
</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,
|
|
</if>
|
|
<if test="createTime != null">create_time,
|
|
</if>
|
|
<if test="createBy != null">create_by,
|
|
</if>
|
|
<if test="updateTime != null">update_time,
|
|
</if>
|
|
<if test="updateBy != null">update_by,
|
|
</if>
|
|
<if test="remark != null">remark,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="name != null and name != ''">#{name},
|
|
</if>
|
|
<if test="enable != null and enable != ''">#{enable},
|
|
</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},
|
|
</if>
|
|
<if test="createTime != null">#{createTime},
|
|
</if>
|
|
<if test="createBy != null">#{createBy},
|
|
</if>
|
|
<if test="updateTime != null">#{updateTime},
|
|
</if>
|
|
<if test="updateBy != null">#{updateBy},
|
|
</if>
|
|
<if test="remark != null">#{remark},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateZdyVipLabel" parameterType="ZdyVipLabel">
|
|
update zdy_vip_label
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="name != null and name != ''">name =
|
|
#{name},
|
|
</if>
|
|
<if test="enable != null ">enable =
|
|
#{enable},
|
|
</if>
|
|
<if test="updateTime != null">update_time =
|
|
#{updateTime},
|
|
</if>
|
|
<if test="updateBy != null">update_by =
|
|
#{updateBy},
|
|
</if>
|
|
<if test="remark != null">remark =
|
|
#{remark},
|
|
</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteZdyVipLabelById" parameterType="Long">
|
|
delete
|
|
from zdy_vip_label
|
|
where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteZdyVipLabelByIds" parameterType="String">
|
|
update zdy_vip_label set del_flag = 1 where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="checkNameUnique" parameterType="string" resultMap="ZdyVipLabelResult">
|
|
<include refid="selectZdyVipLabelVo"/>
|
|
<where>
|
|
and del_flag = 0
|
|
and name = #{name}
|
|
</where>
|
|
limit 1
|
|
</select>
|
|
</mapper> |