<?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.njcn.csdevice.mapper.CsEventSendMsgMapper">

    <select id="selectPages" resultType="com.njcn.csdevice.pojo.vo.CsEventSendMsgVO">
        select a.*,b.*,c.name devName from cs_event_send_msg  a LEFT JOIN cs_event b on a.event_id =b.id left JOIN cs_ledger c on b.device_id =c.id
        where 1=1
        <if test="baseParam!=null and baseParam.searchEndTime  != null and baseParam.searchEndTime !=''">
            AND  DATE(a.send_time) &lt;= DATE(#{baseParam.searchEndTime})
        </if>
        <if test="baseParam!=null and baseParam.searchBeginTime != null and baseParam.searchBeginTime !=''">
            AND DATE(a.send_time) &gt;=  DATE(#{baseParam.searchBeginTime})
        </if>
        order by send_time desc
    </select>
</mapper>