| | |
| | | <result property="maxValue" column="max_value" /> |
| | | <result property="unit" column="unit" /> |
| | | <result property="unitMetadata" column="unit_metadata" /> |
| | | <result property="integrityConclusion" column="integrity_conclusion" /> |
| | | <result property="severity" column="severity" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | |
| | | for update |
| | | </select> |
| | | |
| | | <update id="updateTestCompleted"> |
| | | update t_test set test_status = 'COMPLETED', update_time = #{updatedAtUtc} |
| | | where test_id = #{testId} and reception_status = 'ENDED' and test_status = 'COMPLETION_PENDING' |
| | | </update> |
| | | <select id="selectBtsSampleContentHash" resultType="string"> |
| | | select hex(content_sha256) from t_test_sample |
| | | where channel_id = #{channelId} and bts_test_id = #{btsTestId} and seq_id = #{sequenceId} |
| | |
| | | (sample_id, metric_code, metric_value, unit, source_type) |
| | | values (#{sampleId}, #{metricCode}, #{metricValue}, #{unit}, #{sourceType}) |
| | | </insert> |
| | | <select id="selectBtsSampleId" resultType="long"> |
| | | select sample_id from t_test_sample |
| | | where channel_id = #{channelId} and bts_test_id = #{btsTestId} and seq_id = #{sequenceId} |
| | | </select> |
| | | <insert id="insertCollectorSample"> |
| | | insert ignore into t_test_collector_sample |
| | | (test_id, binding_id, collector_id, collector_channel_code, sequence_id, device_time_utc, |
| | |
| | | values (#{testId}, #{bindingId}, #{collectorId}, #{channelCode}, #{sequenceId}, #{deviceTimeUtc}, |
| | | #{deviceTimeRaw}, #{receivedAtUtc}, #{metricCode}, #{metricValue}, #{unit}, #{contentSha256}) |
| | | </insert> |
| | | <select id="selectCollectorSampleId" resultType="long"> |
| | | select sample_id from t_test_collector_sample |
| | | where collector_id = #{collectorId} and collector_channel_code = #{channelCode} |
| | | and sequence_id = #{sequenceId} and metric_code = #{metricCode} |
| | | </select> |
| | | <select id="selectCollectorSampleContentHash" resultType="string"> |
| | | select hex(content_sha256) from t_test_collector_sample |
| | | where collector_id = #{collectorId} and collector_channel_code = #{channelCode} |
| | | and sequence_id = #{sequenceId} and metric_code = #{metricCode} |
| | | </select> |
| | | <insert id="insertSampleConflict"> |
| | | insert into t_test_exception |
| | | (test_id, channel_id, exception_type, exception_status, severity, |