<?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.sampleAndConsumableManagement.mapper.FdStandardProductsMapper">

    <select id="queryStandardByConId" resultType="org.jeecg.modules.sampleAndConsumableManagement.entity.FdStandardProducts">
        SELECT
            pf.id AS pkProjectFile,
            pf.contract_id AS pkContract,
            pf.project_name AS projectName,
            pf.customer_name AS pkBidParty,
            pf.contract_party AS contractPartyName,
            c.`code` AS contractCode,
            cus.`name` AS bidPartyName,
            cus.abbreviation AS bidPartyNameAbbreviation
        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>

    <select id="getFileContractList" resultType="org.jeecg.modules.projectManagement.entity.FdContract">
        SELECT
            c.id,
            c.CODE
        FROM
            fd_project_file pf
            LEFT JOIN fd_contract c ON c.id = pf.contract_id
        WHERE
            pf.del_flag = '0'
            and pf.status='1'
        ORDER BY
            pf.create_time
    </select>
</mapper>