<?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">
    <resultMap class="com.hst.task.domain.QytjTaskData" id="pWebjkTaskQytjRwListResMap">
        <result property="tjrwUuid" column="TJRW_UUID"/>
        <result property="djxh" column="djxh"/>
        <result property="sssq_q" column="sssq_q"/>
        <result property="sssq_z" column="sssq_z"/>

    </resultMap>
    <resultMap class="com.hst.task.domain.QytjTaskData" id="pWebjkTaskQytjRwXlListResMap">

        <result property="tjxlDm" column="TJXL_DM"/>
        <result property="tjdlDm" column="TJDL_DM"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pWebjkTaskQytjRwListMap">
        <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="pWebjkTaskQytjRwListResMap"/>
        <parameter property="tjxlList" javaType="java.sql.ResultSet" jdbcType="ORACLECURSOR" mode="OUT" resultMap="pWebjkTaskQytjRwXlListResMap"/>
    </parameterMap>

    <procedure id="pWebjkTaskQytjRwList" parameterMap="pWebjkTaskQytjRwListMap">
        {call P_WEBJK_TASK_QYTJ_RWLIST(?,?,?,?)}
    </procedure>

    <resultMap class="com.hst.task.domain.QytjTaskSqlData" id="pWebjkTaskQytjSqlResMap">
        <result property="tjxlDm" column="TJXL_DM"/>
        <result property="sqlXh" column="SQL_XH"/>
        <result property="xtbz" column="XTBZ"/>
        <result property="sqlBz" column="SQL_BZ"/>
        <result property="selSql" column="SEL_SQL"/>
        <result property="procName" column="PROC_NAME"/>
    </resultMap>
    <parameterMap class="java.util.Map" id="pWebjkTaskQytjSqlMap">
        <parameter property="tjxlDm" 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="pWebjkTaskQytjSqlResMap"/>
    </parameterMap>

    <procedure id="pWebjkTaskQytjSql" parameterMap="pWebjkTaskQytjSqlMap">
        {call P_WEBJK_TASK_QYTJ_SQL(?,?,?,?)}
    </procedure>
    <insert id="inisertFwhQytjSqlZxjg" parameterClass="com.hst.common.bo.FwhQytjSqlZxjg">
        <selectKey keyProperty="zxjgUuid" type="pre" resultClass="String">
            select sys_guid() from dual
        </selectKey>

        INSERT INTO $databaseUsername$.FWH_QYTJ_SQL_ZXJG (ZXJG_UUID,
        TJRW_UUID,
        DJXH,
        TJDL_DM,
        TJXL_DM,
        SQL_XH,
        COL1,
        COL2,
        COL3,
        COL4,
        COL5,
        COL6,
        COL7,
        COL8,
        COL9,
        COL10,
        CJRQ)
        VALUES (
        #zxjgUuid#,
        #tjrwUuid#,
        #djxh#,
        #tjdlDm#,
        #tjxlDm#,
        #sqlXh#,
        #col1#,
        #col2#,
        #col3#,
        #col4#,
        #col5#,
        #col6#,
        #col7#,
        #col8#,
        #col9#,
        #col10#,
        sysdate
        )

    </insert>

    <parameterMap class="java.util.Map" id="pWebjkTaskQytjZxjgHxclMap">
        <parameter property="tjrwUuid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>

    </parameterMap>

    <procedure id="pWebjkTaskQytjZxjgHxcl" parameterMap="pWebjkTaskQytjZxjgHxclMap">
        {call $databaseUsername$.p_fwh_qytj_zxjg_hxcl(?)}
    </procedure>


    <parameterMap class="java.util.Map" id="pWebjkTaskQytjZxjgHxclMap">
        <parameter property="tjrwUuid" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>

    </parameterMap>

    <update id="updateFwhQytjRwxxZt" parameterClass="java.util.Map">
        UPDATE $databaseUsername$.FWH_QYTJ_RWXX A
        SET ZT = #zt#,
        err_mess= #errMess#
        <isEqual prepend="," property="zt" compareValue="1">
            kssj = sysdate

        </isEqual>
        <isEqual prepend="," property="zt" compareValue="2">
            wcsj = sysdate
        </isEqual>
        WHERE A.TJRW_UUID = #tjrwUuid#


    </update>

</sqlMap>