胡半仙 3 年之前
父节点
当前提交
ca1a6efbe3

+ 7 - 1
src/main/java/com/steerinfo/dil/controller/TmstruckTimeTaskResultController.java

@@ -3,6 +3,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.ITmstruckTimeTaskResultService;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+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;
@@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,6 +44,7 @@ public class TmstruckTimeTaskResultController extends BaseRESTfulController {
     @Autowired
     ColumnDataUtil columnDataUtil;
 
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     @ApiOperation(value="司机申请开始")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
@@ -204,8 +207,11 @@ public class TmstruckTimeTaskResultController extends BaseRESTfulController {
                                           Integer pageNum,
                                           Integer pageSize,
                                           String con,
-                                          String userId
+                                          String userId,
+                                          String startTime,
+                                          String endTime
     ){
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         if (con!=null&&!con.equals("undifined")&&!con.equals("")){
             mapValue.put("con","%" + con + "%");
         }

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

@@ -730,6 +730,13 @@
     <if test="userId!=null">
       AND oo.INSERT_USERNAME LIKE #{userId}
     </if>
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TTTR.INSERT_TIME
+    </if>
     <where>
       <if test="orderNumber != null">
         <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">