<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap
        PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
        "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="com.hst.tmService.dao.BusDdAppMapper">


    <parameterMap class="java.util.Map" id="pWebjkDd15201SaveRyjhxxMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="xm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="nick" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sfzhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="jhsj" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>

    <procedure id="pWebjkDd15201SaveRyjhxx" parameterMap="pWebjkDd15201SaveRyjhxxMap">
        {call P_WEBJK_DD15201_SAVERYJHXX(?,?,?,?,?,?,?,?,?)}
    </procedure>


    <parameterMap class="java.util.Map" id="pWebjkDd15202SaveCkbzMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="nrlb" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ywxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="cksj" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>

    <procedure id="pWebjkDd15202SaveCkbz" parameterMap="pWebjkDd15202SaveCkbzMap">
        {call P_WEBJK_DD15202_SAVECKBZ(?,?,?,?,?,?,?,?)}
    </procedure>

    <parameterMap class="java.util.Map" id="pWebjkDd15203SaveHfxxMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="nrlb" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ywxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="hfsj" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="hfnr" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>

    <procedure id="pWebjkDd15203SaveHfxx" parameterMap="pWebjkDd15203SaveHfxxMap">
        {call P_WEBJK_DD15203_SAVEHFXX(?,?,?,?,?,?,?,?,?)}
    </procedure>


    <resultMap class="com.hst.taxService.domain.dd.DdinDbrwListDomain" id="pWebjkDd15204DbrwListResMap">
        <result property="dbrwXh" column="DBRWXH"/>
        <result property="nsrsbh" column="NSRSBH"/>
        <result property="nsrmc" column="NSRMC"/>
        <result property="bt" column="BT"/>
        <result property="rq" column="RQ"/>
        <result property="bjqx" column="BJQX"/>
        <result property="wcbz" column="WCBZ"/>
        <result property="bdlx" column="BDLX"/>
        <result property="zdyRwbdxh" column="ZDYRWBDXH"/>
        <result property="bdUrl" column="BDURL"/>
        <result property="djxh" column="djxh"/>
        <result property="ywxh" column="ywxh"/>
    </resultMap>

    <parameterMap class="java.util.Map" id="pWebjkDd15204DbrwListMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="str" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="rows" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="page" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="dataList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkDd15204DbrwListResMap"/>
    </parameterMap>

    <procedure id="pWebjkDd15204DbrwList" parameterMap="pWebjkDd15204DbrwListMap">
        {call P_WEBJK_DDIN15204_DBRWLIST(?,?,?,?,?,?,?,?,?)}
    </procedure>




    <resultMap class="com.hst.taxService.domain.dd.DdinDbrwNrDomain" id="pWebjkDd15205InDbrwnrResMap">
        <result property="hXmxh" column="HXMXH"/>
        <result property="lXmxh" column="LXHXM"/>
        <result property="sjxz" column="SJXZ"/>
    </resultMap>

    <resultMap class="com.hst.taxService.domain.dd.DdinDbrwNrFjDomain" id="pWebjkDd15205InDbrwnrFjResMap">
        <result property="xh" column="xh"/>
        <result property="fjmc" column="fjmc"/>
        <result property="fjurl" column="fjurl"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pWebjkDd15205InDbrwnrMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dbrwXh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="djxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="nsrmc" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="bt" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="ly" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="rq" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="bjqx" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="wcbz" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="bdlx" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="rwsm" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="wcrq" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="wcsm" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="wcrxm" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>

        <parameter property="bdmc" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="bddgmc" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="dataList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkDd15205InDbrwnrResMap"/>
        <parameter property="xffj" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkDd15205InDbrwnrFjResMap"/>
    </parameterMap>

    <procedure id="pWebjkDd15205InDbrwnr" parameterMap="pWebjkDd15205InDbrwnrMap">
        {call P_WEBJK_DDIN15205_DBRWNR(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
    </procedure>


    <resultMap class="com.hst.taxService.domain.dd.DdinDbrwBdxmDomain" id="pWebjkDdin15206DbrwbdxmResMap">
        <result property="hlbz" column="HLBZ"/>
        <result property="xmxh" column="XMXH"/>
        <result property="xmmc" column="XMMC"/>
        <result property="pxxh" column="PXXH"/>
        <result property="sjxlx" column="SJXLX"/>
        <result property="sfblx" column="SFBLX"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pWebjkDdin15206DbrwbdxmMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dbrwXh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="djxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="dataList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkDdin15206DbrwbdxmResMap"/>
    </parameterMap>

    <procedure id="pWebjkDdin15206Dbrwbdxm" parameterMap="pWebjkDdin15206DbrwbdxmMap">
        {call P_WEBJK_DDIN15206_INDBRWBDXM(?,?,?,?,?,?,?,?)}
    </procedure>

    <resultMap class="com.hst.taxService.domain.dd.DdinDbrwBdxmXzxDomain" id="pWebjkDd15207InDbrwbdxmXzResMap">
        <result property="hlbz" column="HLBZ"/>
        <result property="xmxh" column="XMXH"/>
        <result property="xzxxh" column="XZXXH"/>
        <result property="xzxmc" column="XZXMC"/>
        <result property="pxxh" column="PXXH"/>

    </resultMap>
    <parameterMap class="java.util.Map" id="pWebjkDd15207InDbrwbdxmXzMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="djhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dbrwXh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="djxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="dataList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkDd15207InDbrwbdxmXzResMap"/>
    </parameterMap>

    <procedure id="pWebjkDd15207InDbrwbdxmXz" parameterMap="pWebjkDd15207InDbrwbdxmXzMap">
        {call P_WEBJK_DDIN15207_INDBRWBDXMXZ(?,?,?,?,?,?,?,?)}
    </procedure>

    <insert id="saveLsbWebjkPublic" parameterClass="com.hst.common.bo.LsbWebjkPublic">
        <selectKey keyProperty="pclXh" resultClass="String" type="pre">
            select SEQ_PCL_YXXH.nextval as pclXh from dual
        </selectKey>
        insert into LSB_WEBJK_PUBLIC (PCL_XH,YWXH_XH,XH,NR) VALUES (#pclXh:NUMERIC#,#ywxhXh:VARCHAR#,#xh:VARCHAR#,#nr:VARCHAR#)
    </insert>
    <insert id="saveLsbWebjkPublicByPclXh" parameterClass="com.hst.common.bo.LsbWebjkPublic">
		insert into LSB_WEBJK_PUBLIC (PCL_XH,YWXH_XH,XH,NR) VALUES (#pclXh:NUMERIC#,#ywxhXh:VARCHAR#,#xh:VARCHAR#,#nr:VARCHAR#)
	</insert>

    <parameterMap class="java.util.Map" id="pWebjkDd15208DbrwSaveMap">
        <parameter property="swjgdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ddid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dbrwXh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="djxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="wcbz" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="wcsm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="pclXh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>

    <procedure id="pWebjkDd15208DbrwSave" parameterMap="pWebjkDd15208DbrwSaveMap">
        {call P_WEBJK_DDIN15208_INDBRWSAVE(?,?,?,?,?,?,?,?,?,?)}
    </procedure>
<select id="queryAddSwbmList" resultClass="com.hst.taxService.domain.dd.DdoutTbSwbmDataTmp">

        SELECT DW.SWJG_DM ZGSWJGDM,
        CASE WHEN BM.YXBZ = 'Y' AND BM.QYH_TBBZ = 'N' OR BM.QYH_TBBZ IS NULL THEN '0'
        WHEN BM.YXBZ = 'Y' AND BM.QYH_TBBZ = 'U' THEN '1'
        WHEN BM.YXBZ = 'N' THEN '2'
        END CZBJ,
        BM.SWBM_DM jgbmDm,
        '1' jglx,
        BM.SWBM_JC jgbmMc,
        '1' jgbmjb,
        '0' sjjgbmDm,
        '0' sjjgbmMc,
        (SELECT ZG.SWRY_DM FROM TM.QYH_SZ_SWRY_SWBM ZG WHERE ZG.SWBM_DM = BM.SWBM_DM AND ZG.BMFZR = 'Y') bmzgDm,
        (SELECT RY.XM FROM TM.QYH_SZ_SWRY_SWBM ZG,TM.QYH_SZ_SWRY RY
        WHERE ZG.SWBM_DM = BM.SWBM_DM AND ZG.BMFZR = 'Y' AND ZG.SWRY_DM = RY.SWRY_DM) bmzgXm,
        (SELECT RY.SJHM FROM TM.QYH_SZ_SWRY_SWBM ZG,TM.QYH_SZ_SWRY RY
        WHERE ZG.SWBM_DM = BM.SWBM_DM AND ZG.BMFZR = 'Y' AND ZG.SWRY_DM = RY.SWRY_DM) bmzgSjhm,
        JG.NSR_SWJG_BZ nsrSwjgBz
        FROM TM.QYH_SZ_SWJG_SWBM BM,TM.QYH_SZ_SWJG_QY DW,CTAIS2.DM_SWJG JG
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND BM.SWJG_DM = DW.SWJG_DM
        AND (BM.YXBZ = 'Y' OR (BM.YXBZ = 'N' AND BM.QYH_TBBZ = 'U'))
        AND (BM.QYH_TBBZ IN ('N','U') OR BM.QYH_TBBZ IS NULL)
        AND BM.GT3_SWJG_DM = JG.SWJG_DM

    </select>
    <select id="queryAddSwryList" resultClass="com.hst.taxService.domain.dd.DdoutTbSwryDataDomain">



        SELECT
        RY.SWRY_DM jgryDm,
        RY.XM xm,
        RY.SFZHM sfzhm,
        RY.SJHM sjhm,
        RY.ZW zw,
        CASE WHEN RY.QYBZ = 'Y' THEN '1' ELSE '0' END qybj,
        '1' cysx,
        '1' jglx,
        BM.SWBM_DM jgbmDm
        FROM TM.QYH_SZ_SWRY RY,TM.QYH_SZ_SWJG_QY DW,TM.QYH_SZ_SWRY_SWBM BM,TM.QYH_SZ_SWJG_SWBM B
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND RY.SWJG_DM = DW.SWJG_DM
        AND ((RY.YXBZ = 'Y' AND RY.QYBZ = 'Y')
        OR (RY.YXBZ = 'N' AND RY.QYH_TBBZ = 'U')
        OR (RY.QYBZ = 'N' AND RY.QYH_TBBZ = 'U'))
        AND RY.SJHM IS NOT NULL
        AND (RY.QYH_TBBZ IN ('N','U') OR RY.QYH_TBBZ IS NULL)
        AND RY.SWRY_DM = BM.SWRY_DM
        AND BM.ZBMBZ = 'Y'
        and B.SWBM_DM= BM.SWBM_DM AND B.YXBZ='Y'

    </select>
    <select id="queryNsrAddList" resultClass="com.hst.taxService.domain.dd.DdoutTbNsrDomain">
        SELECT DW.SWJG_DM ZGSWJGDM,
        CASE WHEN NSR.YXBZ = 'Y' AND NSR.QYH_TBBZ = 'N' OR NSR.QYH_TBBZ IS NULL THEN '0'
        WHEN NSR.YXBZ = 'Y' AND NSR.QYH_TBBZ = 'U' THEN '1'
        WHEN NSR.YXBZ = 'N' THEN '2'
        END CZBJ,
        NSR.DJXH djxh,
        DJ.NSRSBH nsrsbh,
        DJ.SHXYDM shxydm,
        DJ.ZGSWJ_DM zgswjDm,
        DJ.ZGSWSKFJ_DM zgswskfjDm,
        NULL zzhm,
        DJ.NSRMC nsrmc,
        DJ.NSRZT_DM nsrztDm,
        DJ.DJZCLX_DM djzclxDm,
        DJ.HY_DM hyDm,
        DJ.KZZTDJLX_DM kzztdjlxDm,
        DJ.GDGHLX_DM gdghlxDm,
        DJ.DWLSGX_DM dwlsgxDm,
        NULL  kjzdzzDm,
        NULL xzqhszDm,
        NULL jyfw,
        DJ.ZCDZ zcdz,
        DJ.SCJYDZ scjydz,
        TO_CHAR(DJ.DJRQ,'YYYY-MM-DD') kyslrq,
        NULL cyrs,
        DJ.FDDBRXM fddbrxm,
        NULL fddbryddh,
        NULL fddbrsfzjlxDm,
        NULL fddbrsfzhm,
        NULL cwfzrxm,
        NULL cwfzryddh,
        NULL bsrxm,
        NULL bsryddh,
        NULL zdsyhjkjcDm,
        NULL ybnsrrdbj,
        NVL(DJ.ZGSWSKFJ_DM,DJ.ZGSWJ_DM) jgbmDm
        FROM  TM.QYH_SZ_SWJG_QY DW, TM.SMZ_BSY_NSR_SJTB NSR,HX_DJ.DJ_NSRXX DJ
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = NSR.SWJG_DM
        AND (NSR.YXBZ = 'Y' OR (NSR.YXBZ = 'N' AND NSR.QYH_TBBZ = 'U'))
        AND NSR.DJXH = DJ.DJXH

    </select>

    <select id="queryBsryAddList" resultClass="com.hst.taxService.domain.dd.DdoutTbBsryDomain">
        SELECT
        BSY.DJXH djxh,
        BSY.SHXYDM shxydm,
        BSY.BSRXM bsrxm,
        BSY.BSRSJHM bsrsjhm,
        BSY.BSRLX bsrlx,
        BSY.NSRSBH nsrsbh
        FROM TM.QYH_SZ_SWJG_QY DW,TM.SMZ_BSY_SJTB BSY
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = BSY.SWJG_DM
        AND BSY.YXBZ = 'Y'
        AND BSY.QYH_TBBZ = 'N'
    </select>

    <select id="querySednMessListSstx" resultClass="com.hst.taxService.domain.dd.DdoutSendMessData">

        SELECT NSR.YWXH bzNo,
        DW.SWJG_DM zgswjDm,
        NVL((SELECT DM.SSTXDY_MC FROM SSGLADMIN.SSTX_WH_SSTXDY DM WHERE DM.SSTXDY_DM = TX.SSTX_YWFLBM),'') xxbt,
        TX.NR xxzy,
        TX.NR xxnr,
        '12' xxlb,
        NULL tsjssj,
        '0' csbj,
        NVL(DW.SWJG_JC,'') xxzz,
        DJ.NSRSBH nsrsbh,
        DJ.SHXYDM shxydm,
        DJ.NSRMC nsrmc,
        '1,2,3' rylxDm
        FROM TM.QYH_SZ_SWJG_QY DW,TM.FWH_WDSX_SSTX TX,TM.FWH_WDSX_SSTX_NSR NSR,HX_DJ.DJ_NSRXX DJ
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = TX.SWJG_DM
        AND TX.YXBZ = 'Y'
        AND TX.SSTX_XH = NSR.SSTX_XH
        AND NSR.QYH_TBBZ = 'N'
        AND DJ.DJXH = NSR.DJXH
        and DJ.djxh in (  SELECT DJ.DJXH FROM  TM.QYH_SZ_SWJG_QY DW,TM.SMZ_BSY_NSR_SJTB NSR,HX_DJ.DJ_NSRXX DJ
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = NSR.SWJG_DM
        AND (NSR.YXBZ = 'Y' OR (NSR.YXBZ = 'N' AND NSR.QYH_TBBZ = 'U'))
        AND NSR.DJXH = DJ.DJXH)   AND DJ.DJXH ='10113301000046367071'
    </select>
    <select id="querySednMessListTzgg" resultClass="com.hst.taxService.domain.dd.DdoutSendMessData">

        SELECT NSR.YWXH bzNo,
        DW.SWJG_DM zgswjDm,
        TZ.BT xxbt,
        SUBSTR(TZ.NR,0,150) xxzy,
        TZ.NR xxnr,
        '11' xxlb,
        TO_CHAR(TZ.FSSJ,'YYYY-MM-DD hh24:mi:ss') tsjssj,
        '0' csbj,
        (SELECT DM.CZRY_MC FROM SSGLADMIN.YYS_DM_USER_BCXX DM WHERE DM.CZRY_DM = TZ.FSR_DM) xxzz,
        DJ.NSRSBH nsrsbh,
        DJ.SHXYDM shxydm,
        DJ.NSRMC nsrmc,
        '1,2,3' rylxDm
        FROM TM.QYH_SZ_SWJG_QY DW,TM.FWH_WDSX_TZGG TZ,TM.FWH_WDSX_TZGG_NSR NSR,HX_DJ.DJ_NSRXX DJ
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = TZ.SWJG_DM
        AND TZ.YXBZ = 'Y'
        AND TZ.TZGG_XH = NSR.TZGG_XH
        AND NSR.QYH_TBBZ = 'N'
        AND DJ.DJXH = NSR.DJXH
        AND DJ.DJXH ='10113301000046367071'
    </select>
    <select id="queryMessDelListSsxs" resultClass="com.hst.taxService.domain.dd.DdoutSendMessDelAppDomain">

        SELECT NSR.YWXH bzNo,
        DW.SWJG_DM zgswjDm,
        NULL yy
        FROM TM.QYH_SZ_SWJG_QY DW,TM.FWH_WDSX_SSTX TX,TM.FWH_WDSX_SSTX_NSR NSR
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = TX.SWJG_DM

        AND TX.SSTX_XH = NSR.SSTX_XH
        AND NSR.QYH_TBBZ = 'N'

        UNION
        SELECT NSR.YWXH bzNo,
        DW.SWJG_DM zgswjDm,
        NULL yy
        FROM TM.QYH_SZ_SWJG_QY DW,TM.FWH_WDSX_TZGG TZ,TM.FWH_WDSX_TZGG_NSR NSR
        WHERE DW.QYBZ = 'Y'
        AND DW.DD_QYBZ = 'Y'
        AND DW.SWJG_DM = TZ.SWJG_DM

        AND TZ.TZGG_XH = NSR.TZGG_XH
        AND NSR.QYH_TBBZ = 'N'

    </select>


</sqlMap>