<?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.SbtdspsrMapper">
    <resultMap id="BaseResultMap" type="com.hzjt.domain.Sbtdspsr">
        <!--
          WARNING - @mbg.generated
        -->
        <result column="XH" jdbcType="VARCHAR" property="xh"/>
        <result column="SBBH" jdbcType="VARCHAR" property="sbbh"/>
        <result column="TDBH" jdbcType="DECIMAL" property="tdbh"/>
        <result column="TDLX" jdbcType="DECIMAL" property="tdlx"/>
        <result column="WBBH" jdbcType="VARCHAR" property="wbbh"/>
        <result column="TDMC" jdbcType="VARCHAR" property="tdmc"/>
        <result column="TDMCPY" jdbcType="VARCHAR" property="tdmcpy"/>
        <result column="TDZT" jdbcType="DECIMAL" property="tdzt"/>
        <result column="TDAZWZ" jdbcType="VARCHAR" property="tdazwz"/>
        <result column="JD" jdbcType="VARCHAR" property="jd"/>
        <result column="WD" jdbcType="VARCHAR" property="wd"/>
        <result column="TPWZX" jdbcType="DECIMAL" property="tpwzx"/>
        <result column="TPWZY" jdbcType="DECIMAL" property="tpwzy"/>
        <result column="SPBMGS" jdbcType="DECIMAL" property="spbmgs"/>
        <result column="SPXSGS" jdbcType="DECIMAL" property="spxsgs"/>
        <result column="SSSPSFZZF" jdbcType="DECIMAL" property="ssspsfzzf"/>
        <result column="SPZT" jdbcType="DECIMAL" property="spzt"/>
        <result column="LXZT" jdbcType="DECIMAL" property="lxzt"/>
        <result column="LXSFZZF" jdbcType="DECIMAL" property="lxsfzzf"/>
        <result column="SPZL" jdbcType="DECIMAL" property="spzl"/>
        <result column="GJZJG" jdbcType="DECIMAL" property="gjzjg"/>
        <result column="ML" jdbcType="DECIMAL" property="ml"/>
        <result column="SPMLYXGS" jdbcType="DECIMAL" property="spmlyxgs"/>
        <result column="SFZCPTZKZ" jdbcType="DECIMAL" property="sfzcptzkz"/>
        <result column="ZXCCZBH" jdbcType="VARCHAR" property="zxcczbh"/>
        <result column="ZXCCXE" jdbcType="DECIMAL" property="zxccxe"/>
        <result column="ZXCCYYRL" jdbcType="DECIMAL" property="zxccyyrl"/>
        <result column="ZXCCSYRL" jdbcType="DECIMAL" property="zxccsyrl"/>
        <result column="LXBLTS" jdbcType="DECIMAL" property="lxblts"/>
        <result column="SFQY" jdbcType="DECIMAL" property="sfqy"/>
        <result column="JLBH" jdbcType="VARCHAR" property="jlbh"/>
        <result column="FXMS" jdbcType="VARCHAR" property="fxms"/>
        <result column="JBMS" jdbcType="VARCHAR" property="jbms"/>
        <result column="XZBH" jdbcType="VARCHAR" property="xzbh"/>
        <result column="GGBH" jdbcType="VARCHAR" property="ggbh"/>
        <result column="ZNBH" jdbcType="VARCHAR" property="znbh"/>
        <result column="LXFS" jdbcType="DECIMAL" property="lxfs"/>
        <result column="JPKZDH" jdbcType="VARCHAR" property="jpkzdh"/>
        <result column="JDPX" jdbcType="DECIMAL" property="jdpx"/>
        <result column="SFZNFXJD" jdbcType="DECIMAL" property="sfznfxjd"/>
        <result column="ZNFXLX" jdbcType="VARCHAR" property="znfxlx"/>
        <result column="SQMS" jdbcType="DECIMAL" property="sqms"/>
        <result column="SQURLLJ" jdbcType="VARCHAR" property="squrllj"/>
        <result column="SSMLXZ" jdbcType="DECIMAL" property="ssmlxz"/>
        <result column="LXMLXZ" jdbcType="DECIMAL" property="lxmlxz"/>
        <result column="ZBURLLJ" jdbcType="VARCHAR" property="zburllj"/>
        <result column="ZBDK" jdbcType="DECIMAL" property="zbdk"/>
        <result column="DQX" jdbcType="DECIMAL" property="dqx"/>
        <result column="XQX" jdbcType="DECIMAL" property="xqx"/>
        <result column="KQX" jdbcType="DECIMAL" property="kqx"/>
        <result column="PQX" jdbcType="DECIMAL" property="pqx"/>
        <result column="LXHFQX" jdbcType="DECIMAL" property="lxhfqx"/>
        <result column="LXXZQX" jdbcType="DECIMAL" property="lxxzqx"/>
        <result column="LXDJQX" jdbcType="DECIMAL" property="lxdjqx"/>
        <result column="SFZLX" jdbcType="DECIMAL" property="sfzlx"/>
        <result column="SFZX" jdbcType="DECIMAL" property="sfzx"/>
        <result column="HB" jdbcType="VARCHAR" property="hb"/>
        <result column="JMCJ" jdbcType="VARCHAR" property="jmcj"/>
        <result column="SJ" jdbcType="VARCHAR" property="sj"/>
        <result column="LXLRCYFS" jdbcType="DECIMAL" property="lxlrcyfs"/>
        <result column="KHDOSDXSNR" jdbcType="VARCHAR" property="khdosdxsnr"/>
        <result column="KHDOSDXSWZ" jdbcType="VARCHAR" property="khdosdxswz"/>
        <result column="CJRY" jdbcType="VARCHAR" property="cjry"/>
        <result column="CJRQ" jdbcType="VARCHAR" property="cjrq"/>
        <result column="XGRY" jdbcType="VARCHAR" property="xgry"/>
        <result column="XGRQ" jdbcType="VARCHAR" property="xgrq"/>
        <result column="BZ" jdbcType="VARCHAR" property="bz"/>
        <result column="KZ1" jdbcType="DECIMAL" property="kz1"/>
        <result column="KZ2" jdbcType="DECIMAL" property="kz2"/>
        <result column="KZ3" jdbcType="VARCHAR" property="kz3"/>
        <result column="KZ4" jdbcType="VARCHAR" property="kz4"/>
    </resultMap>

    <select id="selectAllSbbhAndTdbh" resultType="com.hzjt.domain.Sbtdspsr">
        SELECT XH,SBBH,TDBH FROM SBTDSPSR WHERE XZBH like #{xzbh} || '%'
    </select>

    <select id="selectBySbbh" resultType="com.hzjt.domain.Sbtdspsr">
        SELECT A.* FROM SBTDSPSR A where  sbbh=#{sbbh} and tdbh=#{tdbh}
    </select>

    <select id="selectDeviceWrite" resultType="com.hzjt.domain.SbtdspsrParam">
        SELECT A.*,C.remark1 AS deviceconfig FROM SBTDSPSR A
        LEFT JOIN TRAFFDEVICEWRITERESULT B ON A.SBBH = B.SBBH AND A.TDBH = B.TDBH
        LEFT JOIN TRAFFDEVICECONFIG C ON C.FDID = A.SBBH AND C.CHANNELID = A.TDBH
        WHERE B.PUSHSTATUS != 0 OR B.PUSHDESC IS NULL
    </select>
</mapper>