<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzjt.mapper.TraffdevicewriteresultMapper">
    <select id="querySbtdspsrByXh" resultType="com.hzjt.domain.SbtdspsrParams">
        SELECT
        TA.*,
        A.CREATETIME,
        A.PUSHSTATUS,
        A.PUSHCOUNT,
        A.REMARK,
        A.PUSHDESC,
        p.dept_name AS xztreename,
        B.remark1 AS deviceconfig
        FROM SBTDSPSR TA
        LEFT JOIN TRAFFDEVICEWRITERESULT A ON A.SBBH = TA.SBBH AND A.TDBH = TA.TDBH
        LEFT JOIN TRAFFDEVICECONFIG B ON B.FDID = TA.SBBH AND B.CHANNELID = TA.TDBH
        LEFT JOIN dept P ON P .dept_id = TA.xzbh
        WHERE 1=1
        <if test="xhs !=null and xhs.size>0 ">
            and TA.XH IN
            <foreach item="xh" collection="xhs" open="(" separator="," close=")">
                #{xh}
            </foreach>
        </if>
    </select>
</mapper>