<?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="cn.iocoder.yudao.module.appBase.mapper.SysAnnouncementMapper">



    <select id="selectSysAnnouncementList" resultType="cn.iocoder.yudao.module.appBase.domain.SysAnnouncement">
        select * from sys_announcement
        <where>  
            <if test="map.type != null  and type != ''"> and type = #{map.type}</if>
            <if test="map.title != null  and title != ''"> and title = #{map.title}</if>
            <if test="map.content != null  and content != ''"> and content = #{map.content}</if>
            <if test="map.toUserId != null "> and to_user_id = #{map.toUserId}</if>
            <if test="map.deptId != null "> and dept_id = #{map.deptId}</if>
        </where>
        order by create_time desc
    </select>
    
    <select id="selectSysAnnouncementById" parameterType="Long" resultType="cn.iocoder.yudao.module.appBase.domain.SysAnnouncement">
         select * from sys_announcement
        where id = #{id}
    </select>


    <delete id="deleteSysAnnouncementById" parameterType="Long">
        delete from sys_announcement where id = #{id}
    </delete>

    <delete id="deleteSysAnnouncementByIds" parameterType="String">
        delete from sys_announcement where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>