155 lines
5.2 KiB
XML
155 lines
5.2 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.customer.mapper.ZdyGuideNoticeMapper">
|
||
|
|
||
|
<resultMap type="ZdyGuideNotice" id="ZdyGuideNoticeResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="deptId" column="dept_id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="content" column="content"/>
|
||
|
<result property="delFlag" column="del_flag"/>
|
||
|
<result property="createBy" column="create_by"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="updateBy" column="update_by"/>
|
||
|
<result property="updateTime" column="update_time"/>
|
||
|
<result property="remark" column="remark"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdyGuideNoticeVo">
|
||
|
select id,
|
||
|
dept_id,
|
||
|
name,
|
||
|
content,
|
||
|
del_flag,
|
||
|
create_by,
|
||
|
create_time,
|
||
|
update_by,
|
||
|
update_time,
|
||
|
remark
|
||
|
from zdy_guide_notice gn
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectZdyGuideNoticeList" parameterType="ZdyGuideNotice" resultMap="ZdyGuideNoticeResult">
|
||
|
<include refid="selectZdyGuideNoticeVo"/>
|
||
|
<where>
|
||
|
del_flag = '0'
|
||
|
<if test="name != null and name != ''">
|
||
|
and name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="content != null and content != ''">
|
||
|
and content = #{content}
|
||
|
</if>
|
||
|
${params.dataScope}
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyGuideNoticeById" parameterType="Long"
|
||
|
resultMap="ZdyGuideNoticeResult">
|
||
|
<include refid="selectZdyGuideNoticeVo"/>
|
||
|
where id = #{id}
|
||
|
and del_flag = '0'
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyGuideNotice" parameterType="ZdyGuideNotice" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_guide_notice
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name,
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id,
|
||
|
</if>
|
||
|
<if test="content != null and content != ''">content,
|
||
|
</if>
|
||
|
<if test="delFlag != null and delFlag != ''">del_flag,
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by,
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time,
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by,
|
||
|
</if>
|
||
|
<if test="updateTime != null">update_time,
|
||
|
</if>
|
||
|
<if test="remark != null">remark,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">#{name},
|
||
|
</if>
|
||
|
<if test="deptId != null">#{deptId},
|
||
|
</if>
|
||
|
<if test="content != null and content != ''">#{content},
|
||
|
</if>
|
||
|
<if test="delFlag != null and delFlag != ''">#{delFlag},
|
||
|
</if>
|
||
|
<if test="createBy != null">#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">#{createTime},
|
||
|
</if>
|
||
|
<if test="updateBy != null">#{updateBy},
|
||
|
</if>
|
||
|
<if test="updateTime != null">#{updateTime},
|
||
|
</if>
|
||
|
<if test="remark != null">#{remark},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateZdyGuideNotice" parameterType="ZdyGuideNotice">
|
||
|
update zdy_guide_notice
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null and name != ''">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="deptId != null ">dept_id =
|
||
|
#{deptId},
|
||
|
</if>
|
||
|
<if test="content != null and content != ''">content =
|
||
|
#{content},
|
||
|
</if>
|
||
|
<if test="delFlag != null and delFlag != ''">del_flag =
|
||
|
#{delFlag},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="updateBy != null">update_by =
|
||
|
#{updateBy},
|
||
|
</if>
|
||
|
<if test="updateTime != null">update_time =
|
||
|
#{updateTime},
|
||
|
</if>
|
||
|
<if test="remark != null">remark =
|
||
|
#{remark},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteZdyGuideNoticeById" parameterType="Long">
|
||
|
delete
|
||
|
from zdy_guide_notice
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyGuideNoticeByIds" parameterType="String">
|
||
|
update zdy_guide_notice set del_flag='1'
|
||
|
where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="checkNameUnique" resultMap="ZdyGuideNoticeResult">
|
||
|
select id, name
|
||
|
from zdy_guide_notice
|
||
|
where dept_id = #{deptId}
|
||
|
and name = #{name}
|
||
|
and del_flag = '0' limit 1
|
||
|
</select>
|
||
|
</mapper>
|