<?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.qualityControl.mapper.FdQaProcessFacilityMapper">
    <select id="findByPage" resultType="org.jeecg.modules.qualityControl.entity.FdQaProcessFacility">
          SELECT
            a.id,
            a.contract_code,
            a.quality_assurance_form_number,
            a.quality_assurance_sheet_date,
            a.qa_type,
            a.qa_submission_date,
            a.create_time,
            a.responsible_q_a_name,
            a.quality_status
          FROM
            fd_qa_process_facility a
             ${ew.customSqlSegment}
    </select>


    <select id="queryQaProcessFacilityByConId" resultType="org.jeecg.modules.qualityControl.entity.FdQaProcessFacility">
        SELECT
            pf.id AS pkProjectFile,
            pf.contract_id AS pkContract,
            pf.customer_id AS pkBidParty,
            pf.project_name AS projectName,
            pf.customer_name AS bidPartyName,
            pf.contract_party AS pkContractParty,
            c.`code` AS contractCode,
            c.sign_date AS contractSignDate,
            pf.contract_type,
            cus.abbreviation AS bidPartyNameAbbreviation,
            cus.name AS bidPartyName,
            pf.bioanalytical_pm AS bioanalyticalPi,
            pf.assistant AS associateBioanalyticalPi,
            pf.matrix_type AS matrix,
            pf.investigator
        FROM
            fd_project_file pf
            LEFT JOIN fd_contract c ON c.id = pf.contract_id
            LEFT JOIN fd_customer cus ON cus.id = pf.customer_id
        WHERE
            c.del_flag = '0'
            and pf.contract_id=#{0}
    </select>

</mapper>