<?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.pqs9300.mapper.uploadFiles.UploadFilesMapper'>
    <select id="getOverRunLogName" resultType="String" >
        SELECT
            NAME
        FROM
            THS_OVERRUNLOG
        WHERE
            SUP_INDEX = #{supIndex}
        AND
            LINE_INDEX = #{lineIndex}
        AND
            UPDATETIME = #{updateTime}
    </select>

    <update id="updateFeedbackUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            FEEDBACK = #{filePath}
        WHERE
            SUP_INDEX = #{supIndex}
        AND
            LINE_INDEX = #{lineIndex}
        AND
            UPDATETIME = #{updateTime}
    </update>

    <update id="updateTestReportUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            TESTREPORT = #{filePath}
        WHERE
            SUP_INDEX = #{supIndex}
        AND
            LINE_INDEX = #{lineIndex}
        AND
            UPDATETIME = #{updateTime}
    </update>

    <update id="updateReviseFeedbackUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            REVISEFEEDBACK = #{filePath}
        WHERE
            SUP_INDEX = #{supIndex}
        AND
            LINE_INDEX = #{lineIndex}
        AND
            UPDATETIME = #{updateTime}
    </update>

    <select id="getAllFileName" resultType="String" >
        SELECT
            a.NAME
        FROM
            THS_OVERRUNLOG a,THS_SUPERVISE b
        WHERE
            b.PROGRESS = #{stepCount}
        AND
            a.SUP_INDEX = b.SUP_INDEX
        AND
            b.SUP_INDEX = #{supIndex}
    </select>

    <update id="updateFilesFeedbackUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            FEEDBACK = #{filePath}
        WHERE
            NAME = #{fileName}
        AND
            SUP_INDEX = #{supIndex}
    </update>

    <update id="updateFilesTestReportUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            TESTREPORT = #{filePath}
        WHERE
            NAME = #{fileName}
        AND
            SUP_INDEX = #{supIndex}
    </update>

    <update id="updateFilesReviseFeedbackUrl">
        UPDATE
            THS_OVERRUNLOG
        SET
            REVISEFEEDBACK = #{filePath}
        WHERE
            NAME = #{fileName}
        AND
            SUP_INDEX = #{supIndex}
    </update>

    <update id="updateProgress">
        UPDATE
            THS_SUPERVISE
        SET
            PROGRESS = #{progress}
        WHERE
            SUP_INDEX = #{supIndex}
    </update>

    <select id="getOverRunLog" resultType="com.pqs9300.pojo.transaction.OverRunLog">
        SELECT
            SUP_INDEX,FEEDBACK,TESTREPORT,REVISEFEEDBACK
        FROM
            THS_OVERRUNLOG
        WHERE
            SUP_INDEX = #{supIndex}
    </select>

    <select id="getSuperviseType" resultType="Integer">
        SELECT
            TYPE
        FROM
            THS_SUPERVISE
        WHERE
            SUP_INDEX = #{supIndex}
    </select>

</mapper>
