| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <?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="cn.chinaunicom.omniFlowNetCompute.mapper.FreemarketMapper">
-
- <resultMap type="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket" id="FreemarketResult">
- <id property="id" column="id" />
- <result property="announcementType" column="announcement_type" />
- <result property="announcementTitle" column="announcement_title" />
- <result property="projectCode" column="project_code" />
- <result property="isRelevant" column="is_relevant" />
- <result property="purchaseUnit" column="purchase_unit" />
- <result property="finalUser" column="final_user" />
- <result property="naturalCustomerId" column="natural_customer_id" />
- <result property="customerGroup" column="customer_group" />
- <result property="category" column="category" />
- <result property="projectName" column="project_name" />
- <result property="tenderAgent" column="tender_agent" />
- <result property="tenderAgentPhone" column="tender_agent_phone" />
- <result property="matchKeywords" column="match_keywords" />
- <result property="bidDocumentDeadline" column="bid_document_deadline" />
- <result property="bidOpeningDate" column="bid_opening_date" />
- <result property="announcementUrl" column="announcement_url" />
- <result property="jianyuUrl" column="jianyu_url" />
- <result property="budget" column="budget" />
- <result property="tenderInfoPublishTime" column="tender_info_publish_time" />
- <result property="branchCompany" column="branch_company" />
- <result property="industry" column="industry" />
- <result property="businessCategory" column="business_category" />
- <result property="businessDemand" column="business_demand" />
- <result property="opportunityId" column="opportunity_id" />
- <result property="isParticipate" column="is_participate" />
- <result property="notParticipateReason" column="not_participate_reason" />
- <result property="isAware" column="is_aware" />
- <result property="rbgLabel" column="rbg_label" />
- <result property="discardApprovalNumber" column="discard_approval_number" />
- <result property="publishTime" column="publish_time" />
- <result property="createTime" column="create_time" />
- <result property="updateTime" column="update_time" />
- <result property="dataSource" column="data_source" />
- </resultMap>
-
- <!-- 共享的ResultMap,两个Mapper都可以引用 -->
- <resultMap type="cn.chinaunicom.omniFlowNetCompute.pojo.OpportunityFreemarketVO"
- id="OpportunityFreemarketResult">
- <!-- ========== Opportunity 字段映射 ========== -->
- <result property="oppId" column="opp_id" />
- <result property="opportunityCode" column="opportunity_code" />
- <result property="opportunityName" column="opportunity_name" />
- <result property="oppNaturalCustomerId" column="opp_natural_customer_id" />
- <result property="oppNaturalCustomerName" column="opp_natural_customer_name" />
- <result property="estimatedContractAmount" column="estimated_contract_amount" />
- <result property="estimatedSignDate" column="estimated_sign_date" />
- <result property="opportunityOwner" column="opportunity_owner" />
- <result property="opportunityUnit" column="opportunity_unit" />
- <result property="supportPerson" column="support_person" />
- <result property="supportUnit" column="support_unit" />
- <result property="customerRequirement" column="customer_requirement" />
- <result property="supportDepartment" column="support_department" />
- <result property="customerFundSource" column="customer_fund_source" />
- <result property="fillTime" column="fill_time" />
- <result property="opportunityStage" column="opportunity_stage" />
- <result property="establishTime" column="establish_time" />
-
- <!-- ========== Freemarket 字段映射 ========== -->
- <result property="fmId" column="fm_id" />
- <result property="announcementType" column="announcement_type" />
- <result property="announcementTitle" column="announcement_title" />
- <result property="projectCode" column="project_code" />
- <result property="isRelevant" column="is_relevant" />
- <result property="purchaseUnit" column="purchase_unit" />
- <result property="finalUser" column="final_user" />
- <result property="fmNaturalCustomerId" column="fm_natural_customer_id" />
- <result property="customerGroup" column="customer_group" />
- <result property="category" column="category" />
- <result property="projectName" column="project_name" />
- <result property="tenderAgent" column="tender_agent" />
- <result property="tenderAgentPhone" column="tender_agent_phone" />
- <result property="matchKeywords" column="match_keywords" />
- <result property="bidDocumentDeadline" column="bid_document_deadline" />
- <result property="bidOpeningDate" column="bid_opening_date" />
- <result property="announcementUrl" column="announcement_url" />
- <result property="jianyuUrl" column="jianyu_url" />
- <result property="budget" column="budget" />
- <result property="tenderInfoPublishTime" column="tender_info_publish_time" />
- <result property="branchCompany" column="branch_company" />
- <result property="industry" column="industry" />
- <result property="businessCategory" column="business_category" />
- <result property="businessDemand" column="business_demand" />
- <result property="opportunityId" column="opportunity_id" />
- <result property="isParticipate" column="is_participate" />
- <result property="notParticipateReason" column="not_participate_reason" />
- <result property="isAware" column="is_aware" />
- <result property="rbgLabel" column="rbg_label" />
- <result property="discardApprovalNumber" column="discard_approval_number" />
- <result property="publishTime" column="publish_time" />
- <result property="fmCreateTime" column="fm_create_time" />
- <result property="fmUpdateTime" column="fm_update_time" />
- </resultMap>
-
-
- <!-- 通用查询字段 -->
- <sql id="Base_Column_List">
- id, announcement_type, announcement_title, project_code, is_relevant, purchase_unit, final_user,
- natural_customer_id, customer_group, category, project_name, tender_agent, tender_agent_phone,
- match_keywords, bid_document_deadline, bid_opening_date, announcement_url, jianyu_url, budget,
- tender_info_publish_time, branch_company, industry, business_category, business_demand,
- opportunity_id, is_participate, not_participate_reason, is_aware, rbg_label, discard_approval_number,
- publish_time, create_time, update_time, data_source
- </sql>
- <!-- ========== 核心SQL 1:详情页查询 - 根据主键ID查询单条详情数据 ========== -->
- <select id="selectById" parameterType="java.lang.Long" resultMap="FreemarketResult">
- SELECT
- <include refid="Base_Column_List"/>
- FROM project_announcement
- WHERE id = #{id}
- </select>
- <!-- ========== 核心SQL 2:列表页查询 - 分页+多条件模糊查询(最常用) ========== -->
- <select id="selectPageByCondition" parameterType="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket" resultMap="FreemarketResult">
- SELECT
- <include refid="Base_Column_List"/>
- FROM freemarket
- WHERE 1=1
- <!-- 公告标题 模糊查询 -->
- <if test="announcementTitle != null and announcementTitle != ''">
- AND announcement_title LIKE CONCAT('%',#{announcementTitle},'%')
- </if>
- <!-- 项目编号 精准查询 -->
- <if test="projectName != null and projectName != ''">
- AND project_name LIKE CONCAT('%',#{projectName},'%')
- </if>
- <!-- 是否相关 精准查询 -->
- <if test="isRelevant != null">
- AND is_relevant = #{isRelevant}
- </if>
- <!-- 分公司 -->
- <if test="branchCompany != null and branchCompany != ''">
- AND branch_company = #{branchCompany}
- </if>
- <!-- 是否参与 精准查询 -->
- <if test="isParticipate != null">
- AND is_participate = #{isParticipate}
- </if>
- <if test="category != null and category != '' ">
- AND category = #{category}
- </if>
- <if test="dataSource != null and dataSource != '' ">
- AND data_source = #{dataSource}
- </if>
- <if test="announcementType != null and announcementType != ''">
- AND announcement_type = #{announcementType}
- </if>
- <if test="customerGroup != null and customerGroup != ''">
- AND customer_group = #{customerGroup}
- </if>
- <if test="bidOpeningDateStart != null and bidOpeningDateEnd != null">
- AND bid_opening_date BETWEEN #{bidOpeningDateStart} AND #{bidOpeningDateEnd}
- </if>
- <if test="publishTimeStart != null and publishTimeEnd != null">
- AND publish_time BETWEEN #{publishTimeStart} AND #{publishTimeEnd}
- </if>
- <if test="createTimeStart != null and createTimeEnd != null">
- AND create_time BETWEEN #{createTimeStart} AND #{createTimeEnd}
- </if>
- <!-- 排序:按创建时间倒序,最新的在前面 -->
- ORDER BY create_time DESC
- </select>
-
- <select id="selectFreemarketById" parameterType="Long"
- resultMap="OpportunityFreemarketResult">
- SELECT
- f.id as fm_id,
- f.announcement_type,
- f.announcement_title,
- f.project_code,
- f.is_relevant,
- f.purchase_unit,
- f.final_user,
- f.natural_customer_id as fm_natural_customer_id,
- f.customer_group,
- f.category,
- f.project_name,
- f.tender_agent,
- f.tender_agent_phone,
- f.match_keywords,
- f.bid_document_deadline,
- f.bid_opening_date,
- f.announcement_url,
- f.jianyu_url,
- f.budget,
- f.tender_info_publish_time,
- f.branch_company,
- f.industry,
- f.business_category,
- f.business_demand,
- f.opportunity_id,
- f.is_participate,
- f.not_participate_reason,
- f.is_aware,
- f.rbg_label,
- f.discard_approval_number,
- f.publish_time,
- f.create_time as fm_create_time,
- f.update_time as fm_update_time,
-
- o.id as opp_id,
- o.opportunity_code,
- o.opportunity_name,
- o.natural_customer_id as opp_natural_customer_id,
- o.natural_customer_name as opp_natural_customer_name,
- o.estimated_contract_amount,
- o.estimated_sign_date,
- o.opportunity_owner,
- o.opportunity_unit,
- o.support_person,
- o.support_unit,
- o.customer_requirement,
- o.support_department,
- o.customer_fund_source,
- o.fill_time,
- o.opportunity_stage,
- o.establish_time
- FROM freemarket f
- LEFT JOIN opportunity o ON f.opportunity_id = o.id
- WHERE f.id = #{id}
- </select>
-
- <insert id="insertFreemarket" parameterType="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket" useGeneratedKeys="true" keyProperty="id">
- insert into freemarket (
- announcement_type,
- announcement_title,
- project_code,
- is_relevant,
- purchase_unit,
- final_user,
- natural_customer_id,
- customer_group,
- category,
- project_name,
- tender_agent,
- tender_agent_phone,
- match_keywords,
- bid_document_deadline,
- bid_opening_date,
- announcement_url,
- jianyu_url,
- budget,
- tender_info_publish_time,
- branch_company,
- industry,
- business_category,
- business_demand,
- opportunity_id,
- is_participate,
- not_participate_reason,
- is_aware,
- rbg_label,
- discard_approval_number,
- publish_time
- ) values (
- #{announcementType},
- #{announcementTitle},
- #{projectCode},
- #{isRelevant},
- #{purchaseUnit},
- #{finalUser},
- #{naturalCustomerId},
- #{customerGroup},
- #{category},
- #{projectName},
- #{tenderAgent},
- #{tenderAgentPhone},
- #{matchKeywords},
- #{bidDocumentDeadline},
- #{bidOpeningDate},
- #{announcementUrl},
- #{jianyuUrl},
- #{budget},
- #{tenderInfoPublishTime},
- #{branchCompany},
- #{industry},
- #{businessCategory},
- #{businessDemand},
- #{opportunityId},
- #{isParticipate},
- #{notParticipateReason},
- #{isAware},
- #{rbgLabel},
- #{discardApprovalNumber},
- #{publishTime}
- )
- </insert>
-
- <update id="updateFreemarket" parameterType="cn.chinaunicom.omniFlowNetCompute.domain.Freemarket">
- update freemarket
- <set>
- <if test="announcementType != null">announcement_type = #{announcementType},</if>
- <if test="announcementTitle != null">announcement_title = #{announcementTitle},</if>
- <if test="projectCode != null">project_code = #{projectCode},</if>
- <if test="isRelevant != null">is_relevant = #{isRelevant},</if>
- <if test="purchaseUnit != null">purchase_unit = #{purchaseUnit},</if>
- <if test="finalUser != null">final_user = #{finalUser},</if>
- <if test="naturalCustomerId != null">natural_customer_id = #{naturalCustomerId},</if>
- <if test="customerGroup != null">customer_group = #{customerGroup},</if>
- <if test="category != null">category = #{category},</if>
- <if test="projectName != null">project_name = #{projectName},</if>
- <if test="tenderAgent != null">tender_agent = #{tenderAgent},</if>
- <if test="tenderAgentPhone != null">tender_agent_phone = #{tenderAgentPhone},</if>
- <if test="matchKeywords != null">match_keywords = #{matchKeywords},</if>
- <if test="bidDocumentDeadline != null">bid_document_deadline = #{bidDocumentDeadline},</if>
- <if test="bidOpeningDate != null">bid_opening_date = #{bidOpeningDate},</if>
- <if test="announcementUrl != null">announcement_url = #{announcementUrl},</if>
- <if test="jianyuUrl != null">jianyu_url = #{jianyuUrl},</if>
- <if test="budget != null">budget = #{budget},</if>
- <if test="tenderInfoPublishTime != null">tender_info_publish_time = #{tenderInfoPublishTime},</if>
- <if test="branchCompany != null">branch_company = #{branchCompany},</if>
- <if test="industry != null">industry = #{industry},</if>
- <if test="businessCategory != null">business_category = #{businessCategory},</if>
- <if test="businessDemand != null">business_demand = #{businessDemand},</if>
- <if test="opportunityId != null">opportunity_id = #{opportunityId},</if>
- <if test="isParticipate != null">is_participate = #{isParticipate},</if>
- <if test="notParticipateReason != null">not_participate_reason = #{notParticipateReason},</if>
- <if test="isAware != null">is_aware = #{isAware},</if>
- <if test="rbgLabel != null">rbg_label = #{rbgLabel},</if>
- <if test="discardApprovalNumber != null">discard_approval_number = #{discardApprovalNumber},</if>
- <if test="publishTime != null">publish_time = #{publishTime},</if>
- </set>
- where id = #{id}
- </update>
-
- <delete id="deleteFreemarketById" parameterType="Long">
- delete from freemarket where id = #{id}
- </delete>
-
- <delete id="deleteFreemarketByIds" parameterType="Long">
- delete from freemarket where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|