<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.utic.center.utic.ptis.server.dao.mapper.ProcessStateMapper">

    <update id="updateProcessState" parameterType="com.utic.center.common.dto.ProcessStateDto" timeout="10">
        <![CDATA[
        UPDATE PROCESS_STATE@UTIS
        SET
            REGDATE    = SYSDATE,
            RUNSTATE   = #{obj.runState},
            RCVCNT     = #{obj.rcvCnt},
            SNDCNT     = #{obj.sndCnt},
            ETCCNT     = #{obj.etcCnt},
            ERRDESC    = #{obj.errDesc},
            ERRTIMEGAP = #{obj.errTimeGap}
        WHERE PROCESSID = #{obj.processId}
        ]]>
    </update>

    <update id="updateProcessStateStart" parameterType="com.utic.center.common.dto.ProcessStateDto" timeout="10">
        <![CDATA[
        UPDATE PROCESS_STATE@UTIS
        SET
            REGDATE    = SYSDATE,
            STRDATE    = SYSDATE,
            RUNSTATE   = #{obj.runState},
            RCVCNT     = #{obj.rcvCnt},
            SNDCNT     = #{obj.sndCnt},
            ETCCNT     = #{obj.etcCnt},
            ERRDESC    = #{obj.errDesc},
            ERRTIMEGAP = #{obj.errTimeGap}
        WHERE PROCESSID = #{obj.processId}
        ]]>
    </update>

    <update id="updateProcessStateStop" parameterType="com.utic.center.common.dto.ProcessStateDto" timeout="10">
        <![CDATA[
        UPDATE PROCESS_STATE@UTIS
        SET
            REGDATE    = SYSDATE,
            ENDDATE    = SYSDATE,
            RUNSTATE   = #{obj.runState},
            RCVCNT     = #{obj.rcvCnt},
            SNDCNT     = #{obj.sndCnt},
            ETCCNT     = #{obj.etcCnt},
            ERRDESC    = #{obj.errDesc},
            ERRTIMEGAP = #{obj.errTimeGap}
        WHERE PROCESSID = #{obj.processId}
        ]]>
    </update>

</mapper>
