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


    <select id="querySwdjbDmBYnsrsbhXshs" parameterClass="java.util.Map" resultClass="java.lang.String">
			SELECT SWDJLB_DM FROM XSHS_NSR_DJXX WHERE NSRSBH = #nsrsbh#
	</select>


    <resultMap class="com.hst.taxService.domain.wxfwh.WghNsrKpxxcxDomain" id="pXshsWsjk378JkjzKpjeseResMap">
        <result property="KPJE_HJ" column="KPJE_HJ"/>
        <result property="KPJE_ZXKP" column="KPJE_ZXKP"/>
        <result property="KPJE_XSHS" column="KPJE_XSHS"/>
        <result property="KPJE_SGP" column="KPJE_SGP"/>
        <result property="SE_HJ" column="SE_HJ"/>
        <result property="SE_JKJZ" column="SE_JKJZ"/>
        <result property="QZD" column="QZD"/>
        <result property="DE" column="DE"/>
        <result property="GS_SKJSFS" column="GS_SKJSFS"/>
        <result property="DS_SKJSFS" column="DS_SKJSFS"/>
        <result property="GTHY_DM" column="GTHY_DM"/>
        <result property="BZ1" column="BZ1"/>
        <result property="BZ2" column="BZ2"/>
        <result property="BZ3" column="BZ3"/>
        <result property="BZ4" column="BZ4"/>
        <result property="BZ5" column="BZ5"/>
        <result property="BZ6" column="BZ6"/>
        <result property="SSSQ_Q" column="SSSQ_Q"/>
        <result property="SSSQ_Z" column="SSSQ_Z"/>
        <result property="HWLWFWBZ" column="HWLWFWBZ"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pXshsWsjk378JkjzKpjeseMap">
        <parameter property="NSRSBH" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="GDSLB" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="FPKJLX_DM" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dataList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pXshsWsjk378JkjzKpjeseResMap"/>
    </parameterMap>

    <procedure id="pXshsWsjk378JkjzKpjese" parameterMap="pXshsWsjk378JkjzKpjeseMap">
        {call P_XSHS_WSJK_378_GT3_JKJZKPJESE(?,?,?,?)}
    </procedure>

    <select id="pWebjk6831FieldList" resultClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxDomain">
        SELECT COLUMN_NAME FIELD , COMMENTS FIELD_NAME
  FROM USER_COL_COMMENTS a
 WHERE TABLE_NAME = 'WGH_XXBD_NSRXX_FIELD'
    </select>
    <select id="pWebjk6831Gsxx" resultClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxXxDomain" parameterClass="java.util.Map">
  SELECT A.ZZJG_DM,
       A.DJXH,
       (SELECT KZZTDJLXMC FROM HX_DM_QG.DM_DJ_KZZTDJLX DM WHERE DM.KZZTDJLX_DM = A.KZZTDJLX_DM) KZZTDJLX_DM,
       A.SSDABH,
       A.NSRSBH,
       A.NSRMC,
       (SELECT NSRZTMC FROM HX_DM_QG.DM_GY_NSRZT DM WHERE DM.NSRZT_DM = A.NSRZT_DM) NSRZT_DM,
       (SELECT DJZCLXMC FROM HX_DM_QG.DM_DJ_DJZCLX DM WHERE DM.DJZCLX_DM = A.DJZCLX_DM) DJZCLX_DM,
       (SELECT HYMC FROM HX_DM_QG.DM_GY_HY DM WHERE DM.HY_DM = A.HY_DM) HY_DM,
       (SELECT JDXZMC FROM HX_DM_ZDY.DM_GY_JDXZ DM WHERE DM.JDXZ_DM = A.JDXZ_DM) JDXZ_DM,
       A.DJRQ,
       A.SCJYDZ,
       A.SCJYDLXDH,
       A.ZCDZ,
       A.ZCDLXDH,
       (SELECT SWJG_JC FROM CTAIS2.DM_SWJG WHERE SWJG_DM = A.ZGSWJ_DM) ZGSWJ_DM,
       (SELECT SWJG_JC FROM CTAIS2.DM_SWJG WHERE SWJG_DM = A.ZGSWSKFJ_DM) ZGSWSKFJ_DM,
       (SELECT CZRY_DM FROM CTAIS2.DM_CZRY WHERE CZRY_DM = A.SSGLY_DM) SSGLY_DM,
       (SELECT HSFSMC FROM HX_DM_QG.DM_GY_HSFS DM WHERE DM.HSFS_DM = A.HSFS_DM) HSFS_DM,
       A.CYRS,
       A.ZCZB,
       A.FDDBRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.FDDBRSFZJLX_DM) FDDBRSFZJLX_DM,
       A.FDDBRSFZJHM,
       A.FDDBRYDDH,
       A.FDDBRGDDH,
       A.CWFZRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.CWFZRSFZJZL_DM) CWFZRSFZJZL_DM,
       A.CWFZRSFZJHM,
       A.CWFZRGDDH,
       A.CWFZRYDDH,
       A.BSRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.BSRSFZJZL_DM) BSRSFZJZL_DM,
       A.BSRSFZJHM,
       A.BSRGDDH,
       A.BSRYDDH,
       (SELECT ZFJGLXMC FROM HX_DM_QG.DM_DJ_ZFJGLX DM WHERE DM.ZFJGLX_DM = A.ZFJGLX_DM) ZFJGLX_DM,
      A.KQCCSZTDJBZ,
      A.QYSDSDJBZ
  FROM WGH_XXBD_NSRXX_GS A
 WHERE A.NSRSBH =#nsrsbh#
    </select>
    <select id="pWebjk6831Dsxx" resultClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxXxDomain" parameterClass="java.util.Map">
      SELECT A.ZZJG_DM,
       A.DJXH,
       (SELECT KZZTDJLXMC FROM HX_DM_QG.DM_DJ_KZZTDJLX DM WHERE DM.KZZTDJLX_DM = A.KZZTDJLX_DM) KZZTDJLX_DM,
       A.SSDABH,
       A.NSRSBH,
       A.NSRMC,
       (SELECT NSRZTMC FROM HX_DM_QG.DM_GY_NSRZT DM WHERE DM.NSRZT_DM = A.NSRZT_DM) NSRZT_DM,
       (SELECT DJZCLXMC FROM HX_DM_QG.DM_DJ_DJZCLX DM WHERE DM.DJZCLX_DM = A.DJZCLX_DM) DJZCLX_DM,
       (SELECT HYMC FROM HX_DM_QG.DM_GY_HY DM WHERE DM.HY_DM = A.HY_DM) HY_DM,
      A.JDXZ_DM,
       A.DJRQ,
       A.SCJYDZ,
       A.SCJYDLXDH,
       A.ZCDZ,
       A.ZCDLXDH,
       (SELECT SWJGJC FROM TFD.DM_GY_SWJG WHERE SWJG_DM = A.ZGSWJ_DM) ZGSWJ_DM,
       (SELECT SWJGJC FROM TFD.DM_GY_SWJG WHERE SWJG_DM = A.ZGSWSKFJ_DM) ZGSWSKFJ_DM,
       (SELECT CZRY_DM FROM CTAIS2.DM_CZRY WHERE CZRY_DM = A.SSGLY_DM) SSGLY_DM,
       (SELECT HSFSMC FROM HX_DM_QG.DM_GY_HSFS DM WHERE DM.HSFS_DM = A.HSFS_DM) HSFS_DM,
       A.CYRS,
       A.ZCZB,
       A.FDDBRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.FDDBRSFZJLX_DM) FDDBRSFZJLX_DM,
       A.FDDBRSFZJHM,
       A.FDDBRYDDH,
       A.FDDBRGDDH,
       A.CWFZRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.CWFZRSFZJZL_DM) CWFZRSFZJZL_DM,
       A.CWFZRSFZJHM,
       A.CWFZRGDDH,
       A.CWFZRYDDH,
       A.BSRXM,
       (SELECT SFZJLXMC FROM HX_DM_QG.DM_GY_SFZJLX DM WHERE DM.SFZJLX_DM = A.BSRSFZJZL_DM) BSRSFZJZL_DM,
       A.BSRSFZJHM,
       A.BSRGDDH,
       A.BSRYDDH,
       (SELECT ZFJGLXMC FROM HX_DM_QG.DM_DJ_ZFJGLX DM WHERE DM.ZFJGLX_DM = A.ZFJGLX_DM) ZFJGLX_DM,
      A.KQCCSZTDJBZ,
      A.QYSDSDJBZ
        FROM WGH_XXBD_NSRXX_DS A
        WHERE A.ZZJG_DM =#ZZJG_DM#
    </select>
    <select id="pWebjk6831Nsrxxcj" resultClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxNsrtxDomain" parameterClass="java.util.Map">
     SELECT A.RWXFDJ_XH,
    A.NSRSBH,
    A.NSRMC,
    A.SCJYDZ,
    A.SCJYDLXDH,
    A.ZCDZ,
    A.ZCDLXDH,
    A.HSFS_DM,
    A.CYRS,
    A.ZCZB,
    A.FDDBRXM,
    A.FDDBRSFZJLX_DM,
    A.FDDBRSFZJHM,
    A.FDDBRYDDH,
    A.FDDBRGDDH,
    A.CWFZRXM,
    A.CWFZRSFZJZL_DM,
    A.CWFZRSFZJHM,
    A.CWFZRGDDH,
    A.CWFZRYDDH,
    A.BSRXM,
    A.BSRSFZJZL_DM,
    A.BSRSFZJHM,
    A.BSRGDDH,
    A.BSRYDDH,
    A.QYSDSDJBZ
    FROM WGH_XXBD_NSRXX_NSRCJ A
    WHERE A.RWXFDJ_XH =#rwxfdjxh#
    </select>
    <select id="pWebjk6831GetRwxfdjxh" resultClass="java.lang.String" parameterClass="java.util.Map">

       SELECT A.RWXFDJ_XH   FROM  WGH_XXBD_RWXF A WHERE A.DJXH_GS = #djxh# AND A.YXBZ='Y' AND ROWNUM=1 ORDER BY A.RWXFDJ_XH DESC
    </select>
    <update id="updateWghXxbdRwxfSaveBz" parameterClass="java.util.Map">
        UPDATE WGH_XXBD_RWXF A  SET A.SAVEBZ= #savebz#,A.CJRQ = SYSDATE,A.CJFS = #cjfs#  WHERE A.RWXFDJ_XH = #rwxfdjxh#
    </update>

    <update id="updateWghXxbdNsrxxNsrcj" parameterClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxNsrtxDomain">

        UPDATE   WGH_XXBD_NSRXX_NSRCJ A
      SET A.RWXFDJ_XH =#RWXFDJ_XH#,
    A.NSRSBH=#NSRSBH#,
    A.NSRMC=#NSRMC#,
    A.SCJYDZ=#SCJYDZ#,
    A.SCJYDLXDH=#SCJYDLXDH#,
    A.ZCDZ=#ZCDZ#,
    A.ZCDLXDH=#ZCDLXDH#,
    A.HSFS_DM=#HSFS_DM#,
    A.CYRS=#CYRS#,
    A.ZCZB=#ZCZB#,
    A.FDDBRXM=#FDDBRXM#,
    A.FDDBRSFZJLX_DM=#FDDBRSFZJLX_DM#,
    A.FDDBRSFZJHM=#FDDBRSFZJHM#,
    A.FDDBRYDDH=#FDDBRYDDH#,
    A.FDDBRGDDH=#FDDBRGDDH#,
    A.CWFZRXM=#CWFZRXM#,
    A.CWFZRSFZJZL_DM=#CWFZRSFZJZL_DM#,
    A.CWFZRSFZJHM=#CWFZRSFZJHM#,
    A.CWFZRGDDH=#CWFZRGDDH#,
    A.CWFZRYDDH=#CWFZRYDDH#,
    A.BSRXM=#BSRXM#,
    A.BSRSFZJZL_DM=#BSRSFZJZL_DM#,
    A.BSRSFZJHM=#BSRSFZJHM#,
    A.BSRGDDH=#BSRGDDH#,
    A.BSRYDDH=#BSRYDDH#,
    A.QYSDSDJBZ=#QYSDSDJBZ#
        WHERE A.RWXFDJ_XH  =#RWXFDJ_XH#
    </update>

    <insert id="insertWghXxbdNsrxxNsrcj" parameterClass="com.hst.taxService.domain.wxfwh.WghNsrJcxxcjCxNsrtxDomain">
       INSERT INTO  WGH_XXBD_NSRXX_NSRCJ  (RWXFDJ_XH,
                                   NSRSBH,
                                   NSRMC,
                                   SCJYDZ,
                                   SCJYDLXDH,
                                   ZCDZ,
                                   ZCDLXDH,
                                   HSFS_DM,
                                   CYRS,
                                   ZCZB,
                                   FDDBRXM,
                                   FDDBRSFZJLX_DM,
                                   FDDBRSFZJHM,
                                   FDDBRYDDH,
                                   FDDBRGDDH,
                                   CWFZRXM,
                                   CWFZRSFZJZL_DM,
                                   CWFZRSFZJHM,
                                   CWFZRGDDH,
                                   CWFZRYDDH,
                                   BSRXM,
                                   BSRSFZJZL_DM,
                                   BSRSFZJHM,
                                   BSRGDDH,
                                   BSRYDDH,
                                   QYSDSDJBZ)
    VALUES( #RWXFDJ_XH#,#NSRSBH#,#NSRMC#,#SCJYDZ#,#SCJYDLXDH#,#ZCDZ#,#ZCDLXDH#,#HSFS_DM#,#CYRS#,#ZCZB#,#FDDBRXM#,#FDDBRSFZJLX_DM#,#FDDBRSFZJHM#,#FDDBRYDDH#,#FDDBRGDDH#,#CWFZRXM#,#CWFZRSFZJZL_DM#,#CWFZRSFZJHM#,#CWFZRGDDH#,#CWFZRYDDH#,#BSRXM#,#BSRSFZJZL_DM#,#BSRSFZJHM#,#BSRGDDH#,#BSRYDDH#,#QYSDSDJBZ#)
    </insert>

    <insert id="insertPtfpSpJkxx" parameterClass="com.hst.common.bo.PtfpSpJkxx" >
     <selectKey resultClass="String"  keyProperty="jkxh" type="pre">
         SELECT SEQ_SPXH.NEXTVAL FROM DUAL
     </selectKey>
        INSERT INTO PTFP_SP_JKXX(JKXH, GDSLB, SWJG_DM, DJXH, NSRSBH, ZJLX_DM, SFZHM, XM, SKRDM, SKRMC, SBBS, SEHJ, JKFS, JKPZXH, JKRQ, CJRQ, ZFBZ,HKBZ)
        VALUES
        (#jkxh#,#gdslb#,#swjg_dm#,#djxh#,#nsrsbh#,#zjlx#,#sfzhm#,#xm#,#skrdm#,#skrmc#,#sbbs#,#sehj#,#jkfs#,#jkpzxh#,TO_DATE(#jkrq#,'YYYY-MM-DD HH24:MI:SS'),SYSDATE,#zfbz#,#hkbz#)
    </insert>
    <insert id="insertPtfpSpJkxxMx" parameterClass="com.hst.common.bo.PtfpSpJkxxMx" >

        INSERT INTO PTFP_SP_JKXX_MX( JKXH,   ZSXM_DM,  ZSPM_DM, SLI, SE)
        VALUES
        (#jkxh#, #zsxm_dm#,#zspm_dm#,#sli#,#se#)
    </insert>

    <parameterMap class="java.util.Map" id="pWebjkWxfw6834WghJkxxZfMap">
        <parameter property="swjg_dm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="gsjkxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dsjkxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="zfrdm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="zfrmc" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="zfsj" 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="pWebjkWxfw6834WghJkxxZf" parameterMap="pWebjkWxfw6834WghJkxxZfMap">
        {call P_WEBJK_WXFW6834_WGHJKXXZF(?,?,?,?,?,?,?,?)}
    </procedure>

    <parameterMap class="java.util.Map" id="pWebjkWxfw6833WghJkxxSaveJyMap">
        <parameter property="nsrsbh" 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="pWebjkWxfw6833WghJkxxSaveJy" parameterMap="pWebjkWxfw6833WghJkxxSaveJyMap">
        {call P_WEBJK_WXFW6833_JKXXSAVE_JY(?,?,?)}
    </procedure>
    <parameterMap class="java.util.Map" id="pWebjkWxfw6833WghJkxxSaveHxclMap">
        <parameter property="gsjkxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="dsjkxh" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="nsrsbh" 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="pWebjkWxfw6833WghJkxxSaveHxcl" parameterMap="pWebjkWxfw6833WghJkxxSaveHxclMap">
        {call P_WEBJK_WXFW6833_JKXXSAVE_HXCL(?,?,?,?,?)}
    </procedure>

</sqlMap>