<?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.TestRecordSampleDataExpandMapper">

    <resultMap id="BaseResultMap" type="digital.laboratory.platform.inspection.entity.TestRecordSampleDataExpand">
            <id property="id" column="exp_id" jdbcType="VARCHAR"/>
            <result property="testDataId" column="test_data_id" jdbcType="VARCHAR"/>
            <result property="peakArea" column="peak_area" jdbcType="DECIMAL"/>
            <result property="basePeak" column="base_peak" jdbcType="TINYINT"/>
            <result property="ionAbundanceRatio" column="ion_abundance_ratio" jdbcType="DECIMAL"/>
            <result property="ionAbundanceRatioError" column="ion_abundance_ratio_error" jdbcType="DECIMAL"/>
            <result property="ionAbundanceRatioWithinError" column="ion_abundance_ratio_within_error" jdbcType="VARCHAR"/>
            <result property="fragmentRetTime" column="fragment_ret_time" jdbcType="DECIMAL"/>
            <result property="massToChargeRatio" column="mass_to_charge_ratio" jdbcType="DECIMAL"/>
            <result property="qualitativeIonPair" column="qualitative_ion_pair" jdbcType="VARCHAR"/>
            <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
            exp.exp_id,
            exp.test_data_id,
            exp.peak_area,
            exp.base_peak,
            exp.ion_abundance_ratio,
            exp.ion_abundance_ratio_error,
            exp.fragment_ret_time
            exp.ion_abundance_ratio_within_error,
            exp.mass_to_charge_ratio,
            exp.qualitative_ion_pair,
            exp.create_by,
            exp.create_time,
            exp.update_by,
            exp.update_time
    </sql>
<!--    连表查询，主表b_test_record_sampledata    -->
    <sql id="joinMasterTable">
        SELECT
            <include refid="Base_Column_List"/>
            FROM b_test_record_sampledata_expand exp
                LEFT JOIN b_test_record_sampledata test ON exp.test_data_id = test.id
    </sql>

</mapper>
