<?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.securitycontrol.background.mapper.EarlyWarningRecordMapper">
    <!--获取信息列表-->
    <select id="getEarlyWarningRecordLists"  resultType="com.securitycontrol.entity.background.vo.EarlyWarningRecordVo">
        SELECT tw.warn_content as warnContent, tw.warn_time as warnTime
        FROM tb_warn tw
        LEFT JOIN tb_device_detail  tdd ON tw.device_id = tdd.device_id
        LEFT JOIN tb_bd_device tbd ON tdd.device_id = tbd.device_id
        LEFT JOIN sys_dict sd ON sd.dict_id = tbd.devic_type
        WHERE sd.dict_code ='6663'
        <if test="date != null and date != ''">
            and date (tw.warn_time) = #{date}
        </if>
    </select>
</mapper>