<?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="digital.laboratory.platform.inspection.mapper.SampleInjectorMapper">

    <resultMap id="sampleInjectorMap" type="digital.laboratory.platform.inspection.entity.SampleInjector">
        <id property="id" column="id"/>
        <result property="type" column="type"></result>
        <result property="injectorInfo" column="injector_Info"></result>
        <result property="testId" column="test_id"></result>
        <result property="blankStartPosition" column="blank_start_position"></result>
        <result property="insertNumber" column="insert_number"></result>
        <result property="resetFlag" column="reset_flag"></result>
    </resultMap>
    <sql id="mergeSampleAndStandardSql">
        SELECT T.id,
               T.number,
               T.test_id,
               T.result_concentration
        FROM (SELECT id, sample_no AS number, test_id, result_concentration
              FROM b_test_record_sample_solution
              UNION ALL
              SELECT id, number, test_id, result_concentration
              FROM b_test_record_standard_solution) T
    </sql>
    <select id="queryMaterialList" resultType="digital.laboratory.platform.inspection.vo.TestRecordSolutionVO">
        <include refid="mergeSampleAndStandardSql"></include>
        ${ew.customSqlSegment}
    </select>

    <select id="queryResultConcentrationList" resultType="digital.laboratory.platform.inspection.vo.ResultConcentrationVO">
        <include refid="mergeSampleAndStandardSql"></include>
        ${ew.customSqlSegment}
    </select>

</mapper>
