<?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.ezhizao.project.business.notification.mapper.SysNotificationMapper">

    <resultMap type="cn.ezhizao.project.business.notification.domain.SysNotification" id="SysNotificationResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="SysNotification" resultMap="SysNotificationResult">
        SELECT * FROM sys_notification
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="title != null  and title != ''"> AND title = #{title}</if>
            <if test="type != null "> AND type = #{type}</if>
            <if test="content != null  and content != ''"> AND content = #{content}</if>
            <if test="updateContent != null  and updateContent != ''"> AND update_content = #{updateContent}</if>
            <if test="status != null "> AND status = #{status}</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM sys_notification
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
