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

    <resultMap class="com.hst.taxService.domain.smz.JhxtGetYwflDomain" id="jhxtGetYwflRes">
        <result property="ywflbm" column="O_ywflbm"/>
        <result property="ywflmc" column="O_ywflmc"/>
        <result property="dqdhrs" column="O_ddrs"/>
    </resultMap>

    <procedure id="jhxtGetYwfl" resultMap="jhxtGetYwflRes">
        { call GETYWFL()}
    </procedure>

    <resultMap class="com.hst.taxService.domain.smz.JhxtGetYwfl2Domain" id="jhxtGetYwfl2Res">
        <result property="ywflbm" column="ywflbm"/>
        <result property="ywflmc" column="ywflmc"/>
        <result property="dqdhrs" column="dqdhrs"/>
        <result property="yjdhsj" column="yjdhsj"/>
    </resultMap>

    <procedure id="jhxtGetYwfl2" resultMap="jhxtGetYwfl2Res">
        { call GETYWFL2()}
    </procedure>

    <parameterMap class="java.util.Map" id="jhxtGetDhrsMap">
        <parameter property="ywflbm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="qhhm" javaType="java.lang.String" jdbcType="INT" mode="IN"/>
        <parameter property="code" javaType="java.lang.String" jdbcType="INT" mode="OUT"/>
        <parameter property="mess" javaType="java.lang.String" jdbcType="VARCHAR" mode="OUT"/>
    </parameterMap>
    <procedure id="jhxtGetDhrs" parameterMap="jhxtGetDhrsMap">
        { call getdhrs(?,?,?,?) }
    </procedure>

    <parameterMap class="java.util.Map" id="jhxtZfqhhmMap">
        <parameter property="ywflbm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="qhhm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="code" mode="OUT" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="mess" mode="OUT" javaType="java.lang.String" jdbcType="VARCHAR"/>
    </parameterMap>
    <procedure id="jhxtZfqhhm" parameterMap="jhxtZfqhhmMap">
        { call zfqhhm(?,?,?,?) }
    </procedure>


    <parameterMap class="java.util.Map" id="jhxtGetQhhmMap">
        <parameter property="ywflbm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="lbDm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="nsrsbh" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="sfzhm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="yzm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="jzsj" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="nj" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="sjhm" mode="IN" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="code" mode="OUT" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <parameter property="mess" mode="OUT" javaType="java.lang.String" jdbcType="VARCHAR"/>
    </parameterMap>
    <procedure id="jhxtGetQhhm" parameterMap="jhxtGetQhhmMap">
        { call p_bskj_getqhhm(?,?,?,?,?,?,?,?,?,?) }
    </procedure>


    <resultMap class="com.hst.taxService.domain.SjqhGetPhxxReturnDomain" id="pJhxtGetPhxxRes">
        <result property="num" column="num"/>
        <result property="win" column="win"/>
        <result property="zt" column="zt"/>
        <result property="sj" column="sj"/>
        <result property="pjbz" column="pjbz"/>
        <result property="dqdhrs" column="dqdhrs"/>
        <result property="yjdhsj" column="yjdhsj"/>
        <result property="tsxx" column="tsxx"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pJhxtGetPhxxMap">
        <parameter property="qhhm" 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="pJhxtGetPhxx" parameterMap="pJhxtGetPhxxMap" resultMap="pJhxtGetPhxxRes">
        {call P_JHXT_GET_PHXX(?,?,?)}
    </procedure>


    <parameterMap class="java.util.Map" id="pJhxtPutPjjgMap">
        <parameter property="qhhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="pjjg" 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="pJhxtPutPjjg" parameterMap="pJhxtPutPjjgMap">
        {call P_JHXT_PUT_PJJG(?,?,?,?)}
    </procedure>
    <parameterMap class="java.util.Map" id="pJhxtJhSjqhMap">
        <parameter property="ywflbm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="qhhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sfzhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="xm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="xb" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="csrq" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="yxq_z" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="headPic" javaType="java.lang.String" jdbcType="LONGVARCHAR" mode="IN"/>
        <parameter property="sfzPic" javaType="java.lang.String" jdbcType="LONGVARCHAR" 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="pJhxtJhSjqh" parameterMap="pJhxtJhSjqhMap">
        {call P_BSKJ_HLQHHM(?,?,?,?,?,?,?,?,?,?,?,?)}
    </procedure>


    <resultMap class="com.hst.taxService.domain.smz.JhxtGetQhhmlistDomain" id="pjhxtGetQhhmlistRes">
        <result property="ywflbm" column="ywflbm"/>
        <result property="ywflmc" column="ywflmc"/>
        <result property="yxbz" column="yxbz"/>
        <result property="qhsj" column="qhsj"/>
        <result property="jhsj" column="jhsj"/>
        <result property="bjsj" column="bjsj"/>
        <result property="blck" column="blck"/>
        <result property="qhhm" column="qhhm"/>
        <result property="nsrpj" column="nsrpj"/>
        <result property="phzt" column="phzt"/>
        <result property="tsxx" column="tsxx"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pjhxtGetQhhmlistResMap">
        <parameter property="sfzhm" 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="pjhxtGetQhhmlist" parameterMap="pjhxtGetQhhmlistResMap" resultMap="pjhxtGetQhhmlistRes">
        {call P_BSKJ_GET_DRQHXX(?,?,?)}
    </procedure>
    <parameterMap class="java.util.Map" id="JhxtJhYyqhMap">
        <parameter property="hqyzm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sfzhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="qhhm" 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"/>
    </parameterMap>
    <procedure id="JhxtJhYyqh" parameterMap="JhxtJhYyqhMap">
        {call P_BSKJ_HLYYQH(?,?,?,?,?)}
    </procedure>

    <parameterMap class="java.util.Map" id="JhxtZfYyqhMap">
        <parameter property="hqyzm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sfzhm" 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="JhxtZfYyqh" parameterMap="JhxtZfYyqhMap">
        {call P_BSKJ_ZFYYQH(?,?,?,?)}
    </procedure>


    <resultMap class="com.hst.taxService.domain.smz.JhxtGetYyqhlistDomain" id="jhxtGetYyqhlistRes">
        <result property="ywflbm" column="ywflbm"/>
        <result property="ywflmc" column="ywflmc"/>
        <result property="hqyzm" column="hqyzm"/>
        <result property="yyqhhm" column="yyqhhm"/>
        <result property="hqsj" column="hqsj"/>
        <result property="phzt" column="phzt"/>
        <result property="tsxx" column="tsxx"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="jhxtGetYyqhlistMap">
        <parameter property="sfzhm" 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="jhxtGetYyqhlist" parameterMap="jhxtGetYyqhlistMap" resultMap="jhxtGetYyqhlistRes">
        {call P_BSKJ_GET_DRYYQH(?,?,?)}
    </procedure>

    <select id="queryUpdateGt3QhhmReqByqhhm" parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.gt3.Zjsmbs00009RequestDomain">
        SELECT jkyzuuid ,sfzhm sfzjhm,bsdt_djxh wbsbbs ,qhhm wbsbkl from SMZ_BSY_RXSFZ_BDJL A
         WHERE A.qhhm= #qhhm#
         AND datediff(DAY, a.bdrq, GETDATE()) = 0
    </select>
    <select id="queryBdjlByDrqhhm" resultClass="com.hst.common.bo.SmzBsySxsfzBdjl" parameterClass="java.util.Map">

        SELECT A.XM xm,
        A.SFZHM sfzhm,
        A.XB xb,
        A.MZ mz,
        CONVERT(varchar(10), CSRQ, 120) csrq,
        A.ZZ zz,
        A.QFJG qfjg,
        CONVERT(varchar(10), YXQ_Q, 120) yxq_q,
        CONVERT(varchar(10), YXQ_Z, 120) yxq_z,
        A.SFZZM_PIC sfzzmPic,
        A.SFZFM_PIC sfzfmPic,
        A.HEAD_PIC headPic,
        A.cjbz,
        a.qhhm qhhm,
        (SELECT CONVERT(varchar(10),TKT_DATE,120) + ' ' + CONVERT(varchar(8),TKT_TIME,24) FROM ticket B WHERE B.TKT_ID= A.qhhm) qhsj
        FROM SMZ_BSY_RXSFZ_BDJL A
        WHERE QHHM = #qhhm#
        and datediff(DAY, a.bdrq, GETDATE()) = 0


    </select>
    <update id="updateSmzBsyRxsfzBdjlJkyzUuidByqhhm" parameterClass="java.util.Map">
        <![CDATA[



        UPDATE SMZ_BSY_RXSFZ_BDJL SET jkyzuuid = #jkyzuuid#,rtnMsg=#rtnMsg#
        WHERE
          ]]>

            qhhm= #qhhm#
             and datediff(DAY, bdrq, GETDATE()) = 0





    </update>


    <parameterMap class="java.util.Map" id="JhxtSetSjhmMap">
        <parameter property="qhhm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="ywflbm" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" 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="JhxtSetSjhm" parameterMap="JhxtSetSjhmMap">
        {call P_BSDKJ_UPDATESJHM(?,?,?,?,?)}
    </procedure>

    <parameterMap class="java.util.Map" id="pJhxtSaveSjhmMap">
        <parameter property="tkt_uid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
        <parameter property="sjhm" 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="pJhxtSaveSjhm" parameterMap="pJhxtSaveSjhmMap">
        {call P_BSDKJ_JHXT_SAVESJHM(?,?,?,?)}
    </procedure>

    <insert id="insertTicketNsr"  parameterClass="com.hst.common.bo.TicketNsr">
        INSERT INTO TICKET_NSR(TKT_UID,DJXH,NSRSBH,NSRMC,YXBZ)
        VALUES
        (#tkt_uid#,#djxh#,#nsrsbh#,#nsrmc#,#yxbz#)

    </insert>
    <update id="deleteTicketNsr" parameterClass="java.util.Map">
        UPDATE ticket_NSR SET YXBZ='N' WHERE TKT_UID = #tkt_uid#
    </update>
    <select id="queryNsrByQHhm" parameterClass="java.util.Map" resultClass="com.hst.taxService.domain.smz.JhxtGetBsyxxByqhhmDomain">
        SELECT DJXH FROM ticket_NSR WHERE TKT_UID = (SELECT  b.uid FROM dbo.SMZ_BSY_RXSFZ_BDJL A,ticket b  WHERE A.rxsfz_bdxh = #rxsfzBdxh# and a.qhhm = b.TKT_ID )
    </select>


</sqlMap>