yeg
2026-08-30 c2eefadb8239df552ef43d7ba55d5735bb603ed1
ruoyi-system/src/main/resources/mapper/system/TTestMapper.xml
@@ -399,4 +399,52 @@
        values(#{testId}, #{bindingId}, #{sourceType}, #{sourceId}, #{sourceChannelCode}, #{actionAtUtc},
               #{startBoundaryAtUtc}, #{boundaryNote}, #{intervalStatus})
    </insert>
    <select id="selectOpenReceptionIntervalsForUpdate" parameterType="Long"
            resultType="com.ruoyi.system.domain.TTestReceptionInterval">
        select interval_id intervalId, test_id testId, binding_id bindingId, source_type sourceType,
               source_id sourceId, source_channel_code sourceChannelCode, action_at_utc actionAtUtc,
               start_boundary_at_utc startBoundaryAtUtc, end_boundary_at_utc endBoundaryAtUtc,
               boundary_note boundaryNote, interval_status intervalStatus
        from t_test_reception_interval
        where test_id = #{testId} and interval_status = 'OPEN'
        order by interval_id
        for update
    </select>
    <select id="selectReceptionIntervals" parameterType="Long"
            resultType="com.ruoyi.system.domain.TTestReceptionInterval">
        select interval_id intervalId, test_id testId, binding_id bindingId, source_type sourceType,
               source_id sourceId, source_channel_code sourceChannelCode, action_at_utc actionAtUtc,
               start_boundary_at_utc startBoundaryAtUtc, end_boundary_at_utc endBoundaryAtUtc,
               boundary_note boundaryNote, interval_status intervalStatus
        from t_test_reception_interval
        where test_id = #{testId}
        order by interval_id
    </select>
    <select id="selectLatestReceptionIntervalForUpdate" resultType="com.ruoyi.system.domain.TTestReceptionInterval">
        select interval_id intervalId, test_id testId, binding_id bindingId, source_type sourceType,
               source_id sourceId, source_channel_code sourceChannelCode, action_at_utc actionAtUtc,
               start_boundary_at_utc startBoundaryAtUtc, end_boundary_at_utc endBoundaryAtUtc,
               boundary_note boundaryNote, interval_status intervalStatus
        from t_test_reception_interval
        where test_id = #{testId} and source_type = #{sourceType} and source_id = #{sourceId}
          and (source_channel_code = #{sourceChannelCode} or (source_channel_code is null and #{sourceChannelCode} is null))
        order by interval_id desc
        limit 1
        for update
    </select>
    <update id="closeReceptionInterval">
        update t_test_reception_interval
        set end_boundary_at_utc = #{endBoundaryAtUtc}, boundary_note = #{boundaryNote}, interval_status = 'CLOSED'
        where interval_id = #{intervalId} and interval_status = 'OPEN'
    </update>
    <update id="updateReceptionPaused">
        update t_test
        set test_status = 'PAUSED', reception_status = 'PAUSED', update_by = #{updateBy}, update_time = #{updatedAtUtc}
        where test_id = #{testId} and reception_status = 'RECEIVING' and del_flag = 0
    </update>
    <update id="updateReceptionResumed">
        update t_test
        set test_status = 'RUNNING', reception_status = 'RECEIVING', update_by = #{updateBy}, update_time = #{updatedAtUtc}
        where test_id = #{testId} and reception_status = 'PAUSED' and del_flag = 0
    </update>
</mapper>