<?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.inspection.mapper.WarnMessageMapper">


    <select id="selectWarnMessageList"  resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
        select * from warn_message
        <where>
            and warn_time <![CDATA[<=]]> NOW() and deleted = '0'
            <if test="title != null  and title != ''"> and title = #{title}</if>
            <if test="partnerId != null "> and partner_id = #{partnerId}</if>
            <if test="isRead != null  and isRead != ''"> and is_read = #{isRead}</if>
        </where>
        order by create_time desc
    </select>

    <select id="selectWarnMessageById"  resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
         select * from warn_message
        where id = #{id}
    </select>
    <select id="pageList" resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
        select * from warn_message
        <where>
            and warn_time <![CDATA[<=]]> NOW()
            <if test="warnMessage.title != null  and warnMessage.title != ''"> and title = #{warnMessage.title}</if>
            <if test="warnMessage.partnerId != null "> and partner_id = #{warnMessage.partnerId}</if>
            <if test="warnMessage.isRead != null  and warnMessage.isRead != ''"> and is_read = #{warnMessage.isRead}</if>
            and deleted = '0'
        </where>
        order by create_time desc
    </select>


</mapper>
