Переглянути джерело

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRAIN-API

liyg 2 роки тому
батько
коміт
62752d2c0d

+ 10 - 4
src/main/java/com/steerinfo/dil/controller/TmstrainLoadingResultController.java

@@ -7,6 +7,7 @@ import com.steerinfo.dil.model.TmstrainLoadingResult;
 import com.steerinfo.dil.service.ITmstrainLoadingResultService;
 import com.steerinfo.dil.util.ColumnDataUtil;
 import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
@@ -48,6 +50,7 @@ public class TmstrainLoadingResultController extends BaseRESTfulController {
 
     @Autowired
     ColumnDataUtil columnDataUtil;
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 
     @ApiOperation(value = "查询装车作业信息")
@@ -62,14 +65,17 @@ public class TmstrainLoadingResultController extends BaseRESTfulController {
                                               Integer resultType,
                                               Integer materialId,
                                               Integer supplierId,
-                                              String con) {
+                                              String con,
+                                              String startTime,
+                                              String endTime) {
 
         mapValue.put("resultType", resultType);
         mapValue.put("materialId",materialId);
         mapValue.put("supplierId",supplierId);
-        mapValue.put("pageNum",pageNum);
-        mapValue.put("pageSize",pageSize);
-        mapValue.put("con",con);
+        if (con!=null&&!"".equals(con)&&!"null".equals(con)){
+            mapValue.put("con",con);
+        }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String, Object>> tmstrainWagonLoad1 = tmstrainLoadingResultService.getTmstrainWagonLoad(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, tmstrainWagonLoad1);

+ 7 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainLoadingResultMapper.xml

@@ -830,6 +830,13 @@
       or RS.SUPPLIER_NAME like concat('%',concat(#{con},'%'))
       )
     </if>
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= t_load.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= t_load.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= t_load.INSERT_TIME
+    </if>
     order by t_load.RESULT_ID
     )
   </select>