作者 朱兆平

时间搜索

@@ -55,19 +55,22 @@ public class TransArriveExportController { @@ -55,19 +55,22 @@ public class TransArriveExportController {
55 @GetMapping("/selectTrans") 55 @GetMapping("/selectTrans")
56 public ResultJson<PageInfo<TRANSTOARRIVEEXPORT>> selectPrediction(@RequestParam(value = "customscode", required = false) String customscode, 56 public ResultJson<PageInfo<TRANSTOARRIVEEXPORT>> selectPrediction(@RequestParam(value = "customscode", required = false) String customscode,
57 @RequestParam(value = "username", required = false) String username, 57 @RequestParam(value = "username", required = false) String username,
58 - @RequestParam(value = "trafmode", required = false) String trafmode, 58 + @RequestParam(value = "trnmode", required = false) String trnmode,
59 @RequestParam(value = "unloadcode", required = false) String unloadcode, 59 @RequestParam(value = "unloadcode", required = false) String unloadcode,
60 - @RequestParam(value = "creattime", required = false) String creattime, 60 + @RequestParam(value = "startDate", required = false) String startDate,
  61 + @RequestParam(value = "endDate", required = false) String endDate,
61 @RequestParam(value = "pageNum",required = false,defaultValue = "1") int pageNum, 62 @RequestParam(value = "pageNum",required = false,defaultValue = "1") int pageNum,
62 @RequestParam(value = "pageSize",required = false,defaultValue = "100") int pageSize){ 63 @RequestParam(value = "pageSize",required = false,defaultValue = "100") int pageSize){
63 TRANSTOARRIVEEXPORT trans=new TRANSTOARRIVEEXPORT(); 64 TRANSTOARRIVEEXPORT trans=new TRANSTOARRIVEEXPORT();
64 - if(StringUtils.isNotEmpty(creattime)){  
65 - Date flight_Date = DateUtil.parseDate(creattime,"yyyyMMdd");  
66 - trans.setCreattime(flight_Date); 65 + if(StringUtils.isNotEmpty(endDate) && StringUtils.isNotEmpty(startDate)){
  66 + Date start = DateUtil.parseDate(startDate,"yyyy-MM-dd");
  67 + Date end = DateUtil.parseDate(endDate,"yyyy-MM-dd");
  68 + trans.setCreattimeStart(start);
  69 + trans.setCreattimeEnd(end);
67 } 70 }
68 trans.setCustomscode(customscode); 71 trans.setCustomscode(customscode);
69 trans.setUsername(username); 72 trans.setUsername(username);
70 - trans.setTrafmode(trafmode); 73 + trans.setTrnmode(trnmode);
71 trans.setUnloadcode(unloadcode); 74 trans.setUnloadcode(unloadcode);
72 PageInfo<TRANSTOARRIVEEXPORT> pageInfo = transArriveExportService.selectTrans(trans,pageNum,pageSize); 75 PageInfo<TRANSTOARRIVEEXPORT> pageInfo = transArriveExportService.selectTrans(trans,pageNum,pageSize);
73 return new ResultJson("200","success",pageInfo); 76 return new ResultJson("200","success",pageInfo);
@@ -70,6 +70,8 @@ public class TRANSTOARRIVEEXPORT { @@ -70,6 +70,8 @@ public class TRANSTOARRIVEEXPORT {
70 private String username; 70 private String username;
71 71
72 private Date creattime; 72 private Date creattime;
  73 + private Date creattimeStart;
  74 + private Date creattimeEnd;
73 75
74 private String dstatus; 76 private String dstatus;
75 77
@@ -363,6 +365,22 @@ public class TRANSTOARRIVEEXPORT { @@ -363,6 +365,22 @@ public class TRANSTOARRIVEEXPORT {
363 this.updatetime = updatetime; 365 this.updatetime = updatetime;
364 } 366 }
365 367
  368 + public Date getCreattimeStart() {
  369 + return creattimeStart;
  370 + }
  371 +
  372 + public void setCreattimeStart(Date creattimeStart) {
  373 + this.creattimeStart = creattimeStart;
  374 + }
  375 +
  376 + public Date getCreattimeEnd() {
  377 + return creattimeEnd;
  378 + }
  379 +
  380 + public void setCreattimeEnd(Date creattimeEnd) {
  381 + this.creattimeEnd = creattimeEnd;
  382 + }
  383 +
366 @Override 384 @Override
367 public String toString() { 385 public String toString() {
368 return super.toString(); 386 return super.toString();
@@ -103,14 +103,14 @@ @@ -103,14 +103,14 @@
103 <if test="username != null and username != ''"> 103 <if test="username != null and username != ''">
104 and USERNAME = #{username,jdbcType=VARCHAR} 104 and USERNAME = #{username,jdbcType=VARCHAR}
105 </if> 105 </if>
106 - <if test="trafmode != null and trafmode != ''" >  
107 - and TrafMode = #{trafmode,jdbcType=VARCHAR} 106 + <if test="trnmode != null and trnmode != ''" >
  107 + and TrnMode = #{trnmode,jdbcType=VARCHAR}
108 </if> 108 </if>
109 <if test="unloadcode != null and unloadcode != ''" > 109 <if test="unloadcode != null and unloadcode != ''" >
110 and UnloadCode = #{unloadcode,jdbcType=VARCHAR} 110 and UnloadCode = #{unloadcode,jdbcType=VARCHAR}
111 </if> 111 </if>
112 - <if test="creattime != null" >  
113 - and #{creattime,jdbcType=TIMESTAMP} 112 + <if test="creattimeStart != null and creattimeEnd != null" >
  113 + and CREATTIME between #{creattimeStart,jdbcType=TIMESTAMP} and #{creattimeEnd,jdbcType=TIMESTAMP}
114 </if> 114 </if>
115 order by CREATTIME desc 115 order by CREATTIME desc
116 </select> 116 </select>