<?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="org.springblade.modules.data.mapper.WarnDataCacheMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="warningInfoEntityResultMap" type="org.springblade.modules.data.entity.OriginalWarningInfoEntity">
        <result column="warn_id" property="warnId"/>
        <result column="stcd" property="stcd"/>
        <result column="warn_name" property="warnName"/>
        <result column="warn_time" property="warnTime"/>
        <result column="warn_level_code" property="warnLevelCode"/>
        <result column="warn_info" property="warnInfo"/>
        <result column="warn_status" property="warnStatus"/>
        <result column="review_status" property="reviewStatus"/>
        <result column="type" property="type"/>
        <result column="remark" property="remark"/>
        <result column="rain_warn_rate" property="rainWarnRate"/>
        <result column="warn_sort" property="warnSort"/>
        <result column="warn_location" property="warnLocation"/>
        <result column="warn_adcd" property="warnAdcd"/>
        <result column="user_adcd" property="userAdcd"/>
        <result column="warn_lgtd" property="warnLgtd"/>
        <result column="warn_lttd" property="warnLttd"/>
        <result column="intv" property="intv"/>
        <result column="drp" property="drp"/>
        <result column="z" property="z"/>
        <result column="q" property="q"/>
        <result column="wptn" property="wptn"/>
        <result column="rz" property="rz"/>
        <result column="rwptn" property="rwptn"/>
        <result column="inq" property="inq"/>
        <result column="rel_warn_id" property="relWarnId"/>
    </resultMap>

    <select id="selectWarningList" resultMap="warningInfoEntityResultMap">
        SELECT
        n.*
        FROM
        etl_st_warning_info n
        WHERE 1=1
        <if test="dto.reviewStatus!=null">
            and (n.review_status is null or n.review_status != #{dto.reviewStatus})
        </if>
        <if test="dto.type!=null">
            and n.type = #{dto.type}
        </if>
        <if test="dto.updateTime!=null">
            and n.update_time > #{dto.updateTime}
        </if>
        order by n.update_time
    </select>
</mapper>
