<?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="com.trs.ggzyexchange.mapper.GcPubContractMapper">

    <select id="getTotalNumberTransactions" resultType="java.lang.Integer">
        select
            count(1) totalTransactionVolume
        from
             gc_pub_contract gpc
        LEFT JOIN GC_TENDERPROJECT gct
        on gpc.TENDER_PROJECT_CODE = gct.TENDER_PROJECT_CODE
        where
            gct.PLATFORM_CODE = #{platformCode}
    </select>

    <select id="queryGcBidcandidateAllList" resultType="com.trs.ggzyexchange.entity.TenderDetailsVo">
        select
            gpc.SOURCE_DATA_KEY sourceDataKey,
            gcp.PROJECT_CODE projectCode,
            gcp.PROJECT_NAME projectName,
            gpc.TENDER_PROJECT_CODE tenderProjectCode,
            gpc.CONTRACT_NAME noticeName,
            gpc.CONTRACT_CONTENT noticeContent,
            gpc.CONTRACT_SIGN_TIME noticeSendTime,
            gct.REGION_CODE regionCode,
            gcp.INDUSTRIES_TYPE industriesTypeCode,
            gpc.PLATFORM_CODE platformCode,
            gpc.TENDERER_NAME bulletinDuty,
            gpc.DATA_SOURCE_CODE dataSourceCode,
            gpc.BID_SECTION_CODE bidSectionCodes,
            gpc.PROJECT_START_DATE docGetStartTime,
            gpc.PROJECT_END_DATE docGetEndTime,
            gpc.PROJECT_COMPLETE_DATE bidDocReferEndTime,
            gpc.SUBMIT_TIME bidOpenTime
        from
            GC_PUB_CONTRACT gpc
                left join GC_TENDERPROJECT gct
                          on gct.TENDER_PROJECT_CODE = gpc.TENDER_PROJECT_CODE
                left join GC_PROJECT gcp
                          on gct.PROJECT_CODE = gcp.PROJECT_CODE
    </select>
    <select id="queryGcBidcandidateAllListByTime" resultType="com.trs.ggzyexchange.entity.TenderDetailsVo">

        select
            gpc.SOURCE_DATA_KEY sourceDataKey,
            gcp.PROJECT_CODE projectCode,
            gcp.PROJECT_NAME projectName,
            gpc.TENDER_PROJECT_CODE tenderProjectCode,
            gpc.CONTRACT_NAME noticeName,
            gpc.CONTRACT_CONTENT noticeContent,
            gpc.CONTRACT_SIGN_TIME noticeSendTime,
            gct.REGION_CODE regionCode,
            gcp.INDUSTRIES_TYPE industriesTypeCode,
            gpc.PLATFORM_CODE platformCode,
            gpc.TENDERER_NAME bulletinDuty,
            gpc.DATA_SOURCE_CODE dataSourceCode,
            gpc.BID_SECTION_CODE bidSectionCodes,
            gpc.PROJECT_START_DATE docGetStartTime,
            gpc.PROJECT_END_DATE docGetEndTime,
            gpc.PROJECT_COMPLETE_DATE bidDocReferEndTime,
            gpc.SUBMIT_TIME bidOpenTime
        from
            GC_PUB_CONTRACT gpc
                left join GC_TENDERPROJECT gct
                          on gct.TENDER_PROJECT_CODE = gpc.TENDER_PROJECT_CODE
                left join GC_PROJECT gcp
                          on gct.PROJECT_CODE = gcp.PROJECT_CODE
        where gpc.DATA_TIMESTAMP &gt; #{time}
    </select>
    <select id="maxDataTimeStamp" resultType="java.lang.Long">
        select max(DATA_TIMESTAMP) from "ggzyexchange"."GC_PUB_CONTRACT";
    </select>

</mapper>
