ソースを参照

#公开市场列表查询接口优化

sunhuijun 1 ヶ月 前
コミット
65069bfd69

+ 31 - 0
src/main/java/cn/chinaunicom/omniFlowNetCompute/domain/Freemarket.java

@@ -1,6 +1,9 @@
 package cn.chinaunicom.omniFlowNetCompute.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Data;
+import org.springframework.data.annotation.Transient;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -50,9 +53,11 @@ public class Freemarket {
     private String matchKeywords;
 
     /** 购买标书截止时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date bidDocumentDeadline;
 
     /** 开标日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date bidOpeningDate;
 
     /** 公告地址(链接) */
@@ -65,6 +70,7 @@ public class Freemarket {
     private BigDecimal budget;
 
     /** 招标信息发布时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date tenderInfoPublishTime;
 
     /** 分公司 */
@@ -98,11 +104,36 @@ public class Freemarket {
     private String discardApprovalNumber;
 
     /** 发布时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date publishTime;
 
     /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date createTime;
 
     /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updateTime;
+
+    /** 数据来源(剑鱼、千里马) */
+    private String dataSource;
+
+    @Transient
+    @JsonIgnore
+    private Date bidOpeningDateStart;
+    @Transient
+    @JsonIgnore
+    private Date bidOpeningDateEnd;
+    @Transient
+    @JsonIgnore
+    private Date publishTimeStart;
+    @Transient
+    @JsonIgnore
+    private Date publishTimeEnd;
+    @Transient
+    @JsonIgnore
+    private Date createTimeStart;
+    @Transient
+    @JsonIgnore
+    private Date createTimeEnd;
 }

+ 19 - 3
src/main/resources/mapper/omni/FreemarketMapper.xml

@@ -37,6 +37,7 @@
         <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都可以引用 -->
@@ -105,7 +106,7 @@
         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
+        publish_time, create_time, update_time, data_source
     </sql>
 
     <!-- ========== 核心SQL 1:详情页查询 - 根据主键ID查询单条详情数据 ========== -->
@@ -145,8 +146,23 @@
         <if test="category != null and category != '' ">
             AND category = #{category}
         </if>
-        <if test="category != null and category != '' ">
-            AND category = #{category}
+        <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