<?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.BusDzswjAppMapper">

    <delete id="deleteDzswjMfpsmd" parameterClass="com.hst.taxService.domain.zjzk.ZjzkYzpsMdwhDomain">
	 DELETE  FROM  web_ptfp_qy.dzswj_mfpsmd A WHERE A.DJXH = #DJXH#
    </delete>
    <insert id="insertDzswjMfpsmd" parameterClass="com.hst.taxService.domain.zjzk.ZjzkYzpsMdwhDomain">
      INSERT  INTO web_ptfp_qy.dzswj_mfpsmd(DJXH,LRRQ)
      VALUES (#DJXH#,SYSDATE)
    </insert>

    <select id="selectYzpsCxSlxxFpdk" resultClass="com.hst.taxService.domain.zjzk.ZjzkYzpsCxslxxDomain" parameterClass="java.util.Map">

        SELECT A.UUIDXH YWID,
        A.NSRSBH NSRSBH,
        A.NSRMC NSRMC,
        A.YJRXM SJR_XM,
        A.YJRDZ SJR_DZ,
        A.YJYB  SJR_YB,
        A.YJSJHM SJR_SJHM,
        NULL SJR_DHHM,
        A.YJSFZHM SJR_SFZH,
        A.BZ SJR_BZ,
        A.YJHM YJHM,
        A.FPDM FPDM,
        A.FPHM FPHM,
        TO_CHAR(A.KPRQ,'YYYY-MM-DD HH24:MI:SS') KPRQ,
        A.HJ JE,
        NULL SQRQ,
        NULL SLR,
        NULL SLRQ,
        NULL SQDH,
        DECODE(A.QZ,'1','Y','N') MFBZ
        FROM WEB_PTFP_QY.FP_DK_SQB A
        WHERE A.DJXH =  #DJXH#

        <![CDATA[
        AND A.KPRQ >= TO_DATE(#RQ_Q#,'YYYY-MM-DD')
        AND A.KPRQ <  TO_DATE(#RQ_Z#,'YYYY-MM-DD') + 1
        AND A.FPHM IS NOT NULL
        ORDER BY A.KPRQ DESC








        ]]>

    </select>


    <select id="selectYzpsCxSlxxFplg" resultClass="com.hst.taxService.domain.zjzk.ZjzkYzpsCxslxxDomain" parameterClass="java.util.Map">

     SELECT A.LGDH YWID,
       A.NSRSBH NSRSBH,
       A.NSRMC NSRMC,
       A.SJRMC SJR_XM,
       A.SJDZ SJR_DZ,
       A.YB SJR_YB,
       A.SJHM SJR_SJHM,
       A.LXDH SJR_DHHM,
       A.SFZHM SJR_SFZH,
       A.BZ SJR_BZ,
       A.YJHM YJHM,
       NULL FPDM,
       NULL FPHM,
       NULL KPRQ,
       NULL JE,
       TO_CHAR(A.SQRQ,'YYYY-MM-DD HH24:MI:SS') SQRQ,
       A.SLRDM SLR,
        TO_CHAR(A.SLRQ,'YYYY-MM-DD HH24:MI:SS') SLRQ,

       NULL SQDH,
       DECODE(A.MFPSBZ,'1','Y','N') MFBZ
  FROM WEB_PTFP_QY.WSGP_GPSQ A
        WHERE A.DJXH =  #DJXH#

        <![CDATA[
        AND A.SLRQ  >= TO_DATE(#RQ_Q#,'YYYY-MM-DD')
        AND A.SLRQ  <  TO_DATE(#RQ_Z#,'YYYY-MM-DD') + 1
          AND A.LQFS = '2'
        ORDER BY A.SLRQ DESC
        ]]>

    </select>
</sqlMap>