157 lines
5.3 KiB
XML
157 lines
5.3 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.ZdyVipBenefitsMapper">
|
||
|
|
||
|
<resultMap type="ZdyVipBenefits" id="ZdyVipBenefitsResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="image" column="image"/>
|
||
|
<result property="status" column="status"/>
|
||
|
<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="selectZdyVipBenefitsVo">
|
||
|
select id,
|
||
|
name,
|
||
|
image,
|
||
|
status,
|
||
|
del_flag,
|
||
|
create_time,
|
||
|
create_by,
|
||
|
update_time,
|
||
|
update_by,
|
||
|
remark
|
||
|
from zdy_vip_benefits
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectZdyVipBenefitsList" parameterType="ZdyVipBenefits" resultMap="ZdyVipBenefitsResult">
|
||
|
<include refid="selectZdyVipBenefitsVo"/>
|
||
|
<where>
|
||
|
del_flag = 0
|
||
|
<if test="name != null and name != ''">
|
||
|
and name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">
|
||
|
and status = #{status}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyVipBenefitsById" parameterType="Long"
|
||
|
resultMap="ZdyVipBenefitsResult">
|
||
|
<include refid="selectZdyVipBenefitsVo"/>
|
||
|
where id = #{id} and del_flag = 0
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyVipBenefits" parameterType="ZdyVipBenefits" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_vip_benefits
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name,
|
||
|
</if>
|
||
|
<if test="image != null and image != ''">image,
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">status,
|
||
|
</if>
|
||
|
<if test="delFlag != null">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="image != null and image != ''">#{image},
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">#{status},
|
||
|
</if>
|
||
|
<if test="delFlag != null">#{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="updateZdyVipBenefits" parameterType="ZdyVipBenefits">
|
||
|
update zdy_vip_benefits
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="image != null and image != ''">image =
|
||
|
#{image},
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">status =
|
||
|
#{status},
|
||
|
</if>
|
||
|
<if test="delFlag != null">del_flag =
|
||
|
#{delFlag},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</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="deleteZdyVipBenefitsById" parameterType="Long">
|
||
|
delete
|
||
|
from zdy_vip_benefits
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyVipBenefitsByIds" parameterType="String">
|
||
|
update zdy_vip_benefits set del_flag = 1 where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="checkNameUnique" parameterType="string" resultMap="ZdyVipBenefitsResult">
|
||
|
<include refid="selectZdyVipBenefitsVo"/>
|
||
|
where del_flag = 0
|
||
|
and name =#{name}
|
||
|
limit 1
|
||
|
</select>
|
||
|
|
||
|
<update id="updateStatus">
|
||
|
update zdy_vip_benefits
|
||
|
set status = #{status}
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
</mapper>
|