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

	<select id="selectDjNsrxxJyxxByNsrsbh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgDjNsrjyxxDomain">
		select  A.DJXH djxh,
				A.NSRMC nsrmc,
				A.NSRZT_DM nsrztDm,
				A.KZZTDJLX_DM kzztdjlxDm,
				A.DJZCLX_DM djzclxDm,
				A.ZGSWSKFJ_DM zgswskfjDm,
				A.ZGSWJ_DM zgswjDm,
				A.SSGLY_DM ssglyDm
		FROM  HX_DJ.DJ_NSRXX A
	 WHERE A.YXBZ='Y' 
	    AND (A.NSRSBH = #nsrsbh# or A.SHXYDM = #nsrsbh# )
	    AND A.KZZTDJLX_DM IN ('1110','1120','1131','1134','1135') 
	    AND A.KQCCSZTDJBZ='N'
	 ORDER BY A.ZGSWSKFJ_DM
	</select>
	
	<select id="selectDjNsrxxQtxxByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgDjCxNsrdjxxResponseDomain">
		SELECT DECODE(A.KZZTDJLX_DM,'1110','1','1120','2','2') NSRLX,
			(SELECT B.SWRYXM FROM HX_DM_ZDY.DM_GY_SWRY B WHERE B.SWRY_DM= A.SSGLY_DM AND B.YXBZ='Y') ZGSWRY_MC,
			(SELECT B.SWRYXM FROM HX_DM_ZDY.DM_GY_SWRY B WHERE B.SWRY_DM= A.LRR_DM AND B.YXBZ='Y') LRR_MC,
			(SELECT B.SWRYXM FROM HX_DM_ZDY.DM_GY_SWRY B WHERE B.SWRY_DM= A.XGR_DM AND B.YXBZ='Y') XGR_MC
		 FROM HX_DJ.DJ_NSRXX A 
	   WHERE DJXH = #djxh#
	</select>
	
	<select id="selectDjNsrxxQtxx2ByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgDjCxNsrdjxxResponseDomain">
	  SELECT 
		CASE WHEN SUM(CASE WHEN B.TKFS_DM='1' OR B.TKFS_DM IS NULL THEN 1 ELSE 0 END)>0 THEN 'Y' ELSE 'N' END CPHM,
		CASE WHEN SUM(CASE WHEN B.TKFS_DM='2' THEN 1 ELSE 0 END)>0 THEN 'Y' ELSE 'N' END SGPBZ
	  FROM HX_FP.FP_PZHDXX A,HX_DM_QG.DM_FP_FPZL B 
	 WHERE B.YXBZ='Y' AND B.XYBZ='Y'
		 <![CDATA[
			AND A.YXQQ<=TRUNC(SYSDATE) AND A.YXQZ>=TRUNC(SYSDATE)
		]]>
		AND A.YXBZ='Y'
		AND A.FPZL_DM = B.FPZL_DM
		AND A.DJXH = #djxh#
	</select>
	
	<select id="selectNsrDqDexxByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HXZGZS_HD_DQDEHD_JGDomain">
	select  hdjguuid,
			djxh,
			DEXM_DM dexmDm,
			HY_DM hyDm,
			to_char(HDZXQQ,'yyyy-MM-dd') hdzsqq,
			to_char(HDZXQZ,'yyyy-MM-dd') hdzsqz,
			to_char(sjzxqz,'yyyy-MM-dd')sjzxqz,
			ZSXM_DM zsxmDm,
			ZSPM_DM zspmDm,
			ynsjye,
			SL_1 sl1,
			hdse,
			ZGSWSKFJ_DM zgswskfjDm,
			ynse,
			wdqzdbz,
			JYXM_DM jyxmDm,
			JSBZ_1 jsbz1,
			yssdl,
			jsyj,
			ywpzuuid,
			zxhdbz,
			lcslid,
			ZFBZ_1 zfbz1,
			to_char(lrrq,'yyyy-MM-dd HH:mm:ss') lrrq,
			to_char(ZFRQ_1,'yyyy-MM-dd HH:mm:ss') zfrq,
			ZFR_DM zfrDm,
			LRR_DM lrrDm,
			to_char(xgrq,'yyyy-MM-dd HH:mm:ss') xgrq,
			XGR_DM xgrDm,
			sjgsdq,
			sskcs
	 from HX_ZS.ZS_HD_DQDEHD_JG
  	where DJXH = #djxh#
	</select>
	<!--  
	<select id="selectNsrDkfpYjxxHwlwByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.dsyyqh.gt3.HxzgZsCxnNsrdkfpyjxxDomain">
		SELECT SUM(ROUND(JSYJ * (1 + SL_1),2)) kpjeDkfpHwlw,SUM(ybtse) seDkfpHwlw 
		FROM HX_ZS.ZS_YJSF A 
		WHERE DJXH = #djxh#
		AND YZPZZL_DM='BDA0710034'
		<![CDATA[
		AND SKSSQQ>= to_date(#sssqq#,'YYYY-MM-DD')
		AND SKSSQZ<= to_date(#sssqz#,'YYYY-MM-DD')
		]]>
		AND TZLX_DM='1' 
		AND ZSXM_DM='10101'
		AND SKSX_DM='0204'
		AND SKZL_DM='10'
		AND YZCLRQ IS NOT NULL AND SKCLLX_DM='1'
		AND A.ZSPM_DM NOT IN(select ZSPM_DM from HX_DM_QG.DM_GY_ZSPM t WHERE T.SFYGZZSPMBZ='Y' OR T.SF2016YGZBZ='Y')
	</select>
	
	<select id="selectNsrDkfpYjxxYsfwByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.dsyyqh.gt3.HxzgZsCxnNsrdkfpyjxxDomain">
		SELECT SUM(ROUND(JSYJ * (1 + SL_1),2)) kpjeDkfpYsfw,SUM(ybtse) seDkfpYsfw 
		FROM HX_ZS.ZS_YJSF A 
		WHERE DJXH = #djxh#
		AND YZPZZL_DM='BDA0710034'
		<![CDATA[
		AND SKSSQQ>= to_date(#sssqq#,'YYYY-MM-DD')
		AND SKSSQZ<= to_date(#sssqz#,'YYYY-MM-DD')
		]]>
		AND TZLX_DM='1' 
		AND ZSXM_DM='10101'
		AND SKSX_DM='0204'
		AND SKZL_DM='10'
		AND YZCLRQ IS NOT NULL AND SKCLLX_DM='1'
		AND A.ZSPM_DM IN(select ZSPM_DM from HX_DM_QG.DM_GY_ZSPM t WHERE T.SFYGZZSPMBZ='Y' OR T.SF2016YGZBZ='Y')
	</select>
	-->
	<!-- 剔除征收品目 ZSPM_DM = 101017700 不动产 -->
	<select id="selectNsrDkfpYjxxHwlwByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxnNsrdkfpyjxxDomain">
		SELECT NVL(ROUND(SUM(MX.JSFYJ* (1 + MX.SFL)),2),0) kpjeDkfpHwlw,NVL(SUM(MX.YNSFE),0) seDkfpHwlw 
    		FROM HX_FP.FP_DK_FPKJXX FP,HX_FP.FP_DK_SFMX MX,HX_DM_QG.DM_GY_ZSPM PM
		WHERE FP.DJXH = #djxh#
		<![CDATA[
		AND FP.KJRQ >= to_date(#sssqq#,'YYYY-MM-DD')
		AND FP.KJRQ < to_date(#sssqz#,'YYYY-MM-DD') + 1
		]]>
		 AND FP.ZFBZ_1 = 'N'
	     AND FP.DKSQUUID = MX.DKSQUUID
	     AND MX.ZSXM_DM = '10101'
	     AND MX.ZFBZ_1 = 'N'
	     AND MX.ZSPM_DM = PM.ZSPM_DM
	     AND PM.ZSXM_DM = '10101'
	     <![CDATA[
	     AND MX.ZSPM_DM <> '101017700'
	     ]]>
	     AND (PM.SFYGZZSPMBZ IS NULL OR PM.SFYGZZSPMBZ = 'N')
	     AND (PM.SF2016YGZBZ IS NULL OR PM.SF2016YGZBZ = 'N')
		 AND MX.GLDKSQUUID IS NULL
	</select>
	<!-- 剔除征收品目 ZSPM_DM = 101017700 不动产 -->
	<select id="selectNsrDkfpYjxxYsfwByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxnNsrdkfpyjxxDomain">
		SELECT NVL(ROUND(SUM(MX.JSFYJ* (1 + MX.SFL)),2),0) kpjeDkfpYsfw,NVL(SUM(MX.YNSFE),0) seDkfpYsfw  
		FROM HX_FP.FP_DK_FPKJXX FP,HX_FP.FP_DK_SFMX MX,HX_DM_QG.DM_GY_ZSPM PM
   		WHERE FP.DJXH = #djxh#
		<![CDATA[
		AND FP.KJRQ >= to_date(#sssqq#,'YYYY-MM-DD')
		AND FP.KJRQ < to_date(#sssqz#,'YYYY-MM-DD') + 1
		]]>
		 AND FP.ZFBZ_1 = 'N'
	     AND FP.DKSQUUID = MX.DKSQUUID
	     AND MX.ZSXM_DM = '10101'
	     AND MX.ZFBZ_1 = 'N'
	     AND MX.ZSPM_DM = PM.ZSPM_DM
	     <![CDATA[
	     AND MX.ZSPM_DM <> '101017700'
	     ]]>
	     AND (PM.SFYGZZSPMBZ = 'Y' OR PM.SF2016YGZBZ = 'Y')
	     AND MX.GLDKSQUUID IS NULL
	</select>
	
	<select id="selectRjtsshBysByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxRjtsshDomain">
		SELECT NVL(SUM(CASE WHEN EWBLXH = 1 THEN A.ASYSLJSXSE ELSE 0 END),0) asysljsxse_yb ,
		       NVL(SUM(CASE WHEN EWBLXH = 3 THEN A.ASYSLJSXSE ELSE 0 END),0) asysljsxse_jzjt,
		       NVL(SUM(CASE WHEN EWBLXH = 3 THEN A.XXSE ELSE 0 END),0) xxse_jzjt,
		       NVL(SUM(CASE WHEN EWBLXH = 3 THEN A.JXSE ELSE 0 END),0) jxse_jzjt,
		       NVL(SUM(CASE WHEN EWBLXH = 3 THEN A.YNSEHJ ELSE 0 END),0) ynsehj_jzjt
		          FROM HX_SB.SB_ZZS_YBNSR A
		         WHERE A.SBUUID = 
		           (SELECT SBUUID FROM (
               		SELECT SBUUID,ROW_NUMBER() OVER(PARTITION BY DJXH ORDER BY LRRQ DESC) RN FROM HX_SB.SB_SBXX 
               		WHERE DJXH = #djxh#
               		AND YZPZZL_DM='BDA0610606' 
               		AND SKSSQQ=TO_DATE(#sssqq#,'YYYY-MM-DD') 
               		AND SKSSQZ=TO_DATE(#sssqz#,'YYYY-MM-DD')
               		AND ZFBZ_1='N'
               	    ) WHERE RN=1)
		         AND A.EWBLXH IN (1,3)
	</select>
	
	<select id="selectRjtsshBnljsByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxRjtsshDomain">
		SELECT NVL(A.ASYSLJSXSE,0) asysljsxse_jzjt_bnlj,
		       NVL(A.YNSEHJ,0) ynsehj_jzjt_bnlj
		          FROM HX_SB.SB_ZZS_YBNSR A
		         WHERE A.SBUUID = 
		           (SELECT SBUUID FROM 
		           (SELECT SBUUID,ROW_NUMBER() OVER(PARTITION BY DJXH ORDER BY SKSSQQ DESC,LRRQ DESC) RN
		           FROM HX_SB.SB_SBXX
		           WHERE DJXH = #djxh#
		           AND YZPZZL_DM = 'BDA0610606'
		         <![CDATA[
		           AND SKSSQQ >= TRUNC(TO_DATE(#sssqq#,'YYYY-MM-DD') , 'YEAR')
		           AND SKSSQQ <= TO_DATE(#sssqz#,'YYYY-MM-DD') 
		         ]]>
		           AND ZFBZ_1='N')
		            WHERE RN=1)
		         AND A.EWBLXH = 4
	</select>
	
	<select id="selectRjtsshRkseByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxRjtsshDomain">
		SELECT NVL(SUM(A.YBTSE), 0) rkse_jzjt
		  FROM HX_ZS.ZS_YJSF A
		 WHERE A.ZSXM_DM = '10101'
		   AND SKSSQQ = TO_DATE(#sssqq#, 'YYYY-MM-DD')
		   AND SKSSQZ = TO_DATE(#sssqz#, 'YYYY-MM-DD')
		   AND A.ZSPM_DM='101015000'
		   AND RKRQ IS NOT NULL
		   AND DJXH = #djxh#
		   AND A.YBTSE =
		       (SELECT BQYBTSE
		          FROM HX_SB.SB_ZZS_YBNSR
		         WHERE SBUUID =
		             (SELECT SBUUID FROM 
		               (SELECT SBUUID,ROW_NUMBER() OVER(PARTITION BY DJXH ORDER BY LRRQ DESC) RN
		                  FROM HX_SB.SB_SBB
		                 WHERE DJXH = #djxh#
		                   AND YZPZZL_DM = 'BDA0610606'
		                   AND SKSSQQ = TO_DATE(#sssqq#, 'YYYY-MM-DD')
		                   AND SKSSQZ = TO_DATE(#sssqz#, 'YYYY-MM-DD')) WHERE RN=1)
		           AND EWBLXH = '3')
	</select>
	
	<select id="selectRjtsshLjtseByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxRjtsshDomain">
		SELECT SUM(SE) tsse_bnlj FROM HX_ZS.ZS_SRTHS WHERE DJXH = #djxh#
		<![CDATA[
			AND SKSSQQ>=TRUNC(TO_DATE(#sssqq#,'YYYY-MM-DD'),'YEAR' )
			AND SKSSQZ<=TO_DATE(#sssqz#,'YYYY-MM-DD')
		]]>
			AND TTSJLX_DM='05'
	</select>
	
	<select id="selectRjtsshQseByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZsCxRjtsshDomain">
		SELECT SUM(A.YBTSE) qsye FROM HX_ZS.ZS_YJSF A WHERE A.DJXH = #djxh#
			AND A.RKRQ IS NULL
   			AND A.SKCLLX_DM = '0'
   			AND SKZL_DM = '10'
	</select>
	
	<select id="selectHxzgPzPzzlList"  parameterClass="java.util.Map" resultClass="com.hst.business.domain.DmbGgDomain">
		select  A.PZZL_DM dm,
				A.PZZLMC mc
		FROM  HX_DM_QG.DM_PZ_PZZL A
	  WHERE A.YXBZ = 'Y' 
	    AND A.XYBZ = 'Y'
	</select>
	
	<select id="selectHxzgPzPzzgList"  parameterClass="java.util.Map" resultClass="com.hst.business.domain.DmbGgDomain">
		select  A.PZZL_DM || PZZG_DM dm,
				A.PZZG mc
		FROM  HX_CS_ZDY.CS_PZ_PZZGB A
	</select>
	
	<select id="selectWbnsrjydbydjBynsrsbh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgDjWbnsrjydbydjxxDomain">
		SELECT BYDJUUID bydjuuid,
		       WCJYZMUUID wcjyzmuuid,
		       A.DJXH djxh,
		       LCSLID lcslid,
		       WCJYHDSSGLZMBH wcjyhdssglzmbh,
		       SWDJD swdjd,
		       WCJYD wcjyd,
		       WCJYHTZJE wcjyhtzje,
		       SWDJDSWJGYJ swdjdswjgyj,
		       WCJYDSWJGYJ wcjydswjgyj,
		       WCJYHDSSGLZMYXQXQ wcjyhdssglzmyxqxq,
		       WCJYHDSSGLZMYXQXZ wcjyhdssglzmyxqxz,
		       WCJYHDSSGLZMQFRQ wcjyhdssglzmqfrq,
		       BSRXM bsrxm,
		       LXDH lxdh,
		       TO_CHAR(SQRQ,'yyyy-MM-dd HH:mm:ss') sqrq,
		       TO_CHAR(BYSJ,'yyyy-MM-dd HH:mm:ss') bysj,
		       SBLCSLID sblcslid,
		       YWCJYHDSSGLZMBH ywcjyhdssglzmbh,
		       A.LRR_DM lrrDm,
		       TO_CHAR(A.LRRQ,'yyyy-MM-dd HH:mm:ss') lrrq,
		       A.XGR_DM xgrDm,
		       TO_CHAR(A.XGRQ,'yyyy-MM-dd HH:mm:ss') xgrq,
		       A.SJGSDQ sjgsdq,
		       JYFSDMJH jyfsdmjh,
		       SCJYDSWJGMC scjydswjgmc,
		       SCJYDSWJGLXDH scjydswjglxdh,
		       JGSZDQYSDSZSFS_DM jgszdqysdszsfsDm,
		       JGSZDQYSDSHSJGMC jgszdqysdshsjgmc,
		       JGSZDQYSDSHSJG_DM jgszdqysdshsjgDm,
		       ZFBZ_1 zfbz,
		       TO_CHAR(ZFRQ_1,'yyyy-MM-dd HH:mm:ss') zfrq,
		       ZFR_DM zfrDm,
		       A.YXBZ yxbz
		  FROM HX_DJ.DJ_WBNSRJYDBYDJ A, HX_DJ.DJ_NSRXX B
		 WHERE A.DJXH = B.DJXH
		   AND B.NSRSBH= #nsrsbh#
		   AND A.SJGSDQ LIKE #swjgLike#
		   <![CDATA[
			AND A.BYSJ >= TO_DATE(#byrqq#,'YYYY-MM-DD')
			AND A.BYSJ < TO_DATE(#byrqz#,'YYYY-MM-DD') + 1
		  ]]>
		   <dynamic> 
			<isNotEmpty property="wjzbh" prepend="and">
				A.WCJYHDSSGLZMBH LIKE #wjzbh#
			</isNotEmpty>
		  </dynamic>
	</select>
	
	<select id="selectSwjgLikeBySwjgDm"  parameterClass="java.util.Map" resultClass="java.lang.String">
		SELECT DECODE(JGJC_DM,
              '11',
              SUBSTR(SWJG_DM, 1, 3)||'%',
              '31',
              SUBSTR(SWJG_DM, 1, 5)||'%',
              '41',
              SUBSTR(SWJG_DM, 1, 7)||'%',
              '51',
              SUBSTR(SWJG_DM, 1, 9)||'%')
		  FROM HX_DM_ZDY.DM_GY_SWJG A
		 WHERE SWJG_DM = #swjgDm#
		   AND A.YXBZ = 'Y'
		   AND A.XYBZ = 'Y'
	</select>
	
	<select id="selectHxzgDmZsxmList"  parameterClass="java.util.Map" resultClass="com.hst.business.domain.DmbGgDomain">
		select  A.ZSXM_DM dm,
				A.ZSXMMC mc
		FROM  HX_DM_QG.DM_GY_ZSXM A
	  WHERE A.YXBZ = 'Y' 
	    AND A.XYBZ = 'Y'
	</select>
	
	<select id="selectHxzgDmZspmList"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.DmZspmDomain">
		select  A.ZSXM_DM zsxmDm,
				A.ZSPM_DM zspmDm,
				A.ZSPMMC zspmMc,
				A.SL_1 sl,
				A.ZSL zsl,
				A.SLJSFS_DM sljsfsDm,
				A.SFYGZZSPMBZ sfygzzspmbz,
				A.SF2016YGZBZ sf2016ygzbz
		FROM  HX_DM_QG.DM_GY_ZSPM A
	  WHERE A.YXBZ = 'Y' 
	    AND A.XYBZ = 'Y'
	</select>
	
	<select id="selectDkfpTdzsbmDjxhBySwryDm"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgFpCxTdzsbmDjxhDomain">
		SELECT A.DJXH djxh,A.NSRSBH nsrsbh FROM HX_FP.FP_DKFP_TDZSBM A WHERE A.SWRY_DM = #swryDm#
	</select>
	
	<select id="queyrHxzgPzSwrySpjcBySwryDm"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgPzSwrySpjcDomain">
		SELECT JC.PZQSHM pzqshm,
		       JC.PZZZHM pzzzhm,
		       TO_NUMBER(JC.PZZZHM) - TO_NUMBER(JC.PZQSHM) + 1 jcsl,
		       JC.PZZG_DM pzzgDm,
		       (SELECT ZG.PZZG FROM HX_CS_ZDY.CS_PZ_PZZGB ZG WHERE ZG.PZZL_DM = JC.PZZL_DM AND ZG.PZZG_DM = JC.PZZG_DM) pzzgmc,
		       JC.PZZL_DM pzzlDm,
		       (SELECT ZL.PZZLMC FROM HX_DM_QG.DM_PZ_PZZL ZL WHERE ZL.PZZL_DM = JC.PZZL_DM) pzzlmc,
		       JC.FFYXJ ffyxj,
		       JC.PZHSJG_DM pzhsjgDm,
		       JC.PZJCUUID pzjcuuid,
		       TO_CHAR(JC.RKRQ,'YYYY-MM-DD') rkrq,
		       JC.YPRLX_DM yprlxdm,
		       RY.SWRY_DM swrydm,
		       RY.SWRYXM swrymc
		  FROM HX_PZ.PZ_JC JC,HX_DM_ZDY.DM_GY_SWRY RY,HX_PZ.PZ_YPR YPR
		 WHERE RY.SWRY_DM IN ($swryDm$)  
		   AND RY.YXBZ = 'Y'
		   AND RY.SWRY_DM = YPR.SWRY_DM
		   AND YPR.YXBZ = 'Y'
		   AND YPR.YPRLX_DM = '12'
		   AND YPR.YPRUUID = JC.CZYUUID
		   AND JC.YPRLX_DM = '12'
		   AND JC.PZZT_DM = '01'
		   AND JC.YXBZ = 'Y'
	    <dynamic> 
			<isNotEmpty property="pzzlDm" prepend="and">
				JC.PZZL_DM = #pzzlDm#
			</isNotEmpty>
		</dynamic>
	</select>
	
	<select id="queryGsywDjzrrByDjxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgZrrDjExistsDomain">
		SELECT DJ.SFZJLX_DM sfzjlxDm,DJ.SFZJHM sfzjhm,DJ.XM xm,JN.GJHDQSZ_DM gjDm,DJ.NSRSBH nsrsbh
			FROM HX_ZGXT.DJ_ZRR DJ,HX_ZGXT.DJ_ZRR_JN JN
		WHERE DJ.YXBZ = 'Y'
			AND DJ.DJXH = JN.DJXH(+)
			AND DJ.DJXH = #djxh#
	</select>
	
	<select id="selectHxsbSbbByYzpzxh"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgSbSbZfRequestDomain">
		SELECT A.DJXH djxh,A.PZXH pzxh,A.YZPZZL_DM yzpzzlDm,TO_CHAR(A.SKSSQQ,'YYYY-MM-DD') skssqq,TO_CHAR(A.SKSSQZ,'YYYY-MM-DD') skssqz,'10101' zsxmDm,A.SJGSDQ sjgsdq,TO_CHAR(A.SBRQ_1,'YYYY-MM-DD') sbrq,A.SBUUID sbuuid,A.YBTSE ybtse
		  FROM HX_SB.SB_SBB A 
		 WHERE A.PZXH = #yzpzxh#
		   AND A.ZFBZ_1 = 'N'
	</select>
	
	<select id="queryZrrDkfpqkBySfzjhm"  parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.HxzgFpCxZrrDkfpResponseDomain">
		SELECT COUNT(*) ydljcs,SUM(B.KPJE) ydljje,
	       SUM(CASE WHEN TRUNC(B.KJRQ) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) dayljcs,
	       SUM(CASE WHEN TRUNC(B.KJRQ) = TRUNC(SYSDATE) THEN B.KPJE ELSE 0 END) dayljje
	  FROM GS_CX.DJ_ZRR A,HX_FP.FP_DK_FPKJXX B
	 WHERE A.SFZJHM = #sfzjhm#
	   AND A.DJXH = B.DJXH
	   <![CDATA[
	   AND B.KJRQ >= TRUNC(SYSDATE,'MONTH')
	   AND B.KJRQ <  ADD_MONTHS(TRUNC(SYSDATE,'MONTH'),1)
	   ]]>
	   AND B.ZFBZ_1 = 'N'
	   AND A.YXBZ = 'Y'

	</select>
    
</sqlMap>