<?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="org.jeecg.modules.financeManage.mapper.FdSampleStorageRevenueRecognitionMapper">
    <select id="getByProjectId" resultType="org.jeecg.modules.financeManage.entity.FdSampleStorageRevenueRecognition">
        SELECT
            fpf.id as projectFileId,
            fpf.contract_id as contractId,
            fpf.contract_party as contractPartyId,
            fpf.customer_id as customerId,
            fpf.customer_name as customerName,
            fpf.investigator as pfBioanalysisPiId,
            fpi.NAME as pfBioanalysisPiName,
            fpf.clinical_pi as pfClinicalPiId,
            fpc.`name` AS pfClinicalPiName,
            fpf.`status` as pfStatusId,
            fpf.lab_address as labAddressId,
            fpf.compound as compoundName,
            fc.`code` as code ,
            fc.tax_rate as taxRate,
            fc.quotation_id as quotationId,
            fpf.matrix_type as matrixTypeId
        FROM
            fd_project_file fpf
            LEFT JOIN fd_contract fc ON fpf.contract_id = fc.id
            LEFT JOIN fd_personnel fpi ON fpf.investigator = fpi.id
            LEFT JOIN fd_personnel fpc ON fpf.clinical_pi = fpc.id
        WHERE
            fpf.del_flag = '0'
            AND fpf.id=#{projectId}
    </select>
</mapper>