浏览代码

速率表

chenshudong 3 天之前
父节点
当前提交
5ff66aa45b

+ 33 - 0
airport-blocked/src/main/java/com/sundot/airport/blocked/domain/BlockedRate.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
4 4
 import java.util.Date;
5 5
 
6 6
 import com.baomidou.mybatisplus.annotation.IdType;
7
+import com.baomidou.mybatisplus.annotation.TableField;
7 8
 import com.baomidou.mybatisplus.annotation.TableId;
8 9
 import com.baomidou.mybatisplus.annotation.TableName;
9 10
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -117,6 +118,22 @@ public class BlockedRate extends BaseEntity {
117 118
     @Excel(name = "国际及中转区域平均速率")
118 119
     private BigDecimal internationalTransferAvgRatePeak;
119 120
 
121
+    /**
122
+     * 查询开始日期
123
+     */
124
+    @TableField(exist = false)
125
+    @JsonFormat(pattern = "yyyy-MM-dd")
126
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
127
+    private Date startDate;
128
+
129
+    /**
130
+     * 查询结束日期
131
+     */
132
+    @TableField(exist = false)
133
+    @JsonFormat(pattern = "yyyy-MM-dd")
134
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
135
+    private Date endDate;
136
+
120 137
     public void setTenantId(String tenantId) {
121 138
         this.tenantId = tenantId;
122 139
     }
@@ -237,6 +254,22 @@ public class BlockedRate extends BaseEntity {
237 254
         return internationalTransferAvgRatePeak;
238 255
     }
239 256
 
257
+    public Date getStartDate() {
258
+        return startDate;
259
+    }
260
+
261
+    public void setStartDate(Date startDate) {
262
+        this.startDate = startDate;
263
+    }
264
+
265
+    public Date getEndDate() {
266
+        return endDate;
267
+    }
268
+
269
+    public void setEndDate(Date endDate) {
270
+        this.endDate = endDate;
271
+    }
272
+
240 273
     @Override
241 274
     public String toString() {
242 275
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 4 - 0
airport-blocked/src/main/resources/mapper/blocked/BlockedRateMapper.xml

@@ -71,6 +71,10 @@
71 71
             <if test="internationalTransferAvgRatePeak != null ">and international_transfer_avg_rate_peak =
72 72
                 #{internationalTransferAvgRatePeak}
73 73
             </if>
74
+            <if test="startDate != null and endDate != null">
75
+                and (stat_date >= #{startDate}
76
+                and stat_date <![CDATA[ < ]]> date_add(#{endDate} , interval 1 day))
77
+            </if>
74 78
         </where>
75 79
     </select>
76 80