Tiroble %!s(int64=3) %!d(string=hai) anos
pai
achega
39e40e1c8a
Modificáronse 41 ficheiros con 4389 adicións e 374 borrados
  1. 1 1
      src/main/java/com/steerinfo/DilApplicationMain.java
  2. 198 0
      src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java
  3. 5 0
      src/main/java/com/steerinfo/dil/controller/TestController.java
  4. 104 3
      src/main/java/com/steerinfo/dil/controller/TmstruckReceiptResultController.java
  5. 14 0
      src/main/java/com/steerinfo/dil/mapper/OffSiteTransportationMapper.java
  6. 4 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.java
  7. 63 50
      src/main/java/com/steerinfo/dil/model/TmstruckReceiptResult.java
  8. 10 0
      src/main/java/com/steerinfo/dil/service/ITmstruckReceiptResultService.java
  9. 10 0
      src/main/java/com/steerinfo/dil/service/OffSiteTransportationService.java
  10. 111 0
      src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java
  11. 19 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java
  12. 31 0
      src/main/java/com/steerinfo/dil/service/impl/TmstruckReceiptResultServiceImpl.java
  13. 12 0
      src/main/java/com/steerinfo/route/config/FileUtils.java
  14. 234 0
      src/main/java/com/steerinfo/route/config/ImageFileUtils.java
  15. 118 0
      src/main/java/com/steerinfo/route/controller/TmstruckArrivalResultController.java
  16. 30 0
      src/main/java/com/steerinfo/route/controller/TmstruckReceiptResultChildController.java
  17. 1 0
      src/main/java/com/steerinfo/route/controller/ZhongJiaoXingLuContoller.java
  18. 30 0
      src/main/java/com/steerinfo/route/mapper/TmstruckArrivalResultMapper.java
  19. 13 0
      src/main/java/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.java
  20. 184 0
      src/main/java/com/steerinfo/route/model/TmstruckArrivalResult.java
  21. 184 0
      src/main/java/com/steerinfo/route/model/TmstruckReceiptResultChild.java
  22. 4 0
      src/main/java/com/steerinfo/route/model/VcMeasurerec.java
  23. 34 0
      src/main/java/com/steerinfo/route/service/ITmstruckArrivalResultService.java
  24. 22 0
      src/main/java/com/steerinfo/route/service/ITmstruckReceiptResultChildService.java
  25. 2 0
      src/main/java/com/steerinfo/route/service/RouteService.java
  26. 485 15
      src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java
  27. 106 0
      src/main/java/com/steerinfo/route/service/impl/TmstruckArrivalResultServiceImpl.java
  28. 50 0
      src/main/java/com/steerinfo/route/service/impl/TmstruckReceiptResultChildServiceImpl.java
  29. 69 86
      src/main/java/com/steerinfo/route/threeRequest/ZhongJiaoXingLu.java
  30. 4 4
      src/main/java/com/steerinfo/route/util/LngLonUtil.java
  31. 4 3
      src/main/java/com/steerinfo/route/vo/FullPathVisualizationTo/Result.java
  32. 82 0
      src/main/java/com/steerinfo/route/vo/Map/RunRoutePoint.java
  33. 29 9
      src/main/java/com/steerinfo/route/vo/Map/StartAndEndRoute.java
  34. 5 0
      src/main/resources/application-dev.yml
  35. 5 1
      src/main/resources/application-prod.yml
  36. 4 4
      src/main/resources/bootstrap.yml
  37. 252 0
      src/main/resources/com/steerinfo/dil/mapper/OffSiteTransportationMapper.xml
  38. 392 198
      src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml
  39. 544 0
      src/main/resources/com/steerinfo/route/mapper/TmstruckArrivalResultMapper.xml
  40. 347 0
      src/main/resources/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.xml
  41. 573 0
      src/main/resources/com/steerinfo/route/mapper/TmstruckReceiptResultMapper.xml

+ 1 - 1
src/main/java/com/steerinfo/DilApplicationMain.java

@@ -16,7 +16,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 @SpringBootApplication
 @ServletComponentScan
 @EnableScheduling
-@MapperScan({"com.steerinfo.dil.mapper"})
+@MapperScan({"com.steerinfo.dil.mapper","com.steerinfo.route.mapper"})
 @EnableFeignClients(basePackages = "com.steerinfo.dil.feign")
 @EnableDiscoveryClient
 public class DilApplicationMain {

+ 198 - 0
src/main/java/com/steerinfo/dil/controller/OffSiteTransportationController.java

@@ -0,0 +1,198 @@
+package com.steerinfo.dil.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
+import com.steerinfo.dil.service.impl.OffSiteTransportationServiceImpl;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import com.steerinfo.route.config.ImageFileUtils;
+import com.steerinfo.route.service.impl.RouteServiceImpl;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartRequest;
+
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+
+@Api("厂外运输接口")
+@RestController
+@RequestMapping("/${api.version}/pathDisplay")
+public class OffSiteTransportationController extends BaseRESTfulController {
+    @Autowired
+    private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
+    @Autowired
+    private RouteServiceImpl routeService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    @Autowired
+    ImageFileUtils imageFileUtils;
+
+
+    @Autowired
+    OffSiteTransportationServiceImpl offSiteTransportationService;
+    @ApiOperation("保存路径")
+    @PostMapping("/savePath")
+    public CompletableFuture<String> savePath() throws Exception {
+
+        Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2022032400030239");
+        parem.put("turnOf","0");
+        return routeService.createTotalResult(parem);
+        //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
+        //初始化请求参数
+//        HashMap<String,Object> mapValue=new HashMap<>();
+//        mapValue.put("orderNumber","WYSDD2021091000000001");
+//        mapValue.put("capacityNumber","豫SB6238");
+//        mapValue.put("resultOutGateTime","2021-11-17 14:20:19");
+//        mapValue.put("turnOf","0");
+//        mapValue.put("shipperName","四川达州钢铁集团有限");
+//        mapValue.put("receiveAddress","长沙市");
+//        return routeService.createTotalResult(mapValue);
+    }
+    @ApiOperation("全路径查询")
+    @PostMapping("/fullPath")
+    public Object fullPath(String orderNumber) throws Exception {
+        //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
+        //初始化请求参数
+        HashMap<String,Object> mapValue=new HashMap<>();
+        mapValue.put("orderNumber",orderNumber);
+        return routeService.fullPathVisualization(mapValue);
+    }
+
+    @ApiOperation("查询在途运输")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
+            @ApiImplicitParam(name = "apiId", value = "动态表头", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer")
+    })
+    @PostMapping("/getInTransitTransportation")
+    public RESTfulResult getInTransitTransportation(@RequestBody Map<String,Object> mapValue,
+                                                    @RequestParam(required = true,defaultValue = "468",name = "apiId")Integer apiId,
+                                                    @RequestParam(required = false,defaultValue = "1",name = "pageNum")Integer pageNum,
+                                                    @RequestParam(required = false,defaultValue = "20",name = "pageSize")Integer pageSize
+                                                    )
+    {
+        List<Map<String,Object>> filter= offSiteTransportationService.getInTransitTransportation(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        List<Map<String,Object>> list= offSiteTransportationService.getInTransitTransportation(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, filter,list);
+        return success(pageList);
+    }
+
+    @PostMapping(value = "/addTmstruckReceiptResult", headers = "content-type=multipart/form-data")
+    public synchronized RESTfulResult addTmstruckReceiptResult(@RequestPart("request") MultipartRequest request, Integer num, String orderNumber, String resultArrivalAddress, Integer imgcount3, Integer imgcount4) throws Exception {
+
+        Map<String,Object> map = new HashMap<String,Object>();
+        map.put("orderNumber",orderNumber);
+        map.put("resultArrivalAddress",resultArrivalAddress);
+        Integer orderStatus = offSiteTransportationService.getOrderStatus(map);
+        if (orderStatus!=null&&orderStatus==2){
+            return failed();
+        }
+        //多选图片变量
+        List<String> fourFiles=new ArrayList<String>();
+
+        MultipartFile file=null;
+        int fourcount=1;
+        for (int i=0;i<num;i++){
+            file=request.getFile("file"+i);
+            if (i==0){
+                String url=imageFileUtils.updateFile(file);
+                map.put("url1",url);
+            }else if (i==1){
+                String url=imageFileUtils.updateFile(file);
+                map.put("url2",url);
+            }else if (imgcount3==1&&i==2){
+                String url=imageFileUtils.updateFile(file);
+                map.put("url3",url);
+
+            }else {
+                String url=imageFileUtils.updateFile(file);
+                fourFiles.add(url);
+                fourcount++;
+            }
+        }
+        map.put("fourFiles",fourFiles);
+        Integer resTfulResult = offSiteTransportationService.addTmstruckReceiptResult(map);
+//        if (!resTfulResult.getData().toString().equals("4")){
+//            //保存路线
+//            String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder+":"+orderNumber);
+//            HashMap mapValue = JSON.parseObject(redisJson, HashMap.class);
+//            String json = zhongJiaoXingLu.visualRoute(mapValue);
+//            ViewVisualization to=null;
+//            if (json!=null){
+//                //设置60天后过期
+//                Calendar calendar=Calendar.getInstance();
+//                long agoTime= calendar.getTime().getTime();
+//                calendar.add(Calendar.MONTH,2);
+//                long lateTime= calendar.getTime().getTime();
+//                long saveTime=(lateTime-agoTime)/1000;
+//                redisTemplate.opsForValue().set(prefixLine+":"+orderNumber, json, saveTime, TimeUnit.SECONDS);
+//                //删除订单
+//                redisTemplate.delete(prefixOrder+":"+orderNumber);
+//                redisTemplate.delete(prefixOrder+":"+orderNumber+suffix);
+//                //添加运输距离
+//                to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+//
+//            }else {
+//                System.out.println("数据为空");
+//                System.out.println(orderNumber);
+//                HashMap<String,Object> hashMap=new HashMap();
+//                hashMap.put("orderNumber",orderNumber);
+//                RESTfulResult startAndEndCapacityNumber = tmsFeign.getStartAndEndCapacityNumber(hashMap);
+//                System.out.println(hashMap);
+//                System.out.println(startAndEndCapacityNumber);
+//                HashMap<String,Object> resultMap= (HashMap<String, Object>) startAndEndCapacityNumber.getData();
+//                if (resultMap!=null){
+//                    json= getPathJSON(resultMap.get("capacityNumber").toString(),resultMap.get("resultOutGateTime").toString());
+//
+//
+//                    if (json!=null&&!json.equals("")){
+//                        to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+//                    }
+//                }
+//            }
+//
+//            if (to!=null&&to.getResult()!=null&&to.getResult().getRunDistance()!=null){
+//                Map<String,Object> ordermap=new HashMap<>();
+//                ordermap.put("orderNumber",orderNumber);
+//                ordermap.put("orderMileage",to.getResult().getRunDistance()==null?"1":to.getResult().getRunDistance());
+//                omsFeign.insertOrderMileage(ordermap);
+//
+//            }else {
+//                if (to!=null&&to.getStatus()==1006){
+//
+//                    Map<String,Object> ordermap=new HashMap<>();
+//                    ordermap.put("orderNumber",orderNumber);
+//                    ordermap.put("orderMileage","-1");
+//                    omsFeign.insertOrderMileage(ordermap);
+//                }else if (to!=null&&to.getStatus()==1001){
+//                    Map<String,Object> ordermap=new HashMap<>();
+//                    ordermap.put("orderNumber",orderNumber);
+//                    ordermap.put("orderMileage","1");
+//                    omsFeign.insertOrderMileage(ordermap);
+//                } else {
+//                    System.out.println("不清楚的状态值");
+//                    System.out.println(to);
+//                    Map<String,Object> ordermap=new HashMap<>();
+//                    ordermap.put("orderNumber",orderNumber);
+//                    ordermap.put("orderMileage","-1");
+//                    omsFeign.insertOrderMileage(ordermap);
+//                }
+//
+//            }
+       // }
+
+
+        return null;
+    }
+}

+ 5 - 0
src/main/java/com/steerinfo/dil/controller/TestController.java

@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.HashMap;
@@ -48,8 +49,12 @@ public class TestController extends BaseRESTfulController {
         return routeService.fullPathVisualization(mapValue);
     }
 
+
+
+
     @PostMapping("/addMao")
     public int addMaoMeasureCommission(@RequestBody(required = false) Map<String, Object> map){
         return tmstruckMeasureCommissionService.addMaoMeasureCommission(map);
     }
+
 }

+ 104 - 3
src/main/java/com/steerinfo/dil/controller/TmstruckReceiptResultController.java

@@ -1,6 +1,8 @@
 package com.steerinfo.dil.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.steerinfo.dil.feign.ESFeign;
+import com.steerinfo.dil.model.TmstruckReceiptResult;
 import com.steerinfo.dil.service.ITmstruckReceiptResultService;
 
 import com.steerinfo.dil.util.BaseRESTfulController;
@@ -8,15 +10,21 @@ import com.steerinfo.dil.util.ColumnDataUtil;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
+import com.steerinfo.route.mapper.TmstruckArrivalResultMapper;
+import com.steerinfo.route.model.TmstruckReceiptResultChild;
+import com.steerinfo.route.service.impl.TmstruckReceiptResultChildServiceImpl;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartRequest;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 /**
  * TmstruckReceiptResult RESTful接口:
@@ -37,6 +45,10 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
 
     @Autowired
     ITmstruckReceiptResultService tmstruckReceiptResultService;
+    @Autowired
+    TmstruckArrivalResultMapper tmstruckArrivalResultMapper;
+    @Autowired
+    TmstruckReceiptResultChildServiceImpl tmstruckReceiptResultChildService;
 
     @Autowired
     ESFeign esFeign;
@@ -100,4 +112,93 @@ public class TmstruckReceiptResultController extends BaseRESTfulController {
         int i = tmstruckReceiptResultService.addSteelNzReceiptResult(map);
         return success(i);
     }
+
+    /**
+     * 新增收货实绩
+     * @param map
+     * @return
+     */
+    @ApiOperation(value="新增收货实绩")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "map", value = "收货实绩map", required = false, dataType = "java.util.Map")
+    })
+    @PostMapping(value = "/addTmstruckReceiptResult")
+    public RESTfulResult addTmstruckReceiptResult(@RequestBody(required = false) Map<String, Object> map){
+        BigDecimal alreadyExistsArrivalResult = tmstruckArrivalResultMapper.alreadyExistsArrivalResult((String) map.get("orderNumber"));
+        if(alreadyExistsArrivalResult!=null){
+            TmstruckReceiptResult tmstruckReceiptResult = new TmstruckReceiptResult();
+            //获取运输订单号和收货点地址
+            String orderNumber = (String) map.get("orderNumber");
+            String resultArrivalAddress = (String) map.get("resultArrivalAddress");
+            //获取空货箱照片、已签字的送货单照片
+            String resultEmptyContainerPhoto = (String) map.get("url1");
+            String resultSignedNotePhoto = (String) map.get("url2");
+            tmstruckReceiptResult.setResultArrivalAddress(resultArrivalAddress);
+            tmstruckReceiptResult.setResultEmptyContainerPhoto(resultEmptyContainerPhoto);
+            tmstruckReceiptResult.setResultSignedNotePhoto(resultSignedNotePhoto);
+            if(map.containsKey("url3")){
+                //如果有,获取客户签收单照片
+                String resultReceiveNotePhoto = (String) map.get("url3");
+                tmstruckReceiptResult.setResultReceiveNotePhoto(resultReceiveNotePhoto);
+            }
+            //新增收货实绩主表
+            BigDecimal receiptResultId = tmstruckReceiptResultService.addTmstruckReceiptResult(orderNumber, tmstruckReceiptResult);
+            //初始化收货实绩子表信息
+            TmstruckReceiptResultChild tmstruckReceiptResultChild = new TmstruckReceiptResultChild();
+            //关联收货实绩主表
+            tmstruckReceiptResultChild.setReceiptResultId(receiptResultId);
+            //如果有,获取最多三张其他照片
+            if(map.containsKey("fourFiles")){
+                List<String> fourFiles = (List<String>) map.get("fourFiles");
+                if(fourFiles.size()==0){}
+                else if(fourFiles.size()==1){
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                }else if(fourFiles.size()==2){
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
+                }else {
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
+                    tmstruckReceiptResultChild.setOtherPhoto3(fourFiles.get(2));
+                }
+            }
+            //新增收货实绩子表
+            int i = tmstruckReceiptResultChildService.addTmstruckReceiptResultChild(tmstruckReceiptResultChild);
+            return success(i);
+        }else{
+            return success(4);
+        }
+
+    }
+
+
+
+    @ApiOperation(value="展示收货实绩信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(137)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getReceiptResult")
+    public RESTfulResult getReceiptResult(@RequestBody(required=false) Map<String, Object> mapValue,
+                                          Integer apiId,
+                                          Integer pageNum,
+                                          Integer pageSize){
+
+        if(mapValue.containsKey("startTime")&&mapValue.containsKey("endTime")){
+            Date startDate=new Date(Long.parseLong(mapValue.get("startTime").toString())) ;
+            Date endDate=new Date(Long.parseLong(mapValue.get("endTime").toString())) ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.replace("startTime",startTime1);
+            mapValue.replace("endTime",endTime1);
+        }
+        List<Map<String, Object>> receiptResultInfo = tmstruckReceiptResultService.getReceiptResultInfo(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> receiptResultInfo1 = tmstruckReceiptResultService.getReceiptResultInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,receiptResultInfo,receiptResultInfo1);
+        return success(pageList);
+    }
 }

+ 14 - 0
src/main/java/com/steerinfo/dil/mapper/OffSiteTransportationMapper.java

@@ -0,0 +1,14 @@
+package com.steerinfo.dil.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+@Mapper
+public interface OffSiteTransportationMapper {
+    List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue);
+
+    Map<String, Object> getTruckFactoryResult(String orderNumber);
+
+    Integer getOrderStatu(String orderNumber);
+}

+ 4 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.java

@@ -32,4 +32,8 @@ public interface TmstruckReceiptResultMapper extends IBaseMapper<TmstruckReceipt
 
     //查询是否已收过货
     Integer getReceiptResult(BigDecimal resultTotalId);
+
+
+    //获取收货实绩信息
+    List<Map<String, Object>> getReceiptResultInfo(Map<String, Object> map);
 }

+ 63 - 50
src/main/java/com/steerinfo/dil/model/TmstruckReceiptResult.java

@@ -21,6 +21,24 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="总实绩ID",required=false)
     private BigDecimal resultTotalId;
 
+    /**
+     * 空货箱照片(RESULT_EMPTY_CONTAINER_PHOTO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="空货箱照片",required=false)
+    private String resultEmptyContainerPhoto;
+
+    /**
+     * 已签字的送货单照片(RESULT_SIGNED_NOTE_PHOTO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="已签字的送货单照片",required=false)
+    private String resultSignedNotePhoto;
+
+    /**
+     * 客户签收单照片(RESULT_RECEIVE_NOTE_PHOTO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="客户签收单照片",required=false)
+    private String resultReceiveNotePhoto;
+
     /**
      * 异地库ID(WAREHOUSE_ID,DECIMAL,38)
      */
@@ -56,30 +74,17 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
      */
     @ApiModelProperty(value="记录创建或修改备注",required=false)
     private String insertUpdateRemark;
-
     /**
-     * 状态:0 为卸货后新增虚拟收货实绩  1 为计皮完成后真实收货实绩(STATUS,DECIMAL,0)
+     * 收货状态(INSERT_UPDATE_REMARK,VARCHAR,100)
      */
-    @ApiModelProperty(value="状态:0 为卸货后新增虚拟收货实绩  1 为计皮完成后真实收货实绩",required=false)
+    @ApiModelProperty(value="收货状态",required=false)
     private BigDecimal status;
 
     /**
-     * 空货箱照片(RESULT_EMPTY_CONTAINER_PHOTO,BLOB,4000)
+     * 抵达收货点的地址(RESULT_ARRIVAL_ADDRESS,VARCHAR,100)
      */
-    @ApiModelProperty(value="空货箱照片",required=false)
-    private byte[] resultEmptyContainerPhoto;
-
-    /**
-     * 已签字的送货单照片(RESULT_SIGNED_NOTE_PHOTO,BLOB,4000)
-     */
-    @ApiModelProperty(value="已签字的送货单照片",required=false)
-    private byte[] resultSignedNotePhoto;
-
-    /**
-     * 客户签收单照片(RESULT_RECEIVE_NOTE_PHOTO,BLOB,4000)
-     */
-    @ApiModelProperty(value="客户签收单照片",required=false)
-    private byte[] resultReceiveNotePhoto;
+    @ApiModelProperty(value="抵达收货点的地址",required=false)
+    private String resultArrivalAddress;
 
     private static final long serialVersionUID = 1L;
 
@@ -109,6 +114,38 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
         this.resultTotalId = resultTotalId;
     }
 
+    public String getResultEmptyContainerPhoto() {
+        return resultEmptyContainerPhoto;
+    }
+
+    public void setResultEmptyContainerPhoto(String resultEmptyContainerPhoto) {
+        this.resultEmptyContainerPhoto = resultEmptyContainerPhoto == null ? null : resultEmptyContainerPhoto.trim();
+    }
+
+    public String getResultSignedNotePhoto() {
+        return resultSignedNotePhoto;
+    }
+
+    public void setResultSignedNotePhoto(String resultSignedNotePhoto) {
+        this.resultSignedNotePhoto = resultSignedNotePhoto == null ? null : resultSignedNotePhoto.trim();
+    }
+
+    public String getResultReceiveNotePhoto() {
+        return resultReceiveNotePhoto;
+    }
+
+    public void setResultReceiveNotePhoto(String resultReceiveNotePhoto) {
+        this.resultReceiveNotePhoto = resultReceiveNotePhoto == null ? null : resultReceiveNotePhoto.trim();
+    }
+
+    public BigDecimal getStatus() {
+        return status;
+    }
+
+    public void setStatus(BigDecimal status) {
+        this.status = status;
+    }
+
     public BigDecimal getWarehouseId() {
         return warehouseId;
     }
@@ -157,36 +194,12 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
         this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
     }
 
-    public BigDecimal getStatus() {
-        return status;
+    public String getResultArrivalAddress() {
+        return resultArrivalAddress;
     }
 
-    public void setStatus(BigDecimal status) {
-        this.status = status;
-    }
-
-    public byte[] getResultEmptyContainerPhoto() {
-        return resultEmptyContainerPhoto;
-    }
-
-    public void setResultEmptyContainerPhoto(byte[] resultEmptyContainerPhoto) {
-        this.resultEmptyContainerPhoto = resultEmptyContainerPhoto;
-    }
-
-    public byte[] getResultSignedNotePhoto() {
-        return resultSignedNotePhoto;
-    }
-
-    public void setResultSignedNotePhoto(byte[] resultSignedNotePhoto) {
-        this.resultSignedNotePhoto = resultSignedNotePhoto;
-    }
-
-    public byte[] getResultReceiveNotePhoto() {
-        return resultReceiveNotePhoto;
-    }
-
-    public void setResultReceiveNotePhoto(byte[] resultReceiveNotePhoto) {
-        this.resultReceiveNotePhoto = resultReceiveNotePhoto;
+    public void setResultArrivalAddress(String resultArrivalAddress) {
+        this.resultArrivalAddress = resultArrivalAddress == null ? null : resultArrivalAddress.trim();
     }
 
     @Override
@@ -197,16 +210,16 @@ public class TmstruckReceiptResult implements IBasePO<BigDecimal> {
         sb.append("Hash = ").append(hashCode());
         sb.append(", resultId=").append(resultId);
         sb.append(", resultTotalId=").append(resultTotalId);
+        sb.append(", resultEmptyContainerPhoto=").append(resultEmptyContainerPhoto);
+        sb.append(", resultSignedNotePhoto=").append(resultSignedNotePhoto);
+        sb.append(", resultReceiveNotePhoto=").append(resultReceiveNotePhoto);
         sb.append(", warehouseId=").append(warehouseId);
         sb.append(", insertUsername=").append(insertUsername);
         sb.append(", insertTime=").append(insertTime);
         sb.append(", updateUsername=").append(updateUsername);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
-        sb.append(", status=").append(status);
-        sb.append(", resultEmptyContainerPhoto=").append(resultEmptyContainerPhoto);
-        sb.append(", resultSignedNotePhoto=").append(resultSignedNotePhoto);
-        sb.append(", resultReceiveNotePhoto=").append(resultReceiveNotePhoto);
+        sb.append(", resultArrivalAddress=").append(resultArrivalAddress);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 10 - 0
src/main/java/com/steerinfo/dil/service/ITmstruckReceiptResultService.java

@@ -1,5 +1,10 @@
 package com.steerinfo.dil.service;
 
+
+
+import com.steerinfo.dil.model.TmstruckReceiptResult;
+
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
@@ -24,4 +29,9 @@ public interface ITmstruckReceiptResultService{
     //新增钢材到异地库达州站驻港人员确定收货
     int addSteelNzReceiptResult(Map<String, Object> map);
 
+    //添加收货实绩主表
+    BigDecimal addTmstruckReceiptResult(String orderNumber, TmstruckReceiptResult tmstruckReceiptResult);
+    //获取收货实绩信息
+    List<Map<String, Object>> getReceiptResultInfo(Map<String, Object> map);
+
 }

+ 10 - 0
src/main/java/com/steerinfo/dil/service/OffSiteTransportationService.java

@@ -0,0 +1,10 @@
+package com.steerinfo.dil.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface OffSiteTransportationService {
+    List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue);
+
+    Integer getOrderStatus(Map<String, Object> map);
+}

+ 111 - 0
src/main/java/com/steerinfo/dil/service/impl/OffSiteTransportationServiceImpl.java

@@ -0,0 +1,111 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.OffSiteTransportationMapper;
+import com.steerinfo.dil.model.TmstruckReceiptResult;
+import com.steerinfo.dil.service.ITmstruckReceiptResultService;
+import com.steerinfo.dil.service.OffSiteTransportationService;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.route.mapper.TmstruckArrivalResultMapper;
+import com.steerinfo.route.model.TmstruckReceiptResultChild;
+import com.steerinfo.route.service.ITmstruckReceiptResultChildService;
+import com.steerinfo.route.service.impl.RouteServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+@Service
+public class OffSiteTransportationServiceImpl implements OffSiteTransportationService {
+    @Autowired
+    private RouteServiceImpl routeService;
+    @Autowired
+    OffSiteTransportationMapper offSiteTransportationMapper;
+    @Autowired
+    private TmstruckArrivalResultMapper tmstruckArrivalResultMapper;
+    @Autowired
+    private ITmstruckReceiptResultService  tmstruckReceiptResultService;
+    @Autowired
+    private  ITmstruckReceiptResultChildService  tmstruckReceiptResultChildService;
+    @Override
+    public List<Map<String, Object>> getInTransitTransportation(Map<String, Object> mapValue) {
+        return offSiteTransportationMapper.getInTransitTransportation(mapValue);
+    }
+
+    @Override
+    public Integer getOrderStatus(Map<String, Object> map) {
+        String orderNumber = (String) map.get("orderNumber");
+        //判断是否已经结束
+        Integer statu= offSiteTransportationMapper.getOrderStatu(orderNumber);
+        if (statu==null){
+            return 1;
+        }
+        return statu;
+    }
+
+    public String savePath() throws Exception {
+
+        Map<String, Object> parem=offSiteTransportationMapper.getTruckFactoryResult("WYSDD2021091000000002");
+        parem.put("turnOf","0");
+        return routeService.saveRoute(parem).toString();
+        //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
+        //初始化请求参数
+//        HashMap<String,Object> mapValue=new HashMap<>();
+//        mapValue.put("orderNumber","WYSDD2021091000000001");
+//        mapValue.put("capacityNumber","豫SB6238");
+//        mapValue.put("resultOutGateTime","2021-11-17 14:20:19");
+//        mapValue.put("turnOf","0");
+//        mapValue.put("shipperName","四川达州钢铁集团有限");
+//        mapValue.put("receiveAddress","长沙市");
+//        return routeService.saveRoute(parem).toString();
+    }
+
+    public Integer addTmstruckReceiptResult(@RequestBody(required = false) Map<String,Object> map){
+        BigDecimal alreadyExistsArrivalResult = tmstruckArrivalResultMapper.alreadyExistsArrivalResult((String) map.get("orderNumber"));
+        if(alreadyExistsArrivalResult!=null){
+            TmstruckReceiptResult tmstruckReceiptResult = new TmstruckReceiptResult();
+            //获取运输订单号和收货点地址
+            String orderNumber = (String) map.get("orderNumber");
+            String resultArrivalAddress = (String) map.get("resultArrivalAddress");
+            //获取空货箱照片、已签字的送货单照片
+            String resultEmptyContainerPhoto = (String) map.get("url1");
+            String resultSignedNotePhoto = (String) map.get("url2");
+            tmstruckReceiptResult.setResultArrivalAddress(resultArrivalAddress);
+            tmstruckReceiptResult.setResultEmptyContainerPhoto(resultEmptyContainerPhoto);
+            tmstruckReceiptResult.setResultSignedNotePhoto(resultSignedNotePhoto);
+            if(map.containsKey("url3")){
+                //如果有,获取客户签收单照片
+                String resultReceiveNotePhoto = (String) map.get("url3");
+                tmstruckReceiptResult.setResultReceiveNotePhoto(resultReceiveNotePhoto);
+            }
+            //新增收货实绩主表
+            BigDecimal receiptResultId = tmstruckReceiptResultService.addTmstruckReceiptResult(orderNumber, tmstruckReceiptResult);
+            //初始化收货实绩子表信息
+            TmstruckReceiptResultChild tmstruckReceiptResultChild = new TmstruckReceiptResultChild();
+            //关联收货实绩主表
+            tmstruckReceiptResultChild.setReceiptResultId(receiptResultId);
+            //如果有,获取最多三张其他照片
+            if(map.containsKey("fourFiles")){
+                List<String> fourFiles = (List<String>) map.get("fourFiles");
+                if(fourFiles.size()==0){}
+                else if(fourFiles.size()==1){
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                }else if(fourFiles.size()==2){
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
+                }else {
+                    tmstruckReceiptResultChild.setOtherPhoto1(fourFiles.get(0));
+                    tmstruckReceiptResultChild.setOtherPhoto2(fourFiles.get(1));
+                    tmstruckReceiptResultChild.setOtherPhoto3(fourFiles.get(2));
+                }
+            }
+            //新增收货实绩子表
+            int i = tmstruckReceiptResultChildService.addTmstruckReceiptResultChild(tmstruckReceiptResultChild);
+            return i;
+        }else{
+            return 4;
+        }
+
+    }
+}

+ 19 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckLeaveFactoryResultServiceImpl.java

@@ -10,6 +10,7 @@ import com.steerinfo.dil.model.TmstruckLeaveFactoryResult;
 import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.dil.service.IUtilsService;
 import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.route.service.impl.RouteServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,6 +38,10 @@ import java.util.Map;
 @Service(value = "tmstruckLeaveFactoryResultService")
 public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFactoryResultService {
 
+    @Autowired
+    private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
+    @Autowired
+    private RouteServiceImpl routeService;
     @Autowired
     private TmstruckLeaveFactoryResultMapper tmstruckLeaveFactoryResultMapper;
 
@@ -52,6 +57,9 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
     @Autowired
     private RulesServiceImpl rulesService;
 
+    @Autowired
+    OffSiteTransportationServiceImpl offSiteTransportationService;
+
     @Autowired
     OmsFeign omsFeign;
 
@@ -167,6 +175,15 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         i += utilsService.updateOrderLineSequence(map);
         switch (orderType.intValue()){
             case 1:
+                try {
+                    //销售厂外监控
+                    Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult(orderNumber);
+                    parem.put("turnOf","0");
+                    routeService.createTotalResult(parem);
+                }catch (Exception ex){
+
+                }
+
                 break;
             case 2:
             case 3:
@@ -221,6 +238,8 @@ public class TmstruckLeaveFactoryResultServiceImpl implements ITmstruckLeaveFact
         return i;
     }
 
+
+
     /**
      * 更新出厂实绩
      * @param mapValue {运输订单号:orderNumber 门岗名称:gatepostName}

+ 31 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckReceiptResultServiceImpl.java

@@ -5,6 +5,7 @@ import com.steerinfo.dil.mapper.UtilsMapper;
 import com.steerinfo.dil.model.TmstruckReceiptResult;
 import com.steerinfo.dil.service.ITmstruckReceiptResultService;
 import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.route.mapper.TmstruckArrivalResultMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -35,6 +36,36 @@ public class TmstruckReceiptResultServiceImpl implements ITmstruckReceiptResultS
     @Autowired
     private UtilsMapper utilsMapper;
 
+    @Autowired
+    private TmstruckArrivalResultMapper tmstruckArrivalResultMapper;
+
+    @Override
+    public synchronized BigDecimal addTmstruckReceiptResult(String orderNumber, TmstruckReceiptResult tmstruckReceiptResult) {
+        long id;
+        if(tmstruckReceiptResultMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = tmstruckReceiptResultMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        tmstruckReceiptResult.setResultId(new BigDecimal(id));
+        //获取并插入总实绩Id
+        BigDecimal truckTotalId = tmstruckArrivalResultMapper.getTotalIdByOrderNumber(orderNumber);
+        tmstruckReceiptResult.setResultTotalId(truckTotalId);
+        //常规字段
+        tmstruckReceiptResult.setInsertUsername("admin");
+        tmstruckReceiptResult.setInsertTime(new Date());
+        tmstruckReceiptResult.setUpdateUsername("admin");
+        tmstruckReceiptResult.setUpdateTime(new Date());
+        tmstruckReceiptResult.setInsertUpdateRemark("无");
+        tmstruckReceiptResultMapper.insert(tmstruckReceiptResult);
+        return new BigDecimal(id);
+    }
+
+    @Override
+    public List<Map<String, Object>> getReceiptResultInfo(Map<String, Object> map) {
+        return tmstruckReceiptResultMapper.getReceiptResultInfo(map);
+    }
     /**
      * 查询所有收货实绩
      * @param map

+ 12 - 0
src/main/java/com/steerinfo/route/config/FileUtils.java

@@ -0,0 +1,12 @@
+package com.steerinfo.route.config;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+public interface FileUtils {
+
+    public List<String> updateFiles(MultipartFile files[])throws Exception;
+
+     public Object downloadFile(String url) throws Exception;
+}

+ 234 - 0
src/main/java/com/steerinfo/route/config/ImageFileUtils.java

@@ -0,0 +1,234 @@
+package com.steerinfo.route.config;
+
+import com.steerinfo.framework.utils.misc.IdGenerator;
+import com.steerinfo.framework.utils.upload.UploadUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.*;
+
+@Component
+public class ImageFileUtils implements FileUtils {
+
+    @Value(value = "${piction.path:/shared}" )
+    private String path;
+
+    public static final HashMap fileTypes = new HashMap();
+
+    static {
+
+        // images
+
+        fileTypes.put("FFD8FF", "jpg");
+
+        fileTypes.put("89504E47", "png");
+
+        fileTypes.put("47494638", "gif");
+
+        fileTypes.put("49492A00", "tif");
+
+        fileTypes.put("424D", "bmp");
+
+        // CAD
+
+        fileTypes.put("41433130", "dwg");
+
+        fileTypes.put("38425053", "psd");
+
+        // 日记本
+
+        fileTypes.put("7B5C727466", "rtf");
+
+        fileTypes.put("3C3F786D6C", "xml");
+
+        fileTypes.put("68746D6C3E", "html");
+
+        // 邮件
+
+        fileTypes.put("44656C69766572792D646174653A", "eml");
+
+        fileTypes.put("D0CF11E0", "doc");
+
+        //excel2003版本文件
+
+        fileTypes.put("D0CF11E0", "xls");
+
+        fileTypes.put("5374616E64617264204A", "mdb");
+
+        fileTypes.put("252150532D41646F6265", "ps");
+
+        fileTypes.put("255044462D312E", "pdf");
+
+        fileTypes.put("504B0304", "docx");
+
+        //excel2007以上版本文件
+
+        fileTypes.put("504B0304", "xlsx");
+
+        fileTypes.put("52617221", "rar");
+
+        fileTypes.put("57415645", "wav");
+
+        fileTypes.put("41564920", "avi");
+
+        fileTypes.put("2E524D46", "rm");
+
+        fileTypes.put("000001BA", "mpg");
+
+        fileTypes.put("000001B3", "mpg");
+
+        fileTypes.put("6D6F6F76", "mov");
+
+        fileTypes.put("3026B2758E66CF11", "asf");
+
+        fileTypes.put("4D546864", "mid");
+
+        fileTypes.put("1F8B08", "gz");
+
+    }
+
+
+    /**
+     * 上传多张图片
+     * @param files
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public synchronized List<String> updateFiles(MultipartFile files[]) throws Exception {
+        //首先通过Calendard对象获得年月日
+        Calendar calendar= Calendar.getInstance();
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day= calendar.get(Calendar.DAY_OF_MONTH);
+        //上传文件夹路径
+        List<String> urls=new ArrayList<>();
+        for (int i=0;i<files.length;i++){
+            String url = UploadUtils.uploadFile(files[i], new IdGenerator(i, 10), path, File.separator+year+ File.separator+month+ File.separator+day+ File.separator);
+            urls.add(url);
+        }
+        return urls;
+    }
+
+
+    /**
+     * 上传单张图片
+     * @param file
+     * @return
+     * @throws Exception
+     */
+    public synchronized String updateFile(MultipartFile file) throws Exception {
+        //首先通过Calendard对象获得年月日
+        Calendar calendar= Calendar.getInstance();
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day= calendar.get(Calendar.DAY_OF_MONTH);
+        String url = UploadUtils.uploadFile(file, new IdGenerator(0, 10), path, File.separator+year+ File.separator+month+ File.separator+day+ File.separator);
+        return url;
+    }
+
+    /**
+     * 下载图片获得字节码
+     * @param filePath
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public Object downloadFile(String filePath) throws Exception {
+        File file = new File(filePath);
+        if(file.isDirectory()){
+
+            throw new RuntimeException("当前路径是目录");
+
+        }
+        byte[] b = bytes(file);
+        String type =getFileHeader(b);
+        String src="data:image/"+type+";base64,"+ Base64.getEncoder().encodeToString(b);
+        return src;
+    }
+
+
+
+
+    /**
+     * @return 文件头信息
+     * @author liang.pan
+     * <p>
+     * 方法描述:根据输入流获取文件头信息
+     */
+    public static String getFileHeader(byte[] b) {
+        String value = bytesToHexString(b);
+
+        if (StringUtils.startsWith(value, "FFD8FF")) {
+            value = value.substring(0, 6);
+        }
+
+        //判断什么类型的
+        Set set = fileTypes.keySet();
+        Iterator iterator = set.iterator();
+        while(iterator.hasNext()){
+            String key=iterator.next().toString();
+            if (value.contains(key)){
+                return fileTypes.get(key).toString();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @param src 要读取文件头信息的文件的byte数组
+     * @return 文件头信息
+     * @author liang.pan
+     * <p>
+     * 方法描述:将要读取文件头信息的文件的byte数组转换成string类型表示
+     */
+    private static String bytesToHexString(byte[] src) {
+        StringBuilder builder = new StringBuilder();
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        String hv;
+        for (int i = 0; i < src.length; i++) {
+            // 以十六进制(基数 16)无符号整数形式返回一个整数参数的字符串表示形式,并转换为大写
+            hv = Integer.toHexString(src[i] & 0xFF).toUpperCase();
+            if (hv.length() < 2) {
+                builder.append(0);
+            }
+            builder.append(hv);
+        }
+        return builder.toString();
+    }
+
+
+    public byte[] bytes(File file) throws Exception {
+        FileInputStream fin = new FileInputStream(file);
+        try {
+            //可能溢出,简单起见就不考虑太多,如果太大就要另外想办法,比如一次传入固定长度byte[]
+            byte[] bytes  = new byte[fin.available()];
+            //将文件内容写入字节数组,提供测试的case
+            fin.read(bytes);
+            fin.close();
+            return bytes;
+        }catch (Exception ex){
+            throw ex;
+        }
+        finally {
+            if (null != fin) {
+
+                try {
+
+                    fin.close();
+
+                } catch (IOException e) {
+
+                }
+
+            }
+        }
+    }
+}

+ 118 - 0
src/main/java/com/steerinfo/route/controller/TmstruckArrivalResultController.java

@@ -0,0 +1,118 @@
+package com.steerinfo.route.controller;
+
+import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import com.steerinfo.route.config.ImageFileUtils;
+import com.steerinfo.route.model.TmstruckArrivalResult;
+import com.steerinfo.route.service.ITmstruckArrivalResultService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * TmstruckArrivalResult RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckArrivalResult RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/tmstruckarrivalresults")
+public class TmstruckArrivalResultController extends BaseRESTfulController {
+
+    @Autowired
+    ImageFileUtils imageFileUtils;
+    @Autowired
+    ITmstruckArrivalResultService tmstruckArrivalResultService;
+
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    /**
+     * 新增抵达实绩信息
+     * @param map
+     * @return
+     */
+    @ApiOperation(value="新增抵达实绩信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "map", value = "抵达实绩map", required = false, dataType = "java.util.Map")
+    })
+    @PostMapping(value = "/addtmstruckArrivalResult2")
+    public RESTfulResult addtmstruckArrivalResult2(@RequestBody(required = false) Map<String, Object> map){
+        String orderNumber = (String) map.get("orderNumber");
+        String resultArrivalAddress = (String) map.get("resultArrivalAddress");
+        String resultFullContainerPhoto = (String) map.get("url");
+        TmstruckArrivalResult tmstruckArrivalResult = new TmstruckArrivalResult();
+        tmstruckArrivalResult.setResultArrivalAddress(resultArrivalAddress);
+        tmstruckArrivalResult.setResultFullContainerPhoto(resultFullContainerPhoto);
+        int i = tmstruckArrivalResultService.addtmstruckArrivalResult(orderNumber,tmstruckArrivalResult);
+        return success(i);
+    }
+
+    @PostMapping(value = "/addtmstruckArrivalResult")
+    public RESTfulResult addtmstruckArrivalResult(String orderNumber, String resultArrivalAddress, MultipartFile file) throws Exception {
+
+        String url = imageFileUtils.updateFile(file);
+        TmstruckArrivalResult tmstruckArrivalResult = new TmstruckArrivalResult();
+        tmstruckArrivalResult.setResultArrivalAddress(resultArrivalAddress);
+        tmstruckArrivalResult.setResultFullContainerPhoto(url);
+        int i = tmstruckArrivalResultService.addtmstruckArrivalResult(orderNumber,tmstruckArrivalResult);
+        return success(i);
+
+    }
+
+    @ApiOperation(value="展示抵达实绩信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(136)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getArrivalResultInfo")
+    public RESTfulResult getArrivalResultInfo(@RequestBody(required=false) Map<String, Object> mapValue,
+                                               Integer apiId,
+                                               Integer pageNum,
+                                               Integer pageSize){
+
+        if(mapValue.containsKey("startTime")&&mapValue.containsKey("endTime")){
+            Date startDate=new Date(Long.parseLong(mapValue.get("startTime").toString())) ;
+            Date endDate=new Date(Long.parseLong(mapValue.get("endTime").toString())) ;
+            Calendar ca = Calendar.getInstance();
+            ca.setTime(endDate);
+            ca.add(Calendar.DATE,1);
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
+            String startTime1=simpleDateFormat.format(startDate);
+            String endTime1=simpleDateFormat.format(ca.getTime());
+            mapValue.replace("startTime",startTime1);
+            mapValue.replace("endTime",endTime1);
+        }
+        List<Map<String, Object>> arrivalResultInfo = tmstruckArrivalResultService.getArrivalResultInfo(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> arrivalResultInfo1 = tmstruckArrivalResultService.getArrivalResultInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,arrivalResultInfo,arrivalResultInfo1);
+        return success(pageList);
+    }
+    @ApiOperation("通过运输订单号获得收货地址的市区")
+    @GetMapping("/getAddressDistrict")
+    public String getAddressDistrict(@RequestParam(required = true) String orderNumber){
+        String addressDistrict=tmstruckArrivalResultService.getAddressDistrict(orderNumber);
+        return addressDistrict;
+    }
+}

+ 30 - 0
src/main/java/com/steerinfo/route/controller/TmstruckReceiptResultChildController.java

@@ -0,0 +1,30 @@
+package com.steerinfo.route.controller;
+
+
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.route.service.ITmstruckReceiptResultChildService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * TmstruckReceiptResultChild RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckReceiptResultChild RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/tmstruckreceiptresultchilds")
+public class TmstruckReceiptResultChildController extends BaseRESTfulController {
+
+    @Autowired
+    ITmstruckReceiptResultChildService tmstruckReceiptResultChildService;
+
+}

+ 1 - 0
src/main/java/com/steerinfo/route/controller/ZhongJiaoXingLuContoller.java

@@ -60,4 +60,5 @@ public class ZhongJiaoXingLuContoller {
     }
 
 
+
 }

+ 30 - 0
src/main/java/com/steerinfo/route/mapper/TmstruckArrivalResultMapper.java

@@ -0,0 +1,30 @@
+package com.steerinfo.route.mapper;
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.route.model.TmstruckArrivalResult;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface TmstruckArrivalResultMapper extends IBaseMapper<TmstruckArrivalResult, BigDecimal> {
+    //获取主键最大值
+    BigDecimal selectMaxId();
+    //获取抵达实绩信息
+    List<Map<String, Object>> getArrivalResultInfo(Map<String, Object> map);
+
+    //查询是否存在抵达实绩
+    BigDecimal alreadyExistsArrivalResult(String orderNumber);
+
+    String getAddressDistrict(String orderNumber);
+
+    List<String> getAdjustment();
+
+    int updateTown(@Param("city") String city, @Param("item") String item);
+
+    //通过运输订单号获取总实绩Id
+    BigDecimal getTotalIdByOrderNumber(String capacityNumber);
+}

+ 13 - 0
src/main/java/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.java

@@ -0,0 +1,13 @@
+package com.steerinfo.route.mapper;
+
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.route.model.TmstruckReceiptResultChild;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface TmstruckReceiptResultChildMapper extends IBaseMapper<TmstruckReceiptResultChild, BigDecimal> {
+    //获取主键最大值
+    BigDecimal selectMaxId();
+}

+ 184 - 0
src/main/java/com/steerinfo/route/model/TmstruckArrivalResult.java

@@ -0,0 +1,184 @@
+package com.steerinfo.route.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="汽运抵达实绩")
+public class TmstruckArrivalResult implements IBasePO<BigDecimal> {
+    /**
+     * 实绩ID(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="实绩ID",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 作业点ID(POINT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="作业点ID",required=false)
+    private BigDecimal pointId;
+
+    /**
+     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="总实绩ID",required=false)
+    private BigDecimal resultTotalId;
+
+    /**
+     * 抵达收货点的地址(RESULT_ARRIVAL_ADDRESS,VARCHAR,20)
+     */
+    @ApiModelProperty(value="抵达收货点的地址",required=false)
+    private String resultArrivalAddress;
+
+    /**
+     * 满货箱照片(RESULT_FULL_CONTAINER_PHOTO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="满货箱照片",required=false)
+    private String resultFullContainerPhoto;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getPointId() {
+        return pointId;
+    }
+
+    public void setPointId(BigDecimal pointId) {
+        this.pointId = pointId;
+    }
+
+    public BigDecimal getResultTotalId() {
+        return resultTotalId;
+    }
+
+    public void setResultTotalId(BigDecimal resultTotalId) {
+        this.resultTotalId = resultTotalId;
+    }
+
+    public String getResultArrivalAddress() {
+        return resultArrivalAddress;
+    }
+
+    public void setResultArrivalAddress(String resultArrivalAddress) {
+        this.resultArrivalAddress = resultArrivalAddress == null ? null : resultArrivalAddress.trim();
+    }
+
+    public String getResultFullContainerPhoto() {
+        return resultFullContainerPhoto;
+    }
+
+    public void setResultFullContainerPhoto(String resultFullContainerPhoto) {
+        this.resultFullContainerPhoto = resultFullContainerPhoto == null ? null : resultFullContainerPhoto.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", pointId=").append(pointId);
+        sb.append(", resultTotalId=").append(resultTotalId);
+        sb.append(", resultArrivalAddress=").append(resultArrivalAddress);
+        sb.append(", resultFullContainerPhoto=").append(resultFullContainerPhoto);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 184 - 0
src/main/java/com/steerinfo/route/model/TmstruckReceiptResultChild.java

@@ -0,0 +1,184 @@
+package com.steerinfo.route.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="收货实绩子表")
+public class TmstruckReceiptResultChild implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(CHILD_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal childId;
+
+    /**
+     * 收货实绩ID(RECEIPT_RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="收货实绩ID",required=false)
+    private BigDecimal receiptResultId;
+
+    /**
+     * 其他照片1(OTHER_PHOTO1,VARCHAR,100)
+     */
+    @ApiModelProperty(value="其他照片1",required=false)
+    private String otherPhoto1;
+
+    /**
+     * 其他照片2(OTHER_PHOTO2,VARCHAR,100)
+     */
+    @ApiModelProperty(value="其他照片2",required=false)
+    private String otherPhoto2;
+
+    /**
+     * 其他照片3(OTHER_PHOTO3,VARCHAR,100)
+     */
+    @ApiModelProperty(value="其他照片3",required=false)
+    private String otherPhoto3;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.childId;
+    }
+
+    @Override
+    public void setId(BigDecimal childId) {
+        this.childId = childId;
+    }
+
+    public BigDecimal getChildId() {
+        return childId;
+    }
+
+    public void setChildId(BigDecimal childId) {
+        this.childId = childId;
+    }
+
+    public BigDecimal getReceiptResultId() {
+        return receiptResultId;
+    }
+
+    public void setReceiptResultId(BigDecimal receiptResultId) {
+        this.receiptResultId = receiptResultId;
+    }
+
+    public String getOtherPhoto1() {
+        return otherPhoto1;
+    }
+
+    public void setOtherPhoto1(String otherPhoto1) {
+        this.otherPhoto1 = otherPhoto1 == null ? null : otherPhoto1.trim();
+    }
+
+    public String getOtherPhoto2() {
+        return otherPhoto2;
+    }
+
+    public void setOtherPhoto2(String otherPhoto2) {
+        this.otherPhoto2 = otherPhoto2 == null ? null : otherPhoto2.trim();
+    }
+
+    public String getOtherPhoto3() {
+        return otherPhoto3;
+    }
+
+    public void setOtherPhoto3(String otherPhoto3) {
+        this.otherPhoto3 = otherPhoto3 == null ? null : otherPhoto3.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", childId=").append(childId);
+        sb.append(", receiptResultId=").append(receiptResultId);
+        sb.append(", otherPhoto1=").append(otherPhoto1);
+        sb.append(", otherPhoto2=").append(otherPhoto2);
+        sb.append(", otherPhoto3=").append(otherPhoto3);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 4 - 0
src/main/java/com/steerinfo/route/model/VcMeasurerec.java

@@ -0,0 +1,4 @@
+package com.steerinfo.route.model;
+
+public class VcMeasurerec {
+}

+ 34 - 0
src/main/java/com/steerinfo/route/service/ITmstruckArrivalResultService.java

@@ -0,0 +1,34 @@
+package com.steerinfo.route.service;
+
+
+
+import com.steerinfo.route.model.TmstruckArrivalResult;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * TmstruckArrivalResult服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckArrivalResult服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface ITmstruckArrivalResultService {
+    //新增抵达实绩
+    int addtmstruckArrivalResult(String orderNumber, TmstruckArrivalResult tmstruckArrivalResult);
+    //获取抵达实绩信息
+    List<Map<String, Object>> getArrivalResultInfo(Map<String, Object> map);
+
+    String getAddressDistrict(String orderNumber);
+
+    List<String> getAdjustment();
+
+    int updateTown(String city, String item);
+}

+ 22 - 0
src/main/java/com/steerinfo/route/service/ITmstruckReceiptResultChildService.java

@@ -0,0 +1,22 @@
+package com.steerinfo.route.service;
+
+
+import com.steerinfo.route.model.TmstruckReceiptResultChild;
+
+/**
+ * TmstruckReceiptResultChild服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckReceiptResultChild服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface ITmstruckReceiptResultChildService {
+    //添加收货实绩子表
+    int addTmstruckReceiptResultChild(TmstruckReceiptResultChild tmstruckReceiptResultChild);
+}

+ 2 - 0
src/main/java/com/steerinfo/route/service/RouteService.java

@@ -11,4 +11,6 @@ public interface RouteService {
 
     CompletableFuture<RouteVo> fullPathVisualization(HashMap mapValue) throws Exception;
 
+    public CompletableFuture<String> saveRequstionDate(Map mapValue) throws Exception;
+
 }

+ 485 - 15
src/main/java/com/steerinfo/route/service/impl/RouteServiceImpl.java

@@ -3,6 +3,7 @@ package com.steerinfo.route.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 
+import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.route.service.RouteService;
 import com.steerinfo.route.threeRequest.ZhongJiaoXingLu;
@@ -12,6 +13,7 @@ import com.steerinfo.route.util.LngLonUtil;
 import com.steerinfo.route.vo.FullPathVisualizationTo.ViewVisualization;
 import com.steerinfo.route.vo.Map.Point;
 import com.steerinfo.route.vo.Map.RouteVo;
+import com.steerinfo.route.vo.Map.RunRoutePoint;
 import com.steerinfo.route.vo.Map.StartAndEndRoute;
 import com.steerinfo.route.vo.resultJson.SearchPoint;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +36,9 @@ public class RouteServiceImpl implements RouteService {
     private RedisTemplate redisTemplate;
     @Autowired
     private ZhongJiaoXingLu zhongJiaoXingLu;
+
+    @Autowired
+    private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
     @Value("${str.tengxun.key}")
     private String key;
     @Value("${redis.prefix.order}")
@@ -43,6 +48,193 @@ public class RouteServiceImpl implements RouteService {
     @Value("${redis.prefix.suffix}")
     private String suffix;
 
+    //必须参数 运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
+
+    public CompletableFuture<String> createTotalResult(Map mapValue) throws Exception {
+
+        if (mapValue.containsKey("capacityNumber")&&mapValue.containsKey("receiveAddress")&&mapValue.containsKey("shipperName")&&mapValue.containsKey("orderNumber")){
+
+
+        }
+        //carryno车牌号 ,gatepostName 门岗名称 resultOutGateTime出门时间
+        SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        if (true) {
+                //创建物质信息需要字段(本地字段名称:视图字段名称 中文解释) unitOfMeasureDesc单位、materialName:cMaterieldes:名称、 materialSpecification:cSpec:规格、materialModel:cMaterielcode:型号,
+                HashMap materieldesMap=new HashMap();
+
+
+                // System.out.println("https://apis.map.qq.com/ws/geocoder/v1/"+"address="+ URLEncoder.encode(vcMeasurerec.getcSupplydes(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+                //创建托运人需要字段 (本地字段名称:视图字段名称 中文解释)cSupplyid:shipperCode 托运方代码 、cSupplydes:shipperName 托运方名称、addressLongitude 托运方地址经度、addressLatitude托运方地址纬度
+                String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("shipperName")==null?"安钢集团信阳钢铁有限责任公司":mapValue.get("shipperName").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+                SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class);
+                if (searchPoint.getStatus()==0){
+
+                    materieldesMap.put("addressLongitude",searchPoint.getResult().getLocation().getLng());
+                    materieldesMap.put("addressLatitude",searchPoint.getResult().getLocation().getLat());
+                }else {
+                    materieldesMap.put("addressLongitude",new BigDecimal(114.036293));
+                    materieldesMap.put("addressLatitude",new BigDecimal(32.483276));
+                }
+
+
+
+                //创建收货地址需要的字段    addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
+                String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+                SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
+                if (searchPoint2.getStatus()==0&&searchPoint2.getResult()!=null){
+                    System.out.println(searchPoint2);
+                    if (searchPoint2.getResult().getAddress_components()!=null){
+                        materieldesMap.put("addressProvince",searchPoint2.getResult().getAddress_components().getProvince()==null?"湖南省":searchPoint2.getResult().getAddress_components().getProvince());
+                        materieldesMap.put("addressDistrict",searchPoint2.getResult().getAddress_components().getDistrict()==null?"开福区":searchPoint2.getResult().getAddress_components().getDistrict());
+                        materieldesMap.put("addressTown",searchPoint2.getResult().getAddress_components().getCity()==null?"长沙市":searchPoint2.getResult().getAddress_components().getCity());
+                    }else {
+                        materieldesMap.put("addressProvince","湖南省");
+                        materieldesMap.put("addressDistrict","开福区");
+                        materieldesMap.put("addressTown","长沙市");
+                    }
+                    materieldesMap.put("addressDeliveryAddress",mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString());
+                    if (searchPoint2.getResult().getLocation()!=null){
+                        materieldesMap.put("addressLongitude",searchPoint2.getResult().getLocation().getLng()==null?new BigDecimal(112.98626):searchPoint2.getResult().getLocation().getLng());
+                        materieldesMap.put("addressLatitude",searchPoint2.getResult().getLocation().getLat()==null?new BigDecimal(28.25591):searchPoint2.getResult().getLocation().getLat());
+                    }else {
+                        materieldesMap.put("addressLongitude",new BigDecimal(112.98626));
+                        materieldesMap.put("addressLatitude",new BigDecimal(28.25591));
+                    }
+                    if (searchPoint2.getResult().getAd_info()!=null){
+                        materieldesMap.put("destCode",searchPoint2.getResult().getAd_info().getAdcode()==null?"无信息":searchPoint2.getResult().getAd_info().getAdcode());
+                    }else {
+                        materieldesMap.put("destCode","无信息");
+                    }
+
+                }else {
+                    //114.03629,32.48327","endLonlat":",28.25591"}
+                    materieldesMap.put("addressProvince","湖南省");
+                    materieldesMap.put("addressDistrict","开福区");
+                    materieldesMap.put("addressTown","长沙市");
+                    materieldesMap.put("destCode","430105");
+                    materieldesMap.put("addressDeliveryAddress","长沙市");
+                    materieldesMap.put("addressLongitude",new BigDecimal(112.98626));
+                    materieldesMap.put("addressLatitude",new BigDecimal(28.25591));
+                }
+
+
+                    //入网验证
+                    String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
+                    Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
+                    if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){
+
+                        //运单生成之后保存
+                        HashMap<String,String> redisMap=new HashMap<>();
+                        String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString();
+                        String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString();
+                        redisMap.put("startLonlat", startLon+","+startLat);
+                        String endLon= materieldesMap.get("addressLongitude").toString().length()>9?materieldesMap.get("addressLongitude").toString().substring(0,9):materieldesMap.get("addressLongitude").toString();
+                        String endLat= materieldesMap.get("addressLatitude").toString().length()>9?materieldesMap.get("addressLatitude").toString().substring(0,8):materieldesMap.get("addressLatitude").toString();
+                        redisMap.put("endLonlat",endLon+","+endLat);
+                        redisMap.put("vclN", mapValue.get("capacityNumber").toString());
+                        redisMap.put("vco","2");
+                        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
+                        String qryBtm=mapValue.get("resultOutGateTime").toString();
+
+                        //获得两天、23小时、45分钟之后的时间
+                        Date parse = simpleDateFormat.parse(qryBtm);
+                        //时间添加
+                        Calendar calendar = Calendar.getInstance();
+                        calendar.setTime(parse);
+                        //calendar.add(Calendar.DAY_OF_MONTH, 2);
+                        calendar.add(Calendar.HOUR_OF_DAY, 23);
+                        calendar.add(Calendar.SECOND, 45);
+                        //计算时间差
+                        long agetime = parse.getTime();
+                        long lateTime = calendar.getTimeInMillis();
+                        //两天、23小时、45分钟之后的时间差毫秒
+                        long reductionTime1=lateTime-agetime;
+                        long currentTime = new Date().getTime();
+                        //减去已经过的时间(毫秒)
+                        long reductionTime2=currentTime-agetime;
+
+                        //redis 存储的时间(秒)
+                        long saveTime=(reductionTime1-reductionTime2)/1000;
+                        redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm)));
+                        String qryEtm= simpleDateFormat.format(calendar.getTime());
+                        redisMap.put("qryEtm",qryEtm );
+                        String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString();
+                        String redisJson=JSON.toJSONString(redisMap);
+                        if (saveTime>0){
+                            redisTemplate.opsForValue().set(orderUrl, redisJson, saveTime, TimeUnit.SECONDS);
+                        }else {
+                            redisTemplate.opsForValue().set(orderUrl, redisJson, 36000, TimeUnit.SECONDS);
+                        }
+
+                        redisTemplate.opsForValue().set(orderUrl+suffix, redisJson);
+                        //预警开关判断0开启1关闭
+
+
+//                        if(checkTurnOff(vcMeasurerec.getcMaterieldes(),resTfulResultValues.get("switch").toString())){
+//
+//                            redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode());
+//                            redisMap.put("destCode",materieldesMap.get("destCode").toString());
+//                            redisMap.put("qryBtm",parse.toString());
+//                            redisMap.put("qryEtm",calendar.getTime().toString());
+//                            redisMap.put("type",resTfulResultValues.get("type").toString());
+//                            String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap);
+//
+//                            JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json);
+//
+//
+//                            if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){
+//                                HashMap<String,Object> tripMap=new HashMap();
+//                                tripMap.put("orderNumber",tmsData.get("orderNumber").toString());
+//                                tripMap.put("rid",jsonObject.get("result").toString());
+//                                omsFeign.insertOrderTripId(tripMap);
+//                            }
+//                        }
+                    }
+                    return  CompletableFuture.completedFuture("successful");
+                }
+
+
+        return CompletableFuture.completedFuture("fail");
+    }
+
+    /**
+     *
+     * @param matrial 物质名称
+     * @param selectStr 0,没有选1"带钢",2"微粉",3("螺纹钢","盘螺","盘圆"),4"钢坯",5"其他"
+     */
+    public  boolean checkTurnOff(String matrial,String selectStr) {
+        //0,没有选1"带钢",2"微粉",3("螺纹钢","盘螺","盘圆"),4"钢坯",5"其他"
+
+        int index=0;
+        String[]  matrialList=new String[]{"带钢","微粉","螺纹钢","盘螺","盘圆","钢坯","其他"};
+        //判断是那种物质
+        lable:for (int i=0;i<matrialList.length;i++){
+            if (matrial.contains(matrialList[i])) {
+                if(4>=i&&i>=2){
+                    //螺纹钢
+                    index=3;
+                }else if (i==5){
+                    //钢坯
+                    index=4;
+                }else if (i==6) {
+                    //其他
+                    index=5;
+                }else{
+                    index=i+1;
+                }
+                break lable;
+            }
+
+        }
+        //判断是否选择这种物质
+        if (index!=0&&selectStr.contains(String.valueOf(index))){
+            return true;
+        }
+        return false;
+
+    }
+
     /**
      * 必须参数 运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
      * @param mapValue
@@ -128,15 +320,277 @@ public class RouteServiceImpl implements RouteService {
     }
 
     /**
-     * 必须参数 orderNumber 运输订单号
-     * 获得运输全路径
+     * 必须参数 运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
      * @param mapValue
      * @return
      * @throws Exception
      */
+    @Override
+    public CompletableFuture<String> saveRequstionDate(Map mapValue) throws Exception {
+
+        //获得起点的经纬度和code
+        SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString());
+        String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("shipperName").toString()==null?"四川省达州钢铁集团有限责任公司":mapValue.get("shipperName").toString(),"utf-8")+"&key="+key);
+        SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class);
+
+        //创建收货地址    addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
+        String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+ URLEncoder.encode(mapValue.get("receiveAddress").toString()==null?"长沙市":mapValue.get("receiveAddress").toString(),"utf-8")+"&key="+key);
+        SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
+
+        //入网验证
+        String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
+        Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
+        if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){
+
+            //运单生成之后保存
+            HashMap<String, String> redisMap=new HashMap<>();
+            redisMap.put("startLonlat", searchPoint.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint.getResult().getLocation().getLat().toString().substring(0,8));
+            redisMap.put("endLonlat", searchPoint2.getResult().getLocation().getLng().toString().substring(0,9)+","+searchPoint2.getResult().getLocation().getLat().toString().substring(0,8));
+            redisMap.put("vclN", mapValue.get("capacityNumber").toString());
+            redisMap.put("vco","2");
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
+            String qryBtm=mapValue.get("resultOutGateTime").toString();
+
+            //获得两天、23小时、45分钟之后的时间
+            Date parse = simpleDateFormat.parse(qryBtm);
+            //时间添加
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(parse);
+            calendar.add(Calendar.DAY_OF_MONTH, 2);
+            calendar.add(Calendar.HOUR_OF_DAY, 23);
+            calendar.add(Calendar.SECOND, 45);
+            //计算时间差
+            long agetime = parse.getTime();
+            long lateTime = calendar.getTimeInMillis();
+            //两天、23小时、45分钟之后的时间差毫秒
+            long reductionTime1=lateTime-agetime;
+            long currentTime = new Date().getTime();
+            //减去已经过的时间(毫秒)
+            long reductionTime2=currentTime-agetime;
+
+            //redis 存储的时间(秒)
+            long saveTime=(reductionTime1-reductionTime2)/1000;
+            redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm)));
+            String qryEtm= simpleDateFormat.format(calendar.getTime());
+            redisMap.put("qryEtm",qryEtm );
+            String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString();
+            String redisJson= JSON.toJSONString(redisMap);
+            //保存请求中交的参数
+            redisTemplate.opsForValue().set(orderUrl, redisJson, saveTime, TimeUnit.SECONDS);
+            redisTemplate.opsForValue().set(orderUrl+suffix, redisJson);
+            //预警开关判断0开启1关闭
+            if(mapValue.get("turnOf").toString().equals("0")){
+
+                redisMap.put("startCode",searchPoint.getResult().getAd_info().getAdcode());
+                redisMap.put("destCode",searchPoint2.getResult().getAd_info().getAdcode());
+                redisMap.put("qryBtm",parse.toString());
+                redisMap.put("qryEtm",calendar.getTime().toString());
+                String subAbnormalLineWarnV2Json = zhongJiaoXingLu.subAbnormalLineWarnV2(redisMap);
+
+                JSONObject jsonObject = JSONObject.parseObject(subAbnormalLineWarnV2Json);
+
+
+                if (jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")) {
+                    HashMap<String, Object> tripMap = new HashMap();
+                    tripMap.put("orderNumber", mapValue.get("orderNumber").toString());
+                    tripMap.put("rid", jsonObject.get("result").toString());
+                    //omsFeign.insertOrderTripId(tripMap);
+                }
+            }
+            return  CompletableFuture.completedFuture("successful");
+        }
+        return CompletableFuture.completedFuture("fail");
+    }
+
     @Override
     public CompletableFuture<RouteVo> fullPathVisualization(HashMap mapValue) throws Exception {
 
+        String redisJson =null;
+        if (redisTemplate.hasKey(prefixOrder + ":" + mapValue.get("orderNumber"))){
+            redisJson=(String) redisTemplate.opsForValue().get(prefixOrder + ":" + mapValue.get("orderNumber"));
+        }
+
+        HashMap routeMap = JSON.parseObject(redisJson, HashMap.class);
+        String json="";
+        if (routeMap!=null)
+        {
+            json =zhongJiaoXingLu.visualRoute(routeMap);
+        }else{
+            String j=prefixLine + ":" + mapValue.get("orderNumber");
+            if (redisTemplate.hasKey(prefixLine + ":" + mapValue.get("orderNumber"))){
+                json  = (String) redisTemplate.opsForValue().get(prefixLine + ":" + mapValue.get("orderNumber"));
+            }
+
+            if (json==null||json.equals("")){
+                HashMap<String,Object> hashMap=new HashMap();
+                hashMap.put("orderNumber",mapValue.get("orderNumber"));
+//                RESTfulResult startAndEndCapacityNumber = tmsFeign.getStartAndEndCapacityNumber(hashMap);
+//                HashMap<String,Object> resultMap= (HashMap<String, Object>) startAndEndCapacityNumber.getData();
+                Map<String, Object> resultMap=tmstruckLeaveFactoryResultService.getTruckFactoryResult(mapValue.get("orderNumber").toString());
+                //入网验证
+                String netValidationResult = zhongJiaoXingLu.netValidation(resultMap.get("capacityNumber").toString());
+                Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
+                if (Integer.parseInt(netValidationMap.get("status").toString())==1001&&netValidationMap.get("result").toString().equals("yes")){
+                    String searchPointJson = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode("安钢集团信阳钢铁有限责任公司","utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+                    SearchPoint searchPoint= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson, SearchPoint.class);
+
+                    String searchPointJson2 = HTTPRequestUtils.sendGet("https://apis.map.qq.com/ws/geocoder/v1/", "address="+URLEncoder.encode(mapValue.get("receiveAddress")==null||"".equals(String.valueOf(mapValue.get("receiveAddress")))?"长沙市":resultMap.get("addressDeliveryAddress").toString(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
+                    SearchPoint searchPoint2= (SearchPoint) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
+                    //运单生成之后保存
+                    HashMap<String,String> redisMap=new HashMap<>();
+                    String startLon=searchPoint.getResult().getLocation().getLng().toString().length()>9?searchPoint.getResult().getLocation().getLng().toString().substring(0,9):searchPoint.getResult().getLocation().getLng().toString();
+                    String startLat=searchPoint.getResult().getLocation().getLat().toString().length()>9?searchPoint.getResult().getLocation().getLat().toString().substring(0,8):searchPoint.getResult().getLocation().getLat().toString();
+                    redisMap.put("startLonlat", startLon+","+startLat);
+                    String endLon= searchPoint2.getResult().getLocation().getLng().toString().length()>9?searchPoint2.getResult().getLocation().getLng().toString().substring(0,9):searchPoint2.getResult().getLocation().getLng().toString();
+                    String endLat= searchPoint2.getResult().getLocation().getLat().toString().length()>9?searchPoint2.getResult().getLocation().getLat().toString().substring(0,8):searchPoint2.getResult().getLocation().getLat().toString();
+                    redisMap.put("endLonlat",endLon+","+endLat);
+                    redisMap.put("vclN", resultMap.get("capacityNumber").toString());
+                    redisMap.put("vco","2");
+                    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
+                    String qryBtm=resultMap.get("resultOutGateTime").toString();
+
+                    //获得两天、23小时、45分钟之后的时间
+                    Date parse = simpleDateFormat.parse(qryBtm);
+                    //时间添加
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTime(parse);
+                    // calendar.add(Calendar.DAY_OF_MONTH, 2);
+                    calendar.add(Calendar.HOUR_OF_DAY, 23);
+                    calendar.add(Calendar.SECOND, 45);
+                    //计算时间差
+                    long agetime = parse.getTime();
+                    long lateTime = calendar.getTimeInMillis();
+                    //两天、23小时、45分钟之后的时间差毫秒
+                    long reductionTime1=lateTime-agetime;
+                    long currentTime = new Date().getTime();
+                    //减去已经过的时间(毫秒)
+                    long reductionTime2=currentTime-agetime;
+
+                    //redis 存储的时间(秒)
+                    long saveTime=(reductionTime1-reductionTime2)/1000;
+                    redisMap.put("qryBtm", simpleDateFormat.format(simpleDateFormat.parse(qryBtm)));
+                    String qryEtm= simpleDateFormat.format(calendar.getTime());
+                    redisMap.put("qryEtm", qryEtm);
+                    if (saveTime>1800){
+                        String orderUrl=prefixOrder+":"+mapValue.get("orderNumber").toString();
+
+                        String redisStr=JSON.toJSONString(redisMap);
+                        json = zhongJiaoXingLu.visualRoute(redisMap);
+                        redisTemplate.opsForValue().set(orderUrl, redisStr, saveTime<0?1000:saveTime, TimeUnit.SECONDS);
+
+                    }else {
+
+                        //设置60天后过期
+                        Calendar calendar2=Calendar.getInstance();
+                        long agoTime= calendar2.getTime().getTime();
+                        calendar2.add(Calendar.MONTH,2);
+                        long late= calendar2.getTime().getTime();
+                        long save=(lateTime-agoTime)/1000;
+                        System.out.println(redisMap);
+                        System.out.println("置60天后过期");
+                        json = zhongJiaoXingLu.visualRoute(redisMap);
+                        System.out.println(json.length()>100?json.substring(0,100):json);
+                        if (json!=null){
+                            redisTemplate.opsForValue().set(prefixLine+":"+mapValue.get("orderNumber").toString(), json, save>0?save:3184000, TimeUnit.SECONDS);
+                        }
+
+                    }
+
+                }
+            }else {
+
+            }
+        }
+        JSONObject jsonObject = JSONObject.parseObject(json);
+        if (json!=null&&jsonObject!=null&&jsonObject.get("status").toString().equals(1001+"")){
+            //初始开始链路和结束线路、开始点、结束点、当前点的集合
+            List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>();
+            //一条路线,开始链路和结束线路、开始点、结束点、当前点
+            StartAndEndRoute startAndEndRoute=new StartAndEndRoute();
+
+            ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
+            //初始化vo对象
+            RouteVo vo=new RouteVo();
+            //当前所在的点
+            if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){
+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000));
+                //当前所在的点
+                Point currentPoint=new Point();
+                currentPoint.setLat(centerpoint[0]+"");
+                currentPoint.setLon(centerpoint[1]+"");
+                startAndEndRoute.setCurrentPoint(currentPoint);
+            }
+            //当前所在地名称
+            startAndEndRoute.setCurrentPointName(to.getResult().getAdr());
+            //初始已行驶轨迹集合
+            if (to.getResult().getRunRoute()!=null){
+                List<RunRoutePoint> routes =new ArrayList();
+                List<Double[]> routesPath =new ArrayList();
+                for(RunRoutePoint item : to.getResult().getRunRoute()){
+                    RunRoutePoint runRoutePoint=item;
+                    //将已行驶轨迹转义数据格式
+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    routesPath.add(new Double[]{points[1],points[0]});
+                    //经纬度
+                    runRoutePoint.setLat(points[0]+"");
+                    runRoutePoint.setLon(points[1]+"");
+                    //坐标点
+                    routes.add(runRoutePoint);
+                }
+                //初始化起始点,已经经过路段的第一个点
+                Point startPoint=new Point();
+                startPoint.setLat(routes.get(0).getLat());
+                startPoint.setLon(routes.get(0).getLon());
+                startAndEndRoute.setStartPoint(startPoint);
+                //点集合
+                startAndEndRoute.setRunPath(routesPath);
+                //已经完成路线点集合
+                startAndEndRoute.setRunRoute(routes);
+            }
+            //预估轨迹
+            if (to.getResult().getEstimateRoute()!=null){
+                List<Point> estimateRoute= new ArrayList<>();
+                List<Double[]> estimatePath =new ArrayList();
+                for(Point item :to.getResult().getEstimateRoute()){
+                    Point er=new Point();
+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    estimatePath.add(new Double[]{points[1],points[0]});
+                    er.setLat(points[0]+"");
+                    er.setLon(points[1]+"");
+                    estimateRoute.add(er);
+                }
+                //路径
+                startAndEndRoute.setEstimatePath(estimatePath);
+                //结束点
+                startAndEndRoute.setEndPoint(estimateRoute.get(estimateRoute.size()-1));
+                //预估轨迹赋值
+                startAndEndRoute.setEstimateRoute(estimateRoute);
+            }
+            //当前所行驶历程数
+            String mil=to.getResult().getRunDistance()+"km";
+            startAndEndRoute.setMiled(mil);
+            startAndEndRouteList.add(startAndEndRoute);
+            vo.setStartAndEndRoutes(startAndEndRouteList);
+            //
+            //设置返回值对象
+            return CompletableFuture.completedFuture(vo) ;
+        }else {
+            return  CompletableFuture.completedFuture(new RouteVo());
+        }
+
+    }
+
+    /**
+     * 必须参数 orderNumber 运输订单号
+     * 获得运输全路径
+     * @param mapValue
+     * @return
+     * @throws Exception
+     */
+
+    public CompletableFuture<RouteVo> fullPaht(HashMap mapValue) throws Exception {
+
         //获得saveRoute()保存在redis请求中交的查询
         String redisJson = (String) redisTemplate.opsForValue().get(prefixOrder + ":" + mapValue.get("orderNumber"));
 
@@ -232,7 +686,7 @@ public class RouteServiceImpl implements RouteService {
             RouteVo vo=new RouteVo();
             //当前所在的点
             if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){
-                double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000));
+                Double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000));
                 //当前所在的点
                 Point currentPoint=new Point();
                 currentPoint.setLat(centerpoint[0]+"");
@@ -243,27 +697,43 @@ public class RouteServiceImpl implements RouteService {
             startAndEndRoute.setCurrentPointName(to.getResult().getAdr());
             //初始已行驶轨迹集合
             if (to.getResult().getRunRoute()!=null){
-                List<Point> routes = to.getResult().getRunRoute().stream().map(item->{
-                    Point er=new Point();
-                    double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
-                    er.setLat(points[0]+"");
-                    er.setLon(points[1]+"");
-                    return  er;
-                }).collect(Collectors.toList());
+                List<RunRoutePoint> routes =new ArrayList();
+                List<Double[]> routesPath =new ArrayList();
+                 for(RunRoutePoint item : to.getResult().getRunRoute()){
+                    RunRoutePoint runRoutePoint=item;
+                    //将已行驶轨迹转义数据格式
+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    routesPath.add(new Double[]{points[1],points[0]});
+                    //经纬度
+                    runRoutePoint.setLat(points[0]+"");
+                    runRoutePoint.setLon(points[1]+"");
+                    //坐标点
+                     routes.add(runRoutePoint);
+                }
                 //初始化起始点,已经经过路段的第一个点
-                startAndEndRoute.setStartPoint(routes.get(0));
+                Point startPoint=new Point();
+                startPoint.setLat(routes.get(0).getLat());
+                startPoint.setLon(routes.get(0).getLon());
+                startAndEndRoute.setStartPoint(startPoint);
+                //点集合
+                startAndEndRoute.setRunPath(routesPath);
                 //已经完成路线点集合
                 startAndEndRoute.setRunRoute(routes);
             }
             //预估轨迹
             if (to.getResult().getEstimateRoute()!=null){
-                List<Point> estimateRoute= to.getResult().getEstimateRoute().stream().map(item->{
+                List<Point> estimateRoute= new ArrayList<>();
+                List<Double[]> estimatePath =new ArrayList();
+                for(Point item :to.getResult().getEstimateRoute()){
                     Point er=new Point();
-                    double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    Double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
+                    estimatePath.add(new Double[]{points[1],points[0]});
                     er.setLat(points[0]+"");
                     er.setLon(points[1]+"");
-                    return  er;
-                }).collect(Collectors.toList());
+                    estimateRoute.add(er);
+                }
+                //路径
+                startAndEndRoute.setEstimatePath(estimatePath);
                 //结束点
                 startAndEndRoute.setEndPoint(estimateRoute.get(estimateRoute.size()-1));
                 //预估轨迹赋值

+ 106 - 0
src/main/java/com/steerinfo/route/service/impl/TmstruckArrivalResultServiceImpl.java

@@ -0,0 +1,106 @@
+package com.steerinfo.route.service.impl;
+
+
+import com.steerinfo.route.mapper.TmstruckArrivalResultMapper;
+import com.steerinfo.route.model.TmstruckArrivalResult;
+import com.steerinfo.route.service.ITmstruckArrivalResultService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * TmstruckArrivalResult服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckArrivalResult服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "tmstruckArrivalResultService")
+public class TmstruckArrivalResultServiceImpl implements ITmstruckArrivalResultService {
+
+    @Autowired
+    private TmstruckArrivalResultMapper tmstruckArrivalResultMapper;
+
+
+//    @Override
+//    public synchronized int addtmstruckArrivalResult(String orderNumber,TmstruckArrivalResult tmstruckArrivalResult) {
+//        long id;
+//        if(tmstruckArrivalResultMapper.selectMaxId()==null){
+//            id = 1;
+//        }else {
+//            id = tmstruckArrivalResultMapper.selectMaxId().longValue()+1;
+//        }
+//        //生成主键id
+//        tmstruckArrivalResult.setResultId(new BigDecimal(id));
+//        //获取并插入总实绩Id
+//        BigDecimal truckTotalId = tmstruckAbnormalResultMapper.getTotalIdByOrderNumber(orderNumber);
+//        tmstruckArrivalResult.setResultTotalId(truckTotalId);
+//        //常规字段
+//        tmstruckArrivalResult.setInsertUsername("admin");
+//        tmstruckArrivalResult.setInsertTime(new Date());
+//        tmstruckArrivalResult.setUpdateUsername("admin");
+//        tmstruckArrivalResult.setUpdateTime(new Date());
+//        tmstruckArrivalResult.setInsertUpdateRemark("无");
+//        return tmstruckArrivalResultMapper.insert(tmstruckArrivalResult);
+//    }
+
+    @Override
+    public synchronized int addtmstruckArrivalResult(String orderNumber, TmstruckArrivalResult tmstruckArrivalResult) {
+        //通过运输订单号查询是否已存在抵达实绩
+        BigDecimal alreadyExistsArrivalResult = tmstruckArrivalResultMapper.alreadyExistsArrivalResult(orderNumber);
+        if(alreadyExistsArrivalResult==null){
+            long id;
+            if(tmstruckArrivalResultMapper.selectMaxId()==null){
+                id = 1;
+            }else {
+                id = tmstruckArrivalResultMapper.selectMaxId().longValue()+1;
+            }
+            //生成主键id
+            tmstruckArrivalResult.setResultId(new BigDecimal(id));
+            //获取并插入总实绩Id
+            BigDecimal truckTotalId = tmstruckArrivalResultMapper.getTotalIdByOrderNumber(orderNumber);
+            tmstruckArrivalResult.setResultTotalId(truckTotalId);
+            //常规字段
+            tmstruckArrivalResult.setInsertUsername("admin");
+            tmstruckArrivalResult.setInsertTime(new Date());
+            tmstruckArrivalResult.setUpdateUsername("admin");
+            tmstruckArrivalResult.setUpdateTime(new Date());
+            tmstruckArrivalResult.setInsertUpdateRemark("无");
+            return tmstruckArrivalResultMapper.insert(tmstruckArrivalResult);
+        }else{
+            return 3;
+        }
+
+    }
+
+    @Override
+    public List<Map<String, Object>> getArrivalResultInfo(Map<String, Object> map) {
+        return tmstruckArrivalResultMapper.getArrivalResultInfo(map);
+    }
+
+    @Override
+    public String getAddressDistrict(String orderNumber) {
+        return tmstruckArrivalResultMapper.getAddressDistrict(orderNumber);
+    }
+
+    @Override
+    public List<String> getAdjustment() {
+        return tmstruckArrivalResultMapper.getAdjustment();
+
+    }
+
+    @Override
+    public int updateTown(String city, String item) {
+        return tmstruckArrivalResultMapper.updateTown(city,item);
+    }
+}

+ 50 - 0
src/main/java/com/steerinfo/route/service/impl/TmstruckReceiptResultChildServiceImpl.java

@@ -0,0 +1,50 @@
+package com.steerinfo.route.service.impl;
+
+
+import com.steerinfo.route.mapper.TmstruckReceiptResultChildMapper;
+import com.steerinfo.route.model.TmstruckReceiptResultChild;
+import com.steerinfo.route.service.ITmstruckReceiptResultChildService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * TmstruckReceiptResultChild服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:38
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:TmstruckReceiptResultChild服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "tmstruckReceiptResultChildService")
+public class TmstruckReceiptResultChildServiceImpl implements ITmstruckReceiptResultChildService {
+
+    @Autowired
+    private TmstruckReceiptResultChildMapper tmstruckReceiptResultChildMapper;
+
+    @Override
+    public synchronized int addTmstruckReceiptResultChild(TmstruckReceiptResultChild tmstruckReceiptResultChild) {
+        long id;
+        if(tmstruckReceiptResultChildMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = tmstruckReceiptResultChildMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        tmstruckReceiptResultChild.setChildId(new BigDecimal(id));
+        //常规字段
+        tmstruckReceiptResultChild.setInsertUsername("admin");
+        tmstruckReceiptResultChild.setInsertTime(new Date());
+        tmstruckReceiptResultChild.setUpdateUsername("admin");
+        tmstruckReceiptResultChild.setUpdateTime(new Date());
+        tmstruckReceiptResultChild.setInsertUpdateRemark("无");
+        return tmstruckReceiptResultChildMapper.insert(tmstruckReceiptResultChild);
+    }
+}

+ 69 - 86
src/main/java/com/steerinfo/route/threeRequest/ZhongJiaoXingLu.java

@@ -2,16 +2,18 @@ package com.steerinfo.route.threeRequest;
 
 import com.alibaba.fastjson.JSONObject;
 import com.openapi.sdk.service.DataExchangeService;
+
 import com.steerinfo.route.util.DataConversionTool;
 import com.steerinfo.route.util.LngLonUtil;
 import com.steerinfo.route.vo.FullPathVisualizationTo.ViewVisualization;
-import com.steerinfo.route.vo.Map.Point;
 import com.steerinfo.route.vo.Map.RouteVo;
 import com.steerinfo.route.vo.Map.StartAndEndRoute;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
 import org.springframework.stereotype.Component;
 import org.springframework.util.StringUtils;
 
+import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -30,19 +32,62 @@ public class ZhongJiaoXingLu {
     private String outMins;
     @Value("${str.ZhongJiaoXingLu.type}")
     private String type;
-    private String token="238684c3-1817-4e5e-8695-a8c85f8fd231";
+    private  String token="238684c3-1817-4e5e-8695-a8c85f8fd231";
     @Value("${str.ZhongJiaoXingLu.cid}")
-    private String cid;
+    private  String cid;
     @Value("${str.ZhongJiaoXingLu.srt}")
-    private String srt;
+    private  String srt;
     @Value("${str.ZhongJiaoXingLu.user}")
-    private String user;
+    private  String user;
     @Value("${str.ZhongJiaoXingLu.pwd}")
-    private String pwd;
+    private  String pwd;
     //"238684c3-1817-4e5e-8695-a8c85f8fd231"
     //"2667ca1f-e003-4822-b4c1-f25561c27f31"
     //"3dbdc182-b235-4c33-be30-88c0fe8999c5"
-    public String visualRoute(HashMap routeMap) {
+
+
+    public  String visualRoute(HashMap routeMap) {
+        try {
+            //登陆之后返回的token:d21661ca-e0fe-4934-866a-7d78a0756bd4
+            Map<String, String> map = new HashMap<String, String>(3);
+            map.put("token", token);
+            map.put("cid", cid);
+            map.put("srt", srt);
+            map.put("startLonlat", routeMap.get("startLonlat").toString());
+            map.put("endLonlat", routeMap.get("endLonlat").toString());
+            map.put("vclN", routeMap.get("vclN").toString());
+            map.put("vco",routeMap.get("vco").toString());
+            map.put("qryBtm", routeMap.get("qryBtm").toString());
+            //判断结束时间是否大于现在时间
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            SimpleDateFormat simpleDateFormat2=new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+            Date nowDate=simpleDateFormat.parse(simpleDateFormat2.format(new Date()));
+            if (nowDate.getTime()<simpleDateFormat.parse(routeMap.get("qryEtm").toString()).getTime()){
+                map.put("qryEtm", simpleDateFormat.format(nowDate));
+            }else {
+                Date qryEtm = simpleDateFormat.parse(routeMap.get("qryEtm").toString());
+                map.put("qryEtm", simpleDateFormat2.format(qryEtm));
+            }
+            //routeMap.get("qryEtm").toString()
+            map.put("timeNearby", "30");
+            String url = "https://openapi.sinoiov.cn/save/apis/visualRoute";
+            DataExchangeService des = new DataExchangeService(5000, 8000);
+
+            // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
+            String res = des.postHttps(url, map);
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            if (jsonObject.get("status").toString().equals(1016+"")){
+                login();
+                return visualRoute( routeMap);
+            }
+            return res;
+        } catch (Exception e) {
+            System.out.println("e:" + e.getMessage());
+        }
+        return null;
+    }
+
+    public  String visualRoute2(HashMap routeMap) {
         try {
             //登陆之后返回的token:d21661ca-e0fe-4934-866a-7d78a0756bd4
             Map<String, String> map = new HashMap<String, String>(3);
@@ -54,18 +99,25 @@ public class ZhongJiaoXingLu {
             map.put("vclN", routeMap.get("vclN").toString());
             map.put("vco",routeMap.get("vco").toString());
             map.put("qryBtm", routeMap.get("qryBtm").toString());
-            map.put("qryEtm", routeMap.get("qryEtm").toString());
+            //2021-12-22 12:45:07
+            SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd 23:59:59");
+            map.put("qryEtm", simpleDateFormat.format(new Date()));
+
+            //routeMap.get("qryEtm").toString()
             map.put("timeNearby", "30");
+            System.out.println(map);
             String url = "https://openapi.sinoiov.cn/save/apis/visualRoute";
             DataExchangeService des = new DataExchangeService(5000, 8000);
 
             // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
             String res = des.postHttps(url, map);
+
             JSONObject jsonObject = JSONObject.parseObject(res);
             if (jsonObject.get("status").toString().equals(1016+"")){
                 login();
                 return visualRoute( routeMap);
             }
+            System.out.println(res);
             return res;
         } catch (Exception e) {
             System.out.println("e:" + e.getMessage());
@@ -73,7 +125,7 @@ public class ZhongJiaoXingLu {
         return null;
     }
     //String startLonlat,String endLonlat,String vclN,String vco,String qryBtm,String qryEtm
-    public String subAbnormalLineWarnV2(HashMap routeMap ) {
+    public  String subAbnormalLineWarnV2(HashMap routeMap ) {
         try {
             //登陆之后返回的token:d21661ca-e0fe-4934-866a-7d78a0756bd4
             Map<String, String> map = new HashMap<String, String>(3);
@@ -87,21 +139,17 @@ public class ZhongJiaoXingLu {
             map.put("startCoor", routeMap.get("startLonlat").toString());
             map.put("destCoor", routeMap.get("endLonlat").toString());
             //把字符串转换成CST日期类型
-            map.put("stime", cstToGMT(routeMap.get("qryBtm").toString()).toString());
+            map.put("stime", cstToGMT(new Date().toString()).toString());
             map.put("etime", cstToGMT(routeMap.get("qryEtm").toString()).toString());
             map.put("parkMins", parkMins);
             map.put("outMins", outMins);
             map.put("abnMins", abnMins);
-            map.put("type", type);
+            map.put("type", routeMap.get("type").toString());
             String url = "https://openapi.sinoiov.cn/save/apis/subAbnormalLineWarnV2";
             DataExchangeService des = new DataExchangeService(5000, 8000);
 
             // 通过 https 方式调用,此方法内部会使用私钥生成签名参数 sign,私钥不会发送
-            System.out.println("map");
-            System.out.println(map);
             String res = des.postHttps(url, map);
-            System.out.println("res");
-            System.out.println(res);
             JSONObject jsonObject = JSONObject.parseObject(res);
             if (jsonObject.get("status").toString().equals(1016+"")){
                 login();
@@ -120,10 +168,10 @@ public class ZhongJiaoXingLu {
         SimpleDateFormat sdf1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
         SimpleDateFormat sdf = new SimpleDateFormat("EEE d MMM yyyy HH:mm:ss 'GMT'", Locale.US);
         sdf.setTimeZone(TimeZone.getTimeZone("GMT+8")); // 设置时区为GMT  +8为北京时间东八区
-        String str = String.valueOf(sdf1.parse(data).getTime()-60000);
+        String str = String.valueOf(sdf1.parse(data).getTime()+60000);
         return str;
     }
-    public String netValidation(String vclN) {
+    public  String netValidation(String vclN) {
         try {
             //登陆之后返回的token:d21661ca-e0fe-4934-866a-7d78a0756bd4
             Map<String, String> map = new HashMap<String, String>(4);
@@ -165,74 +213,9 @@ public class ZhongJiaoXingLu {
             System.out.println("e:" + e.getMessage());
         }
     }
-    public CompletableFuture<RouteVo> fullPathVisualization(String json) throws Exception {
-        //初始开始链路和结束线路、开始点、结束点、当前点的集合
-        List<StartAndEndRoute> startAndEndRouteList=new ArrayList<>();
-        //一条路线,开始链路和结束线路、开始点、结束点、当前点
-        StartAndEndRoute startAndEndRoute=new StartAndEndRoute();
-        // String startLonlat,String endLonlat,String vclN,String vco,String qryBtm,String qryEtm
-//        map.put("vclN", "陕YH0009");
-//        map.put("vco","2");
-//        map.put("qryBtm", "2021-10-06 22:10:10");
-//        map.put("qryEtm", "2021-10-07 22:10:10");
-        //String json =ZhongJiaoXingLu.visualRoute("","","陕YH0009","2","2021-10-06 22:10:10","2021-10-07 22:10:10");
-        ViewVisualization to= (ViewVisualization) DataConversionTool.jsonToBean(json,ViewVisualization.class);
-        //初始化vo对象
-        RouteVo vo=new RouteVo();
-        //当前所在的点
-        if ((!StringUtils.isEmpty(to.getResult().getLat()))&& (!StringUtils.isEmpty(to.getResult().getLon()))){
-            double[] centerpoint = LngLonUtil.gps84_To_Gcj02((Double.valueOf(to.getResult().getLat()) / 600000), (Double.valueOf(to.getResult().getLon()) / 600000));
-            //当前所在的点
-            Point currentPoint=new Point();
-            currentPoint.setLat(centerpoint[0]+"");
-            currentPoint.setLon(centerpoint[1]+"");
-            startAndEndRoute.setCurrentPoint(currentPoint);
-        }
-        //当前所在地名称
-        startAndEndRoute.setCurrentPointName(to.getResult().getAdr());
-        //初始已行驶轨迹集合
-        if (to.getResult().getRunRoute()!=null){
-            List<Point> routes = to.getResult().getRunRoute().stream().map(item->{
-                Point er=new Point();
-                double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
-                er.setLat(points[0]+"");
-                er.setLon(points[1]+"");
-                return  er;
-            }).collect(Collectors.toList());
-            //初始化起始点,已经经过路段的第一个点
-            startAndEndRoute.setStartPoint(routes.get(0));
-            //已经完成路线点集合
-            startAndEndRoute.setRunRoute(routes);
-        }
-        //预估轨迹
-        if (to.getResult().getEstimateRoute()!=null){
-            List<Point> estimateRoute= to.getResult().getEstimateRoute().stream().map(item->{
-                Point er=new Point();
-                double[] points = LngLonUtil.gps84_To_Gcj02((Double.valueOf(item.getLat()) / 600000), (Double.valueOf(item.getLon()) / 600000));
-                er.setLat(points[0]+"");
-                er.setLon(points[1]+"");
-                return  er;
-            }).collect(Collectors.toList());
-            //结束点
-            startAndEndRoute.setEndPoint(estimateRoute.get(estimateRoute.size()-1));
-            //预估轨迹赋值
-            startAndEndRoute.setEstimateRoute(estimateRoute);
-        }
-        //当前所行驶历程数
-        String mil=to.getResult().getRunRoute().get(to.getResult().getRunRoute().size()-1).getMil();
-        startAndEndRoute.setMiled(mil);
-        startAndEndRouteList.add(startAndEndRoute);
-        vo.setStartAndEndRoutes(startAndEndRouteList);
-        //
-        //设置返回值对象
-        return CompletableFuture.completedFuture(vo) ;
-    }
-
-
-
 
 
-    public String getCid() {
+    public  String getCid() {
         return cid;
     }
 
@@ -240,7 +223,7 @@ public class ZhongJiaoXingLu {
         this.cid = cid;
     }
 
-    public String getSrt() {
+    public  String getSrt() {
         return srt;
     }
 
@@ -248,7 +231,7 @@ public class ZhongJiaoXingLu {
         this.srt = srt;
     }
 
-    public String getUser() {
+    public  String getUser() {
         return user;
     }
 
@@ -256,7 +239,7 @@ public class ZhongJiaoXingLu {
         this.user = user;
     }
 
-    public String getPwd() {
+    public  String getPwd() {
         return pwd;
     }
 

+ 4 - 4
src/main/java/com/steerinfo/route/util/LngLonUtil.java

@@ -60,9 +60,9 @@ public class LngLonUtil {
      * @param lon
      * @return
      */
-    public static double[] gps84_To_Gcj02(double lat, double lon) {
+    public static Double[] gps84_To_Gcj02(double lat, double lon) {
         if (outOfChina(lat, lon)) {
-            return new double[]{lat,lon};
+            return new Double[]{lat,lon};
         }
         double dLat = transformLat(lon - 105.0, lat - 35.0);
         double dLon = transformLon(lon - 105.0, lat - 35.0);
@@ -74,7 +74,7 @@ public class LngLonUtil {
         dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * pi);
         double mgLat = lat + dLat;
         double mgLon = lon + dLon;
-        return new double[]{mgLat, mgLon};
+        return new Double[]{mgLat, mgLon};
     }
 
 
@@ -125,7 +125,7 @@ public class LngLonUtil {
      * @return
      */
     public static double[] gps84_To_bd09(double lat,double lon){
-        double[] gcj02 = gps84_To_Gcj02(lat,lon);
+        Double[] gcj02 = gps84_To_Gcj02(lat,lon);
         double[] bd09 = gcj02_To_Bd09(gcj02[0],gcj02[1]);
         return bd09;
     }

+ 4 - 3
src/main/java/com/steerinfo/route/vo/FullPathVisualizationTo/Result.java

@@ -3,6 +3,7 @@
   */
 package com.steerinfo.route.vo.FullPathVisualizationTo;
 import com.steerinfo.route.vo.Map.Point;
+import com.steerinfo.route.vo.Map.RunRoutePoint;
 
 import java.util.List;
 
@@ -28,7 +29,7 @@ public class Result {
     private String province;
     private String remainDistance;
     private String runDistance;
-    private List<RunRoute> runRoute;
+    private List<RunRoutePoint> runRoute;
     private String spd;
     private String utc;
     public void setAdr(String adr) {
@@ -129,10 +130,10 @@ public class Result {
          return runDistance;
      }
 
-    public void setRunRoute(List<RunRoute> runRoute) {
+    public void setRunRoute(List<RunRoutePoint> runRoute) {
          this.runRoute = runRoute;
      }
-     public List<RunRoute> getRunRoute() {
+     public List<RunRoutePoint> getRunRoute() {
          return runRoute;
      }
 

+ 82 - 0
src/main/java/com/steerinfo/route/vo/Map/RunRoutePoint.java

@@ -0,0 +1,82 @@
+package com.steerinfo.route.vo.Map; /**
+  * Copyright 2021 bejson.com 
+  */
+
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+/**
+ * Auto-generated: 2021-10-16 11:56:24
+ *
+ * @author bejson.com (i@bejson.com)
+ * @website http://www.bejson.com/java2pojo/
+ */
+public class RunRoutePoint {
+
+    SimpleDateFormat startSimpleDateFormat=new SimpleDateFormat("yyyyMMdd/HHmmss");
+    SimpleDateFormat endSimpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
+    private String agl;
+    private String gtm;
+    private String hgt;
+    private String lat;
+    private String lon;
+    private String mil;
+    private String spd;
+    public void setAgl(String agl) {
+         this.agl = agl;
+     }
+     public String getAgl() {
+         return agl;
+     }
+
+    public void setGtm(String gtm) throws ParseException {
+        this.gtm = gtm;
+     }
+
+     public String getGtm() throws ParseException {
+         Date parse = startSimpleDateFormat.parse(this.gtm);
+        return endSimpleDateFormat.format(parse);
+     }
+
+    public void setHgt(String hgt) {
+         this.hgt = hgt;
+     }
+     public String getHgt() {
+         return hgt;
+     }
+
+    public void setLat(String lat) {
+
+         this.lat = lat;
+     }
+     public String getLat() {
+         return lat;
+     }
+
+    public void setLon(String lon) {
+         this.lon = lon;
+     }
+     public String getLon() {
+         return lon;
+     }
+
+
+
+    public void setMil(String mil) {
+         this.mil = mil;
+     }
+     public String getMil() {
+         return mil;
+     }
+
+    public void setSpd(String spd) {
+         this.spd = spd;
+     }
+     public String getSpd() {
+         return spd;
+     }
+
+}

+ 29 - 9
src/main/java/com/steerinfo/route/vo/Map/StartAndEndRoute.java

@@ -19,10 +19,30 @@ public class StartAndEndRoute {
     private String miled;
 
     //已经行驶点的集合,绘制已行驶路径使用的
-    private List<Point> runRoute;
+    private List<RunRoutePoint> runRoute;
     //预计行驶点的集合,绘制预计行驶径使用的
     private List<Point> estimateRoute;
 
+    private List<Double[]> estimatePath;
+
+    private List<Double[]> runPath;
+
+    public List<Double[]> getEstimatePath() {
+        return estimatePath;
+    }
+
+    public void setEstimatePath(List<Double[]> estimatePath) {
+        this.estimatePath = estimatePath;
+    }
+
+    public List<Double[]> getRunPath() {
+        return runPath;
+    }
+
+    public void setRunPath(List<Double[]> runPath) {
+        this.runPath = runPath;
+    }
+
     public String getStartPointName() {
         return startPointName;
     }
@@ -79,20 +99,20 @@ public class StartAndEndRoute {
         this.miled = miled;
     }
 
-    public List<Point> getEstimateRoute() {
-        return estimateRoute;
+    public List<RunRoutePoint> getRunRoute() {
+        return runRoute;
     }
 
-    public void setEstimateRoute(List<Point> estimateRoute) {
-        this.estimateRoute = estimateRoute;
+    public void setRunRoute(List<RunRoutePoint> runRoute) {
+        this.runRoute = runRoute;
     }
 
-    public List<Point> getRunRoute() {
-        return runRoute;
+    public List<Point> getEstimateRoute() {
+        return estimateRoute;
     }
 
-    public void setRunRoute(List<Point> runRoute) {
-        this.runRoute = runRoute;
+    public void setEstimateRoute(List<Point> estimateRoute) {
+        this.estimateRoute = estimateRoute;
     }
 
     @Override

+ 5 - 0
src/main/resources/application-dev.yml

@@ -17,6 +17,11 @@ spring:
     redis:
       time-to-live: 300000
       cache-null-values: true
+piction:
+  # path: /usr/share/nginx/html/image
+  #  path: /test/data/nginx/html/image
+  path: C:\Users\24390\Desktop\work\a
+#  path: /shared
 
 #feign设置
 openfeign:

+ 5 - 1
src/main/resources/application-prod.yml

@@ -18,7 +18,11 @@ spring:
     redis:
       time-to-live: 300000
       cache-null-values: true
-
+piction:
+  # path: /usr/share/nginx/html/image
+  #  path: /test/data/nginx/html/image
+#  path: C:\Users\24390\Desktop\work\a
+  path: /shared
 #feign设置
 openfeign:
   ColumnDataFeign:

+ 4 - 4
src/main/resources/bootstrap.yml

@@ -51,10 +51,10 @@ str:
   tengxun:
     key: WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y
   ZhongJiaoXingLu:
-    cid: 2667ca1f-e003-4822-b4c1-f25561c27f31
-    srt: 3dbdc182-b235-4c33-be30-88c0fe8999c5
-    user: 695b3735-9d65-4106-98f9-5f2181b40fb5
-    pwd: fQBac3J090gK4L52a73qM821LF790H
+    cid: 72c918a9-49d7-434e-ae24-e3b36a589800
+    srt: b6549e66-e3a2-44f2-a1a3-d1f77d6c96f2
+    user: f760f293-4234-4495-90c0-fa1bf5f29bf6
+    pwd: 5T91u0h5SVg132G41440MD1jj2B77I
     #停车
     parkMins: 60
     #离线时长

+ 252 - 0
src/main/resources/com/steerinfo/dil/mapper/OffSiteTransportationMapper.xml

@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.dil.mapper.OffSiteTransportationMapper">
+    
+    <select id="getInTransitTransportation" resultType="java.util.Map">
+      select
+           *
+        from (
+                 select  distinct  OO.ORDER_NUMBER              "orderNumber", --运单订单号
+                        RC.CAPACITY_NUMBER           "capacityNumber",--车牌号
+                        TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",--计毛时间
+                        TWR.RESULT_NET_WEIGHT        "resultNetWeight",--净重
+                        TLFR.RESULT_OUT_GATE_TIME    "resultOutGateTime",--出厂时间
+                        RGOUT.GATEPOST_NAME          "outGatepostName",--出厂门禁
+                        RCR.CARRIER_NAME             "carrierName" , --承运商名称
+                        RRP.ADDRESS_DELIVERY_ADDRESS "deliveryAddress",  --详细收货地址
+                        RM.MATERIAL_NAME             "materialName" , --"物质名称"
+                        RM.MATERIAL_SPECIFICATION    "materialSpecification", -- "物质规格"
+                        RM.MATERIAL_MODEL            "materialModel", --"物质型号"
+                        RCON.CONSIGNEE_COMPANY_NAME   "receiveName"--客户名称
+                        
+                 from OMSTRUCK_ORDER OO --运输订单
+                          left join AMS_SALE_ORDER_MATERIAL ASOM --销售订单物质表
+                               on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+                          left join AMS_SALE_ORDER ASO --销售订单
+                               on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+                          left join RMS_CONSIGNEE RCON --收货客户
+                               on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
+                          left join TMSTRUCK_TOTAL_RESULT TTR --运输总实绩
+                               on TTR.ORDER_ID = OO.ORDER_ID
+                          left join TMSTRUCK_LOAD_RESULT TLR --汽车运输实绩表
+                               on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                          left join RMS_WAREHOUSE RW --装卸货仓库
+                               on RW.WAREHOUSE_ID = TLR.LOADING_ID
+                          
+                          left join TMSTRUCK_LEAVE_FACTORY_RESULT TLFR --离厂实绩
+                               on TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                          left join RMS_GATEPOST RGOUT --门岗
+                               on RGOUT.GATEPOST_ID = TLFR.GATEPOST_ID
+                          left join RMS_CAPACITY RC --运力
+                               on RC.CAPACITY_ID = OO.CAPACITY_ID
+                               
+                               
+                          left join AMS_DISPATCH_SALE_ORDER  ADSO
+                               on ASOM.SALE_ORDER_MATERIAL_ID=ADSO.SALE_ORDER_MATERIAL_ID
+                          left join RMS_CARRIER RCR --承运单位
+                               on ADSO.CARRIER_ID=RCR.CARRIER_ID
+                               
+                               
+                          left join RMS_RECEIVE_PLACE RRP  --收货地址
+                               on ASOM.SALE_SHIPPING_ADDRESS_ID=RRP.PLACE_ID
+                          left join RMS_RECEIVE_ADDRESS REA
+                               on RRP.ADDRESS_ID=REA.ADDRESS_ID
+                               
+                          left join AMS_SALE_TRUCKNO_MATERIAL ASTM
+                               on ASOM.SALE_ORDER_MATERIAL_ID=ASTM.SALE_ORDER_MATERIAL_ID
+                        left join TMSTRUCK_WEIGHT_RESULT TWR --运输实绩计重
+                        on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID  and  ASTM.MATERIAL_ID =TWR.MATERIAL_ID
+                        left join AMS_SALE_MATERIAL ASM1
+                               on ASTM.MATERIAL_ID =ASM1.SALE_MATERIAL_ID
+                      
+                          left join RMS_MATERIAL RM
+                               on ASM1.MATERIAL_ID=RM.MATERIAL_ID
+                 where OO.ORDER_TYPE in (1) and TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+             )
+             <where>
+                <if test="orderNumbers !=null">
+                    and "orderNumber" like '${orderNumbers}'
+                </if>
+                 <if test="capacityNumbers !=null">
+                     and "capacityNumber" like '${capacityNumbers}'
+                 </if>
+                 <if test="resultGrossWeightTimes !=null">
+                     and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+                 </if>
+                 <if test="resultGrossWeightTimes !=null">
+                     and "resultGrossWeightTime" like '${resultGrossWeightTimes}'
+                 </if>
+                 <if test="resultOutGateTimes !=null">
+                     and "resultOutGateTime" like '${resultOutGateTimes}'
+                 </if>
+                 <if test="resultNetWeights !=null">
+                     and "resultNetWeight" like '${resultNetWeights}'
+                 </if>
+                 <if test="resultOutGateTimes !=null">
+                     and "resultOutGateTime" like '${resultOutGateTimes}'
+                 </if>
+                 <if test="outGatepostNames !=null">
+                     and "outGatepostName" like '${outGatepostNames}'
+                 </if>
+                 <if test="carrierNames !=null">
+                     and "carrierName" like '${carrierNames}'
+                 </if>
+                 <if test="deliveryAddresss !=null">
+                     and "deliveryAddress" like '${deliveryAddresss}'
+                 </if>
+                 <if test="materialNames !=null">
+                     and "materialName" like '${materialNames}'
+                 </if>
+                 <if test="materialSpecifications !=null">
+                     and "materialSpecification" like '${materialSpecifications}'
+                 </if>
+                 <if test="materialModels !=null">
+                     and "materialModel" like '${materialModels}'
+                 </if>
+                 <if test="receiveNames !=null">
+                     and "receiveName" like '${receiveNames}'
+                 </if>
+                 <if test="orderNumber !=null">
+                     and  "orderNumber" in
+                     <foreach collection="orderNumber" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="capacityNumber !=null">
+                     and  "capacityNumber" in
+                     <foreach collection="capacityNumber" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="resultGrossWeightTime !=null">
+                     and  "resultGrossWeightTime" in
+                     <foreach collection="resultGrossWeightTime" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="resultNetWeight !=null">
+                     and  "resultNetWeight" in
+                     <foreach collection="resultNetWeight" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="resultOutGateTime !=null">
+                     and  "resultOutGateTime" in
+                     <foreach collection="resultOutGateTime" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="outGatepostName !=null">
+                     and  "outGatepostName" in
+                     <foreach collection="outGatepostName" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="carrierName !=null">
+                     and  "carrierName" in
+                     <foreach collection="carrierName" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="deliveryAddress !=null">
+                     and  "deliveryAddress" in
+                     <foreach collection="deliveryAddress" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="materialSpecification !=null">
+                     and  "materialSpecification" in
+                     <foreach collection="materialSpecification" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="materialModel !=null">
+                     and  "materialModel" in
+                     <foreach collection="materialModel" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+                 <if test="receiveName !=null">
+                     and  "receiveName" in
+                     <foreach collection="receiveName" separator="," open="(" close=")" item="item" >
+                         #{item}
+                     </foreach>
+                 </if>
+             </where>
+        <include refid="orderBy"></include>
+    </select>
+    <select id="getTruckFactoryResult" resultType="java.util.Map">
+         SELECT   * from(
+                
+                 SELECT
+                    -- 出厂时间
+                    to_char(TLFR.RESULT_OUT_GATE_TIME,'yyyy-mm-dd hh24:mi:ss')  "resultOutGateTime",
+                    --出厂抓拍图片
+                    TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture",
+                    --出厂方式
+                    TLFR.RESULT_OUT_MODE "resultOutMode",
+                    --门岗名称
+                    RG.GATEPOST_NAME "gatepostName",
+                    -- 运输订单号
+                    OO.ORDER_NUMBER "orderNumber",
+                    -- 车牌号
+                    RC.CAPACITY_NUMBER "capacityNumber",
+                    -- 运输订单id
+                    OO.ORDER_ID "orderId",
+                    -- 订单类型
+                    OO.ORDER_TYPE "orderType",
+                    -- 销售订单号
+                    ASO.SALE_NUMBER  "saleNum",
+                    -- 收货地址
+                    RRA.ADDRESS_DELIVERY_ADDRESS "receiveAddress",
+                    -- 收货单位
+                    RS.SUPPLIER_NAME  "supplierName" ,
+                    -- 发货单位
+                    RS2.SHIPPER_NAME "shipperName"
+                   
+                    
+                    
+                    
+                FROM
+                    -- 出厂实绩
+                    TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+                    --  总实绩
+                    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TLFR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+                    -- 运输订单
+                    LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
+                     -- 销售订单信息
+                    LEFT JOIN  AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
+                    -- 托运人
+                    LEFT JOIN RMS_SUPPLIER RS ON ASO.SHIPPER_ID = RS.SUPPLIER_ID
+                    --  门岗
+                    LEFT JOIN RMS_GATEPOST RG ON TLFR.GATEPOST_ID = RG.GATEPOST_ID
+                    -- 运力信息
+                    LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
+                     -- 销售订单中间表
+                    LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON    ASOM.SALE_ORDER_MATERIAL_ID =OO.ORDER_PLAN_ID
+                    -- 收货地址
+                    LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON    ASOM.SALE_SHIPPING_ADDRESS_ID =RRA.ADDRESS_ID
+                    -- 收货单位
+                    LEFT JOIN RMS_SHIPPER RS2 ON ASO.SHIPPER_ID = RS2.SHIPPER_ID
+                    
+                WHERE
+                    -- 判断出厂实绩的出厂时间不为空
+                    TLFR.RESULT_OUT_GATE_TIME IS NOT NULL
+                    --   并且订单类型等于1(销售订单),2(焦炭发运计划),3(水渣发运计划)
+                    AND OO.ORDER_TYPE =1 AND OO.ORDER_NUMBER=#{orderNumber}
+                    
+                    )
+    </select>
+    <select id="getOrderStatu" resultType="java.lang.Integer">
+        select o_order.ORDER_STATUS from OMSTRUCK_ORDER o_order
+        where o_order.ORDER_NUMBER = #{orderNumber}
+    </select>
+    <sql id="orderBy">
+        <if test="orderField != null and orderField != ''">
+            order by  "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+    </sql>
+</mapper>

+ 392 - 198
src/main/resources/com/steerinfo/dil/mapper/TmstruckReceiptResultMapper.xml

@@ -3,42 +3,53 @@
 <mapper namespace="com.steerinfo.dil.mapper.TmstruckReceiptResultMapper">
   <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiptResult">
     <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    
     <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultEmptyContainerPhoto" />
+    <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="VARCHAR" property="resultSignedNotePhoto" />
+    <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="VARCHAR" property="resultReceiveNotePhoto" />
     <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
     <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
     <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
     <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
     <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
     <result column="STATUS" jdbcType="DECIMAL" property="status" />
-    <result column="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="BLOB" property="resultEmptyContainerPhoto" />
-    <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="BLOB" property="resultSignedNotePhoto" />
-    <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="BLOB" property="resultReceiveNotePhoto" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
   </resultMap>
   <sql id="columns">
-    RESULT_ID, RESULT_TOTAL_ID, WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-    UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO, 
-    RESULT_RECEIVE_NOTE_PHOTO
+    RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO,
+    RESULT_RECEIVE_NOTE_PHOTO, WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK, RESULT_ARRIVAL_ADDRESS
   </sql>
   <sql id="columns_alias">
-    t.RESULT_ID, t.RESULT_TOTAL_ID, t.WAREHOUSE_ID, t.INSERT_USERNAME, t.INSERT_TIME, 
-    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_EMPTY_CONTAINER_PHOTO, 
-    t.RESULT_SIGNED_NOTE_PHOTO, t.RESULT_RECEIVE_NOTE_PHOTO
+    t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_EMPTY_CONTAINER_PHOTO, t.RESULT_SIGNED_NOTE_PHOTO,
+    t.RESULT_RECEIVE_NOTE_PHOTO, t.WAREHOUSE_ID, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
+    t.UPDATE_TIME,STATUS, t.INSERT_UPDATE_REMARK, t.RESULT_ARRIVAL_ADDRESS
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRUCK_RECEIPT_RESULT
+    SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIPT_RESULT
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_RECEIPT_RESULT t
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIPT_RESULT t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="resultId != null">
         and RESULT_ID = #{resultId}
       </if>
       <if test="resultTotalId != null">
         and RESULT_TOTAL_ID = #{resultTotalId}
       </if>
+      <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
+      </if>
+      <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+      </if>
+      <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+      </if>
       <if test="warehouseId != null">
         and WAREHOUSE_ID = #{warehouseId}
       </if>
@@ -54,31 +65,34 @@
       <if test="updateTime != null">
         and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
       </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-      </if>
       <if test="status != null">
         and STATUS = #{status}
       </if>
-      <if test="resultEmptyContainerPhoto != null">
-        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
-      <if test="resultReceiveNotePhoto != null">
-        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
       </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="resultId != null">
         and RESULT_ID = #{resultId}
       </if>
       <if test="resultTotalId != null">
         and RESULT_TOTAL_ID = #{resultTotalId}
       </if>
+      <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+        and RESULT_EMPTY_CONTAINER_PHOTO LIKE '%${resultEmptyContainerPhoto}%'
+      </if>
+      <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+        and RESULT_SIGNED_NOTE_PHOTO LIKE '%${resultSignedNotePhoto}%'
+      </if>
+      <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+        and RESULT_RECEIVE_NOTE_PHOTO LIKE '%${resultReceiveNotePhoto}%'
+      </if>
       <if test="warehouseId != null">
         and WAREHOUSE_ID = #{warehouseId}
       </if>
@@ -94,20 +108,14 @@
       <if test="updateTime != null">
         and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
       </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
-      </if>
       <if test="status != null">
         and STATUS = #{status}
       </if>
-      <if test="resultEmptyContainerPhoto != null">
-        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
       </if>
-      <if test="resultReceiveNotePhoto != null">
-        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
       </if>
     </where>
   </sql>
@@ -117,52 +125,55 @@
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from TMSTRUCK_RECEIPT_RESULT
-    where 1!=1 
-      <if test="resultTotalId != null">
-        or RESULT_TOTAL_ID = #{resultTotalId}
-      </if>
-      <if test="warehouseId != null">
-        or WAREHOUSE_ID = #{warehouseId}
-      </if>
-      <if test="insertUsername != null and insertUsername != ''">
-        or INSERT_USERNAME = #{insertUsername}
-      </if>
-      <if test="insertTime != null">
-        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
-      </if>
-      <if test="updateUsername != null and updateUsername != ''">
-        or UPDATE_USERNAME = #{updateUsername}
-      </if>
-      <if test="updateTime != null">
-        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
-      </if>
-      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
-        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
-      </if>
-      <if test="status != null">
-        or STATUS = #{status}
-      </if>
-      <if test="resultEmptyContainerPhoto != null">
-        or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
-      </if>
-      <if test="resultReceiveNotePhoto != null">
-        or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
-      </if>
+    where 1!=1
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+      or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
+    </if>
+    <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+      or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+    </if>
+    <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+      or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+    </if>
+    <if test="warehouseId != null">
+      or WAREHOUSE_ID = #{warehouseId}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="status != null">
+      or STATUS = '#{status}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+      or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
-    insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, WAREHOUSE_ID, 
-      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, 
-      RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO, 
-      RESULT_RECEIVE_NOTE_PHOTO)
-    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, 
-      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, 
-      #{resultEmptyContainerPhoto,jdbcType=BLOB}, #{resultSignedNotePhoto,jdbcType=BLOB}, 
-      #{resultReceiveNotePhoto,jdbcType=BLOB})
+    insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
+                                         RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
+                                         WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME,
+                                         UPDATE_USERNAME, UPDATE_TIME,STATUS, INSERT_UPDATE_REMARK,
+                                         RESULT_ARRIVAL_ADDRESS)
+    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+            #{resultSignedNotePhoto,jdbcType=VARCHAR}, #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+            #{warehouseId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+            #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},#{status,jdbcType=DECIMAL}, #{insertUpdateRemark,jdbcType=VARCHAR},
+            #{resultArrivalAddress,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
     insert into TMSTRUCK_RECEIPT_RESULT
@@ -173,6 +184,15 @@
       <if test="resultTotalId != null">
         RESULT_TOTAL_ID,
       </if>
+      <if test="resultEmptyContainerPhoto != null">
+        RESULT_EMPTY_CONTAINER_PHOTO,
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        RESULT_SIGNED_NOTE_PHOTO,
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        RESULT_RECEIVE_NOTE_PHOTO,
+      </if>
       <if test="warehouseId != null">
         WAREHOUSE_ID,
       </if>
@@ -188,20 +208,14 @@
       <if test="updateTime != null">
         UPDATE_TIME,
       </if>
-      <if test="insertUpdateRemark != null">
-        INSERT_UPDATE_REMARK,
-      </if>
       <if test="status != null">
         STATUS,
       </if>
-      <if test="resultEmptyContainerPhoto != null">
-        RESULT_EMPTY_CONTAINER_PHOTO,
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        RESULT_SIGNED_NOTE_PHOTO,
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
       </if>
-      <if test="resultReceiveNotePhoto != null">
-        RESULT_RECEIVE_NOTE_PHOTO,
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -211,6 +225,15 @@
       <if test="resultTotalId != null">
         #{resultTotalId,jdbcType=DECIMAL},
       </if>
+      <if test="resultEmptyContainerPhoto != null">
+        #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        #{resultSignedNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+      </if>
       <if test="warehouseId != null">
         #{warehouseId,jdbcType=DECIMAL},
       </if>
@@ -226,36 +249,31 @@
       <if test="updateTime != null">
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="insertUpdateRemark != null">
-        #{insertUpdateRemark,jdbcType=VARCHAR},
-      </if>
       <if test="status != null">
-        #{status,jdbcType=DECIMAL},
+        #{status,jdbcType=TIMESTAMP},
       </if>
-      <if test="resultEmptyContainerPhoto != null">
-        #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        #{resultSignedNotePhoto,jdbcType=BLOB},
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
-      <if test="resultReceiveNotePhoto != null">
-        #{resultReceiveNotePhoto,jdbcType=BLOB},
+      <if test="resultArrivalAddress != null">
+        #{resultArrivalAddress,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
     update TMSTRUCK_RECEIPT_RESULT
     set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
-      WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
-      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
-      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
-      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
-      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
-      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      STATUS = #{status,jdbcType=DECIMAL},
-      RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
-      RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB}
+        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
+        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+        WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        STATUS = #{status,jdbcType=DECIMAL},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR}
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiptResult">
@@ -264,6 +282,15 @@
       <if test="resultTotalId != null">
         RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
       </if>
+      <if test="resultEmptyContainerPhoto != null">
+        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+      </if>
       <if test="warehouseId != null">
         WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
       </if>
@@ -279,121 +306,121 @@
       <if test="updateTime != null">
         UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="insertUpdateRemark != null">
-        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
-      </if>
       <if test="status != null">
         STATUS = #{status,jdbcType=DECIMAL},
       </if>
-      <if test="resultEmptyContainerPhoto != null">
-        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=BLOB},
-      </if>
-      <if test="resultSignedNotePhoto != null">
-        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=BLOB},
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
-      <if test="resultReceiveNotePhoto != null">
-        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=BLOB},
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
       </if>
     </set>
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
   <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+    <include refid="select" />
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </select>
   <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="where"/>
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into TMSTRUCK_RECEIPT_RESULT 
-      (RESULT_ID, 
-      RESULT_TOTAL_ID, WAREHOUSE_ID, INSERT_USERNAME, 
-      INSERT_TIME, UPDATE_USERNAME, 
-      UPDATE_TIME, INSERT_UPDATE_REMARK, 
-      STATUS, RESULT_EMPTY_CONTAINER_PHOTO, 
-      RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO
-      )
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.resultId,jdbcType=DECIMAL}, 
-      #{item.resultTotalId,jdbcType=DECIMAL}, #{item.warehouseId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
-      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
-      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
-      #{item.status,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=BLOB}, 
-      #{item.resultSignedNotePhoto,jdbcType=BLOB}, #{item.resultReceiveNotePhoto,jdbcType=BLOB}
-       from dual  
-   </foreach> )
+    insert into TMSTRUCK_RECEIPT_RESULT
+    (RESULT_ID,
+    RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
+    RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
+    WAREHOUSE_ID, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, STATUS,INSERT_UPDATE_REMARK,
+    RESULT_ARRIVAL_ADDRESS)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR},
+    #{item.resultSignedNotePhoto,jdbcType=VARCHAR}, #{item.resultReceiveNotePhoto,jdbcType=VARCHAR},
+    #{item.warehouseId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+    #{item.updateTime,jdbcType=TIMESTAMP},#{item.status,jdbcType=DECIMAL}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+    #{item.resultArrivalAddress,jdbcType=VARCHAR} from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRUCK_RECEIPT_RESULT
-     set
-       RESULT_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_TOTAL_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
-       </foreach>
-       ,WAREHOUSE_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-       ,STATUS=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_EMPTY_CONTAINER_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=BLOB}
-       </foreach>
-       ,RESULT_SIGNED_NOTE_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=BLOB}
-       </foreach>
-       ,RESULT_RECEIVE_NOTE_PHOTO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=BLOB}
-       </foreach>
-     where RESULT_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.resultId,jdbcType=DECIMAL}
-     </foreach> 
+    update TMSTRUCK_RECEIPT_RESULT
+    set
+    RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TOTAL_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_EMPTY_CONTAINER_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_SIGNED_NOTE_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_RECEIVE_NOTE_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,WAREHOUSE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,STATUS=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_ARRIVAL_ADDRESS=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,jdbcType=VARCHAR}
+    </foreach>
+    where RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from TMSTRUCK_RECEIPT_RESULT
-    where RESULT_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+  
   <!--  获取最大ID值  -->
 
 <!--  通过总实绩ID 查询签收实绩ID -->
@@ -420,6 +447,7 @@
       <if test="updateTime != null">
         UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
       </if>
+      
       <if test="insertUpdateRemark != null">
         INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
@@ -725,5 +753,171 @@
         from TMSTRUCK_RECEIPT_RESULT TRR
         where TRR.RESULT_TOTAL_ID = #{resultTotalId}
     </select>
+<!--  <select id="selectMaxId"  resultType="java.math.BigDecimal">-->
+<!--    select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT-->
+<!--  </select>-->
+  
+  <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select distinct a_s_order.SALE_NUMBER "saleNumber",
+    o_torder.ORDER_NUMBER "orderNumber",
+    r_material.MATERIAL_NAME "materialName",
+    r_material.MATERIAL_MODEL "materialModel",
+    r_capacity.CAPACITY_NUMBER "capacityNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    t_receipt.RESULT_ARRIVAL_ADDRESS "resultReceiptAddress",
+    receive_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
+    t_receipt.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
+    t_arrival.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto",
+    t_receipt.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
+    t_receipt.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto",
+    t_receiptchild.OTHER_PHOTO1 "otherPhoto1",
+    t_receiptchild.OTHER_PHOTO2 "otherPhoto2",
+    t_receiptchild.OTHER_PHOTO3 "otherPhoto3",
+    t_receipt.INSERT_TIME "receiptTime",
+    r_carrier.CARRIER_NAME "carrierName",
+    r_gatepost.GATEPOST_NAME "gatepostName"
+    from TMSTRUCK_RECEIPT_RESULT t_receipt
+    left join TMSTRUCK_TOTAL_RESULT t_total
+    on t_receipt.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER o_torder
+    on t_total.ORDER_ID=o_torder.ORDER_ID
+    left join RMS_CAPACITY r_capacity
+    on o_torder.CAPACITY_ID=r_capacity.CAPACITY_ID
+    left join RMS_DRIVER_CAPACITY r_d_capacity
+    on r_capacity.CAPACITY_ID=r_d_capacity.CAPACITY_ID
+    left join RMS_CARRIER r_carrier
+    on o_torder.CARRIER_ID=r_carrier.CARRIER_ID
+    left join RMS_CAR_DRIVER r_driver
+    on r_d_capacity.DRIVER_ID=r_driver.DRIVER_ID
+    left join AMS_SALE_ORDER_MATERIAL sale_material
+    on o_torder.ORDER_PLAN_ID=sale_material.SALE_ORDER_MATERIAL_ID
+    left join RMS_RECEIVE_ADDRESS receive_address
+    on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
+    left join RMS_MATERIAL r_material
+    on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
+    left join AMS_SALE_ORDER a_s_order
+    on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+    left join RMS_SHIPPER r_shipper
+    on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
+    left join RMS_CONSIGNEE r_consignee
+    on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
+    left join TMSTRUCK_RECEIPT_RESULT_CHILD t_receiptchild
+    on t_receipt.RESULT_ID=t_receiptchild.RECEIPT_RESULT_ID
+    left join TMSTRUCK_LEAVE_FACTORY_RESULT t_leave
+    on t_total.RESULT_TOTAL_ID=t_leave.RESULT_TOTAL_ID
+    LEFT JOIN RMS_GATEPOST r_gatepost
+    ON t_leave.GATEPOST_ID = r_gatepost.GATEPOST_ID
+    left join TMSTRUCK_ARRIVAL_RESULT t_arrival
+    on t_total.RESULT_TOTAL_ID=t_arrival.RESULT_TOTAL_ID
+    order by t_receipt.INSERT_TIME desc)
+    <where>
+      <if test="productClassification != null and productClassification != '其他' and productClassification != '螺纹钢'">
+        and  "materialName" like '%${productClassification}%'
+      </if>
+      <if test="productClassification != null and '螺纹钢' == productClassification">
+        and ("materialName" like '%螺纹钢%' or "materialName" like '%盘螺%'
+        or  "materialName" like '%盘圆%' or "materialName" like '%非定尺材%')
+      </if>
+      <if test="productClassification != null and '其他' == productClassification">
+        and  "materialName" not like '%带钢%' and "materialName" not like '%微粉%'
+        and  "materialName" not like '%螺纹钢%'  and  "materialName" not like '%非定尺材%' and "materialName" not like '%钢坯%'
+        and  "materialName" not like '%盘螺%' and "materialName" not like '%盘圆%'
+      </if>
+      <if test="carrierName1 != null">
+        and "carrierName" like  '%${carrierName1}%'
+      </if>
+      <if test="gatepostName1 !=null">
+        and "gatepostName" like '%${gatepostName1}%'
+      </if>
+      <if test="capacityNumber1 != null">
+        and  "capacityNumber" like '%${capacityNumber1}%'
+      </if>
+      <if test="consigneeCompanyName1 != null">
+        and  "consigneeCompanyName" like '%${consigneeCompanyName1}%'
+      </if>
+      <if test="startTime != null">
+        and "receiptTime" &gt;= to_date('${startTime}','yyyy-mm-dd')
+      </if>
+      <if test="endTime != null">
+        and "receiptTime" &lt;= to_date('${endTime}','yyyy-mm-dd')
+      </if>
+      
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialModel != null">
+        and
+        <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
+          "materialModel" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultReceiptAddress != null">
+        and
+        <foreach collection="resultReceiptAddress" item="item" open="(" separator="or" close=")">
+          "resultReceiptAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="addressDeliveryAddress != null">
+        and
+        <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
+          "addressDeliveryAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="receiptTime != null">
+        and
+        <foreach collection="receiptTime" item="item" open="(" separator="or" close=")">
+          "receiptTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="carrierName != null">
+        and
+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+          "carrierName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="gatepostName != null">
+        and
+        <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+          "gatepostName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
 
 </mapper>

+ 544 - 0
src/main/resources/com/steerinfo/route/mapper/TmstruckArrivalResultMapper.xml

@@ -0,0 +1,544 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.route.mapper.TmstruckArrivalResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.route.model.TmstruckArrivalResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="POINT_ID" jdbcType="DECIMAL" property="pointId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
+    <result column="RESULT_FULL_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultFullContainerPhoto" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, POINT_ID, RESULT_TOTAL_ID, RESULT_ARRIVAL_ADDRESS, RESULT_FULL_CONTAINER_PHOTO, 
+    INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.POINT_ID, t.RESULT_TOTAL_ID, t.RESULT_ARRIVAL_ADDRESS, t.RESULT_FULL_CONTAINER_PHOTO, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM TMSTRUCK_ARRIVAL_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_ARRIVAL_RESULT t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="pointId != null">
+        and POINT_ID = #{pointId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
+      </if>
+      <if test="resultFullContainerPhoto != null and resultFullContainerPhoto != ''">
+        and RESULT_FULL_CONTAINER_PHOTO = #{resultFullContainerPhoto}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="pointId != null">
+        and POINT_ID = #{pointId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
+      </if>
+      <if test="resultFullContainerPhoto != null and resultFullContainerPhoto != ''">
+        and RESULT_FULL_CONTAINER_PHOTO LIKE '%${resultFullContainerPhoto}%'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_ARRIVAL_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_ARRIVAL_RESULT
+    where 1!=1
+    <if test="pointId != null">
+      or POINT_ID = #{pointId}
+    </if>
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+      or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
+    </if>
+    <if test="resultFullContainerPhoto != null and resultFullContainerPhoto != ''">
+      or RESULT_FULL_CONTAINER_PHOTO = #{resultFullContainerPhoto}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.route.model.TmstruckArrivalResult">
+    insert into TMSTRUCK_ARRIVAL_RESULT (RESULT_ID, POINT_ID, RESULT_TOTAL_ID,
+                                         RESULT_ARRIVAL_ADDRESS, RESULT_FULL_CONTAINER_PHOTO,
+                                         INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                         UPDATE_TIME, INSERT_UPDATE_REMARK)
+    values (#{resultId,jdbcType=DECIMAL}, #{pointId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
+            #{resultArrivalAddress,jdbcType=VARCHAR}, #{resultFullContainerPhoto,jdbcType=VARCHAR},
+            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
+            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.route.model.TmstruckArrivalResult">
+    insert into TMSTRUCK_ARRIVAL_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="pointId != null">
+        POINT_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS,
+      </if>
+      <if test="resultFullContainerPhoto != null">
+        RESULT_FULL_CONTAINER_PHOTO,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="pointId != null">
+        #{pointId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultArrivalAddress != null">
+        #{resultArrivalAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="resultFullContainerPhoto != null">
+        #{resultFullContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.route.model.TmstruckArrivalResult">
+    update TMSTRUCK_ARRIVAL_RESULT
+    set POINT_ID = #{pointId,jdbcType=DECIMAL},
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
+        RESULT_FULL_CONTAINER_PHOTO = #{resultFullContainerPhoto,jdbcType=VARCHAR},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.route.model.TmstruckArrivalResult">
+    update TMSTRUCK_ARRIVAL_RESULT
+    <set>
+      <if test="pointId != null">
+        POINT_ID = #{pointId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="resultFullContainerPhoto != null">
+        RESULT_FULL_CONTAINER_PHOTO = #{resultFullContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRUCK_ARRIVAL_RESULT
+    (RESULT_ID,
+    POINT_ID, RESULT_TOTAL_ID, RESULT_ARRIVAL_ADDRESS,
+    RESULT_FULL_CONTAINER_PHOTO, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK
+    )
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.pointId,jdbcType=DECIMAL}, #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultArrivalAddress,jdbcType=VARCHAR},
+    #{item.resultFullContainerPhoto,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update TMSTRUCK_ARRIVAL_RESULT
+    set
+    RESULT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,POINT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.pointId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TOTAL_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_ARRIVAL_ADDRESS=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_FULL_CONTAINER_PHOTO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultFullContainerPhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    where RESULT_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <update id="updateTown" parameterType="string">
+    update RMS_RECEIVE_ADDRESS set ADDRESS_TOWN='${city}'  where ADDRESS_DISTRICT ='${item}'
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_ARRIVAL_RESULT
+    where RESULT_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(RESULT_ID) from TMSTRUCK_ARRIVAL_RESULT
+  </select>
+
+  <select id="getArrivalResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select distinct a_s_order.SALE_NUMBER "saleNumber",
+    o_torder.ORDER_NUMBER "orderNumber",
+    r_material.MATERIAL_NAME "materialName",
+    r_material.MATERIAL_MODEL "materialModel",
+    r_capacity.CAPACITY_NUMBER "capacityNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    t_arrival.RESULT_ARRIVAL_ADDRESS "resultArrivalAddress",
+    receive_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
+    t_arrival.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto",
+    t_arrival.INSERT_TIME "arrivalTime",
+    r_carrier.CARRIER_NAME "carrierName",
+    r_gatepost.GATEPOST_NAME "gatepostName"
+    from TMSTRUCK_ARRIVAL_RESULT t_arrival
+    left join TMSTRUCK_TOTAL_RESULT t_total
+    on t_arrival.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER o_torder
+    on t_total.ORDER_ID=o_torder.ORDER_ID
+    left join RMS_CAPACITY r_capacity
+    on o_torder.CAPACITY_ID=r_capacity.CAPACITY_ID
+    left join RMS_DRIVER_CAPACITY r_d_capacity
+    on r_capacity.CAPACITY_ID=r_d_capacity.CAPACITY_ID
+    left join RMS_CARRIER r_carrier
+    on o_torder.CARRIER_ID=r_carrier.CARRIER_ID
+    left join RMS_CAR_DRIVER r_driver
+    on r_d_capacity.DRIVER_ID=r_driver.DRIVER_ID
+    left join AMS_SALE_ORDER_MATERIAL sale_material
+    on o_torder.ORDER_PLAN_ID=sale_material.SALE_ORDER_MATERIAL_ID
+    left join RMS_RECEIVE_ADDRESS receive_address
+    on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
+    left join RMS_MATERIAL r_material
+    on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
+    left join AMS_SALE_ORDER a_s_order
+    on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+    left join RMS_SHIPPER r_shipper
+    on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
+    left join RMS_CONSIGNEE r_consignee
+    on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
+    left join TMSTRUCK_LEAVE_FACTORY_RESULT t_leave
+    on t_total.RESULT_TOTAL_ID=t_leave.RESULT_TOTAL_ID
+    LEFT JOIN RMS_GATEPOST r_gatepost
+    ON t_leave.GATEPOST_ID = r_gatepost.GATEPOST_ID
+    order by t_arrival.INSERT_TIME desc)
+    <where>
+      <if test="productClassification != null and productClassification != '其他' and productClassification != '螺纹钢'">
+        and  "materialName" like '%${productClassification}%'
+      </if>
+      <if test="productClassification != null and '螺纹钢' == productClassification">
+        and ("materialName" like '%螺纹钢%' or "materialName" like '%盘螺%'
+        or  "materialName" like '%盘圆%' or "materialName" like '%非定尺材%')
+      </if>
+      <if test="productClassification != null and '其他' == productClassification">
+        and  "materialName" not like '%带钢%' and "materialName" not like '%微粉%'
+        and  "materialName" not like '%螺纹钢%' and  "materialName" not like '%非定尺材%' and "materialName" not like '%钢坯%'
+        and  "materialName" not like '%盘螺%' and "materialName" not like '%盘圆%'
+      </if>
+      <if test="carrierName1 != null">
+        and "carrierName" like '%${carrierName1}%'
+      </if>
+      <if test="gatepostName1 !=null">
+        and "gatepostName" like '%${gatepostName1}%'
+      </if>
+      <if test="capacityNumber1 != null">
+        and  "capacityNumber" like '%${capacityNumber1}%'
+      </if>
+      <if test="consigneeCompanyName1 != null">
+        and  "consigneeCompanyName" like '%${consigneeCompanyName1}%'
+      </if>
+      <if test="startTime != null">
+        and "arrivalTime" &gt;= to_date('${startTime}','yyyy-mm-dd')
+      </if>
+      <if test="endTime != null">
+        and "arrivalTime" &lt;= to_date('${endTime}','yyyy-mm-dd')
+      </if>
+
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialModel != null">
+        and
+        <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
+          "materialModel" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultArrivalAddress != null">
+        and
+        <foreach collection="resultArrivalAddress" item="item" open="(" separator="or" close=")">
+          "resultArrivalAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="addressDeliveryAddress != null">
+        and
+        <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
+          "addressDeliveryAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="arrivalTime != null">
+        and
+        <foreach collection="arrivalTime" item="item" open="(" separator="or" close=")">
+          "arrivalTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="carrierName != null">
+        and
+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+          "carrierName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="gatepostName != null">
+        and
+        <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+          "gatepostName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
+  <select id="alreadyExistsArrivalResult" parameterType="String" resultType="java.math.BigDecimal">
+   
+    select max(RESULT_ID)
+    from TMSTRUCK_ARRIVAL_RESULT t_arrival
+           left join TMSTRUCK_TOTAL_RESULT t_total
+                     on t_arrival.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
+           left join OMSTRUCK_ORDER o_torder
+                     on t_total.ORDER_ID=o_torder.ORDER_ID
+    where o_torder.ORDER_NUMBER = #{orderNumber}
+  </select>
+  
+ 
+    <select id="getAddressDistrict" resultType="java.lang.String">
+      select receive_address.ADDRESS_TOWN "addressDistrict"
+      FROM
+       OMSTRUCK_ORDER o_torder
+       LEFT JOIN AMS_SALE_ORDER_MATERIAL sale_material ON o_torder.ORDER_PLAN_ID = sale_material.SALE_ORDER_MATERIAL_ID
+       LEFT JOIN RMS_RECEIVE_ADDRESS receive_address ON sale_material.SALE_SHIPPING_ADDRESS_ID = receive_address.ADDRESS_ID
+       WHERE
+       o_torder.ORDER_NUMBER = #{orderNumber}
+    </select>
+    <select id="getAdjustment" resultType="java.lang.String">
+      SELECT distinct ADDRESS_DISTRICT FROM RMS_RECEIVE_ADDRESS where ADDRESS_TOWN is null
+    </select>
+  <select id="getTotalIdByOrderNumber" resultType="java.math.BigDecimal">
+        select RESULT_TOTAL_ID "totalId"
+        from TMSTRUCK_TOTAL_RESULT t_total
+               left join OMSTRUCK_ORDER o_order
+                         on t_total.ORDER_ID=o_order.ORDER_ID
+        where o_order.ORDER_NUMBER = #{orderNumber}
+  </select>
+  
+  
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by  "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+  </sql>
+</mapper>

+ 347 - 0
src/main/resources/com/steerinfo/route/mapper/TmstruckReceiptResultChildMapper.xml

@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.route.mapper.TmstruckReceiptResultChildMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.route.model.TmstruckReceiptResultChild">
+    <id column="CHILD_ID" jdbcType="DECIMAL" property="childId" />
+    <result column="RECEIPT_RESULT_ID" jdbcType="DECIMAL" property="receiptResultId" />
+    <result column="OTHER_PHOTO1" jdbcType="VARCHAR" property="otherPhoto1" />
+    <result column="OTHER_PHOTO2" jdbcType="VARCHAR" property="otherPhoto2" />
+    <result column="OTHER_PHOTO3" jdbcType="VARCHAR" property="otherPhoto3" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    CHILD_ID, RECEIPT_RESULT_ID, OTHER_PHOTO1, OTHER_PHOTO2, OTHER_PHOTO3, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.CHILD_ID, t.RECEIPT_RESULT_ID, t.OTHER_PHOTO1, t.OTHER_PHOTO2, t.OTHER_PHOTO3, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM TMSTRUCK_RECEIPT_RESULT_CHILD
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM TMSTRUCK_RECEIPT_RESULT_CHILD t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="childId != null">
+        and CHILD_ID = #{childId}
+      </if>
+      <if test="receiptResultId != null">
+        and RECEIPT_RESULT_ID = #{receiptResultId}
+      </if>
+      <if test="otherPhoto1 != null and otherPhoto1 != ''">
+        and OTHER_PHOTO1 = #{otherPhoto1}
+      </if>
+      <if test="otherPhoto2 != null and otherPhoto2 != ''">
+        and OTHER_PHOTO2 = #{otherPhoto2}
+      </if>
+      <if test="otherPhoto3 != null and otherPhoto3 != ''">
+        and OTHER_PHOTO3 = #{otherPhoto3}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="childId != null">
+        and CHILD_ID = #{childId}
+      </if>
+      <if test="receiptResultId != null">
+        and RECEIPT_RESULT_ID = #{receiptResultId}
+      </if>
+      <if test="otherPhoto1 != null and otherPhoto1 != ''">
+        and OTHER_PHOTO1 LIKE '%${otherPhoto1}%'
+      </if>
+      <if test="otherPhoto2 != null and otherPhoto2 != ''">
+        and OTHER_PHOTO2 LIKE '%${otherPhoto2}%'
+      </if>
+      <if test="otherPhoto3 != null and otherPhoto3 != ''">
+        and OTHER_PHOTO3 LIKE '%${otherPhoto3}%'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_RECEIPT_RESULT_CHILD
+    where CHILD_ID = #{childId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_RECEIPT_RESULT_CHILD
+    where 1!=1
+    <if test="receiptResultId != null">
+      or RECEIPT_RESULT_ID = #{receiptResultId}
+    </if>
+    <if test="otherPhoto1 != null and otherPhoto1 != ''">
+      or OTHER_PHOTO1 = #{otherPhoto1}
+    </if>
+    <if test="otherPhoto2 != null and otherPhoto2 != ''">
+      or OTHER_PHOTO2 = #{otherPhoto2}
+    </if>
+    <if test="otherPhoto3 != null and otherPhoto3 != ''">
+      or OTHER_PHOTO3 = #{otherPhoto3}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.route.model.TmstruckReceiptResultChild">
+    insert into TMSTRUCK_RECEIPT_RESULT_CHILD (CHILD_ID, RECEIPT_RESULT_ID, OTHER_PHOTO1,
+                                               OTHER_PHOTO2, OTHER_PHOTO3, INSERT_USERNAME,
+                                               INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                               INSERT_UPDATE_REMARK)
+    values (#{childId,jdbcType=DECIMAL}, #{receiptResultId,jdbcType=DECIMAL}, #{otherPhoto1,jdbcType=VARCHAR},
+            #{otherPhoto2,jdbcType=VARCHAR}, #{otherPhoto3,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
+            #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+            #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.route.model.TmstruckReceiptResultChild">
+    insert into TMSTRUCK_RECEIPT_RESULT_CHILD
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="childId != null">
+        CHILD_ID,
+      </if>
+      <if test="receiptResultId != null">
+        RECEIPT_RESULT_ID,
+      </if>
+      <if test="otherPhoto1 != null">
+        OTHER_PHOTO1,
+      </if>
+      <if test="otherPhoto2 != null">
+        OTHER_PHOTO2,
+      </if>
+      <if test="otherPhoto3 != null">
+        OTHER_PHOTO3,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="childId != null">
+        #{childId,jdbcType=DECIMAL},
+      </if>
+      <if test="receiptResultId != null">
+        #{receiptResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="otherPhoto1 != null">
+        #{otherPhoto1,jdbcType=VARCHAR},
+      </if>
+      <if test="otherPhoto2 != null">
+        #{otherPhoto2,jdbcType=VARCHAR},
+      </if>
+      <if test="otherPhoto3 != null">
+        #{otherPhoto3,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.route.model.TmstruckReceiptResultChild">
+    update TMSTRUCK_RECEIPT_RESULT_CHILD
+    set RECEIPT_RESULT_ID = #{receiptResultId,jdbcType=DECIMAL},
+        OTHER_PHOTO1 = #{otherPhoto1,jdbcType=VARCHAR},
+        OTHER_PHOTO2 = #{otherPhoto2,jdbcType=VARCHAR},
+        OTHER_PHOTO3 = #{otherPhoto3,jdbcType=VARCHAR},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
+    where CHILD_ID = #{childId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.route.model.TmstruckReceiptResultChild">
+    update TMSTRUCK_RECEIPT_RESULT_CHILD
+    <set>
+      <if test="receiptResultId != null">
+        RECEIPT_RESULT_ID = #{receiptResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="otherPhoto1 != null">
+        OTHER_PHOTO1 = #{otherPhoto1,jdbcType=VARCHAR},
+      </if>
+      <if test="otherPhoto2 != null">
+        OTHER_PHOTO2 = #{otherPhoto2,jdbcType=VARCHAR},
+      </if>
+      <if test="otherPhoto3 != null">
+        OTHER_PHOTO3 = #{otherPhoto3,jdbcType=VARCHAR},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where CHILD_ID = #{childId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where CHILD_ID = #{childId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRUCK_RECEIPT_RESULT_CHILD
+    (CHILD_ID,
+    RECEIPT_RESULT_ID, OTHER_PHOTO1,
+    OTHER_PHOTO2, OTHER_PHOTO3, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK
+    )
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.childId,jdbcType=DECIMAL},
+    #{item.receiptResultId,jdbcType=DECIMAL}, #{item.otherPhoto1,jdbcType=VARCHAR},
+    #{item.otherPhoto2,jdbcType=VARCHAR}, #{item.otherPhoto3,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update TMSTRUCK_RECEIPT_RESULT_CHILD
+    set
+    CHILD_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.childId,jdbcType=DECIMAL}
+    </foreach>
+    ,RECEIPT_RESULT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.receiptResultId,jdbcType=DECIMAL}
+    </foreach>
+    ,OTHER_PHOTO1=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.otherPhoto1,jdbcType=VARCHAR}
+    </foreach>
+    ,OTHER_PHOTO2=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.otherPhoto2,jdbcType=VARCHAR}
+    </foreach>
+    ,OTHER_PHOTO3=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.otherPhoto3,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case CHILD_ID" close="end">
+      when #{item.childId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    where CHILD_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.childId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_RECEIPT_RESULT_CHILD
+    where CHILD_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(CHILD_ID) from TMSTRUCK_RECEIPT_RESULT_CHILD
+  </select>
+</mapper>

+ 573 - 0
src/main/resources/com/steerinfo/route/mapper/TmstruckReceiptResultMapper.xml

@@ -0,0 +1,573 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.route.mapper.TmstruckReceiptResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.route.model.TmstruckReceiptResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_EMPTY_CONTAINER_PHOTO" jdbcType="VARCHAR" property="resultEmptyContainerPhoto" />
+    <result column="RESULT_SIGNED_NOTE_PHOTO" jdbcType="VARCHAR" property="resultSignedNotePhoto" />
+    <result column="RESULT_RECEIVE_NOTE_PHOTO" jdbcType="VARCHAR" property="resultReceiveNotePhoto" />
+    <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="RESULT_ARRIVAL_ADDRESS" jdbcType="VARCHAR" property="resultArrivalAddress" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO, RESULT_SIGNED_NOTE_PHOTO, 
+    RESULT_RECEIVE_NOTE_PHOTO, WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, RESULT_ARRIVAL_ADDRESS
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_EMPTY_CONTAINER_PHOTO, t.RESULT_SIGNED_NOTE_PHOTO, 
+    t.RESULT_RECEIVE_NOTE_PHOTO, t.WAREHOUSE_ID, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, 
+    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.RESULT_ARRIVAL_ADDRESS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIPT_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIPT_RESULT t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+        and RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
+      </if>
+      <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+        and RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+      </if>
+      <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+        and RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+      </if>
+      <if test="warehouseId != null">
+        and WAREHOUSE_ID = #{warehouseId}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="resultTotalId != null">
+        and RESULT_TOTAL_ID = #{resultTotalId}
+      </if>
+      <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+        and RESULT_EMPTY_CONTAINER_PHOTO LIKE '%${resultEmptyContainerPhoto}%'
+      </if>
+      <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+        and RESULT_SIGNED_NOTE_PHOTO LIKE '%${resultSignedNotePhoto}%'
+      </if>
+      <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+        and RESULT_RECEIVE_NOTE_PHOTO LIKE '%${resultReceiveNotePhoto}%'
+      </if>
+      <if test="warehouseId != null">
+        and WAREHOUSE_ID = #{warehouseId}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+        and RESULT_ARRIVAL_ADDRESS LIKE '%${resultArrivalAddress}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRUCK_RECEIPT_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_RECEIPT_RESULT
+    where 1!=1
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="resultEmptyContainerPhoto != null and resultEmptyContainerPhoto != ''">
+      or RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto}
+    </if>
+    <if test="resultSignedNotePhoto != null and resultSignedNotePhoto != ''">
+      or RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto}
+    </if>
+    <if test="resultReceiveNotePhoto != null and resultReceiveNotePhoto != ''">
+      or RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto}
+    </if>
+    <if test="warehouseId != null">
+      or WAREHOUSE_ID = #{warehouseId}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="resultArrivalAddress != null and resultArrivalAddress != ''">
+      or RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.route.model.TmstruckReceiptResult">
+    insert into TMSTRUCK_RECEIPT_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
+                                         RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
+                                         WAREHOUSE_ID, INSERT_USERNAME, INSERT_TIME,
+                                         UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                                         RESULT_ARRIVAL_ADDRESS)
+    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+            #{resultSignedNotePhoto,jdbcType=VARCHAR}, #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+            #{warehouseId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+            #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+            #{resultArrivalAddress,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.route.model.TmstruckReceiptResult">
+    insert into TMSTRUCK_RECEIPT_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="resultEmptyContainerPhoto != null">
+        RESULT_EMPTY_CONTAINER_PHOTO,
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        RESULT_SIGNED_NOTE_PHOTO,
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        RESULT_RECEIVE_NOTE_PHOTO,
+      </if>
+      <if test="warehouseId != null">
+        WAREHOUSE_ID,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultTotalId != null">
+        #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultEmptyContainerPhoto != null">
+        #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        #{resultSignedNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="warehouseId != null">
+        #{warehouseId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="resultArrivalAddress != null">
+        #{resultArrivalAddress,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.route.model.TmstruckReceiptResult">
+    update TMSTRUCK_RECEIPT_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
+        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+        WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.route.model.TmstruckReceiptResult">
+    update TMSTRUCK_RECEIPT_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultEmptyContainerPhoto != null">
+        RESULT_EMPTY_CONTAINER_PHOTO = #{resultEmptyContainerPhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultSignedNotePhoto != null">
+        RESULT_SIGNED_NOTE_PHOTO = #{resultSignedNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="resultReceiveNotePhoto != null">
+        RESULT_RECEIVE_NOTE_PHOTO = #{resultReceiveNotePhoto,jdbcType=VARCHAR},
+      </if>
+      <if test="warehouseId != null">
+        WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="resultArrivalAddress != null">
+        RESULT_ARRIVAL_ADDRESS = #{resultArrivalAddress,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRUCK_RECEIPT_RESULT
+    (RESULT_ID,
+    RESULT_TOTAL_ID, RESULT_EMPTY_CONTAINER_PHOTO,
+    RESULT_SIGNED_NOTE_PHOTO, RESULT_RECEIVE_NOTE_PHOTO,
+    WAREHOUSE_ID, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK,
+    RESULT_ARRIVAL_ADDRESS)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR},
+    #{item.resultSignedNotePhoto,jdbcType=VARCHAR}, #{item.resultReceiveNotePhoto,jdbcType=VARCHAR},
+    #{item.warehouseId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+    #{item.resultArrivalAddress,jdbcType=VARCHAR} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update TMSTRUCK_RECEIPT_RESULT
+    set
+    RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_TOTAL_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_EMPTY_CONTAINER_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEmptyContainerPhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_SIGNED_NOTE_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultSignedNotePhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_RECEIVE_NOTE_PHOTO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultReceiveNotePhoto,jdbcType=VARCHAR}
+    </foreach>
+    ,WAREHOUSE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_ARRIVAL_ADDRESS=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultArrivalAddress,jdbcType=VARCHAR}
+    </foreach>
+    where RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRUCK_RECEIPT_RESULT
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(RESULT_ID) from TMSTRUCK_RECEIPT_RESULT
+  </select>
+
+  <select id="getReceiptResultInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select distinct a_s_order.SALE_NUMBER "saleNumber",
+    o_torder.ORDER_NUMBER "orderNumber",
+    r_material.MATERIAL_NAME "materialName",
+    r_material.MATERIAL_MODEL "materialModel",
+    r_capacity.CAPACITY_NUMBER "capacityNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    t_receipt.RESULT_ARRIVAL_ADDRESS "resultReceiptAddress",
+    receive_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
+    t_receipt.RESULT_EMPTY_CONTAINER_PHOTO "resultEmptyContainerPhoto",
+    t_arrival.RESULT_FULL_CONTAINER_PHOTO "resultFullContainerPhoto",
+    t_receipt.RESULT_SIGNED_NOTE_PHOTO "resultSignedNotePhoto",
+    t_receipt.RESULT_RECEIVE_NOTE_PHOTO "resultReceiveNotePhoto",
+    t_receiptchild.OTHER_PHOTO1 "otherPhoto1",
+    t_receiptchild.OTHER_PHOTO2 "otherPhoto2",
+    t_receiptchild.OTHER_PHOTO3 "otherPhoto3",
+    t_receipt.INSERT_TIME "receiptTime",
+    r_carrier.CARRIER_NAME "carrierName",
+    r_gatepost.GATEPOST_NAME "gatepostName"
+    from TMSTRUCK_RECEIPT_RESULT t_receipt
+    left join TMSTRUCK_TOTAL_RESULT t_total
+    on t_receipt.RESULT_TOTAL_ID=t_total.RESULT_TOTAL_ID
+    left join OMSTRUCK_ORDER o_torder
+    on t_total.ORDER_ID=o_torder.ORDER_ID
+    left join RMS_CAPACITY r_capacity
+    on o_torder.CAPACITY_ID=r_capacity.CAPACITY_ID
+    left join RMS_DRIVER_CAPACITY r_d_capacity
+    on r_capacity.CAPACITY_ID=r_d_capacity.CAPACITY_ID
+    left join RMS_CARRIER r_carrier
+    on o_torder.CARRIER_ID=r_carrier.CARRIER_ID
+    left join RMS_CAR_DRIVER r_driver
+    on r_d_capacity.DRIVER_ID=r_driver.DRIVER_ID
+    left join AMS_SALE_ORDER_MATERIAL sale_material
+    on o_torder.ORDER_PLAN_ID=sale_material.SALE_ORDER_MATERIAL_ID
+    left join RMS_RECEIVE_ADDRESS receive_address
+    on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
+    left join RMS_MATERIAL r_material
+    on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
+    left join AMS_SALE_ORDER a_s_order
+    on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+    left join RMS_SHIPPER r_shipper
+    on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
+    left join RMS_CONSIGNEE r_consignee
+    on a_s_order.CONSIGNEE_ID=r_consignee.CONSIGNEE_ID
+    left join TMSTRUCK_RECEIPT_RESULT_CHILD t_receiptchild
+    on t_receipt.RESULT_ID=t_receiptchild.RECEIPT_RESULT_ID
+    left join TMSTRUCK_LEAVE_FACTORY_RESULT t_leave
+    on t_total.RESULT_TOTAL_ID=t_leave.RESULT_TOTAL_ID
+    LEFT JOIN RMS_GATEPOST r_gatepost
+    ON t_leave.GATEPOST_ID = r_gatepost.GATEPOST_ID
+    left join TMSTRUCK_ARRIVAL_RESULT t_arrival
+    on t_total.RESULT_TOTAL_ID=t_arrival.RESULT_TOTAL_ID
+    order by t_receipt.INSERT_TIME desc)
+    <where>
+      <if test="productClassification != null and productClassification != '其他' and productClassification != '螺纹钢'">
+        and  "materialName" like '%${productClassification}%'
+      </if>
+      <if test="productClassification != null and '螺纹钢' == productClassification">
+        and ("materialName" like '%螺纹钢%' or "materialName" like '%盘螺%'
+        or  "materialName" like '%盘圆%' or "materialName" like '%非定尺材%')
+      </if>
+      <if test="productClassification != null and '其他' == productClassification">
+        and  "materialName" not like '%带钢%' and "materialName" not like '%微粉%'
+        and  "materialName" not like '%螺纹钢%'  and  "materialName" not like '%非定尺材%' and "materialName" not like '%钢坯%'
+        and  "materialName" not like '%盘螺%' and "materialName" not like '%盘圆%'
+      </if>
+      <if test="carrierName1 != null">
+        and "carrierName" like  '%${carrierName1}%'
+      </if>
+      <if test="gatepostName1 !=null">
+        and "gatepostName" like '%${gatepostName1}%'
+      </if>
+      <if test="capacityNumber1 != null">
+        and  "capacityNumber" like '%${capacityNumber1}%'
+      </if>
+      <if test="consigneeCompanyName1 != null">
+        and  "consigneeCompanyName" like '%${consigneeCompanyName1}%'
+      </if>
+      <if test="startTime != null">
+        and "receiptTime" &gt;= to_date('${startTime}','yyyy-mm-dd')
+      </if>
+      <if test="endTime != null">
+        and "receiptTime" &lt;= to_date('${endTime}','yyyy-mm-dd')
+      </if>
+
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="orderNumber != null">
+        and
+        <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
+          "orderNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialModel != null">
+        and
+        <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
+          "materialModel" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="capacityNumber != null">
+        and
+        <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+          "capacityNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultReceiptAddress != null">
+        and
+        <foreach collection="resultReceiptAddress" item="item" open="(" separator="or" close=")">
+          "resultReceiptAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="addressDeliveryAddress != null">
+        and
+        <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
+          "addressDeliveryAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="receiptTime != null">
+        and
+        <foreach collection="receiptTime" item="item" open="(" separator="or" close=")">
+          "receiptTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="carrierName != null">
+        and
+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+          "carrierName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="gatepostName != null">
+        and
+        <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
+          "gatepostName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
+
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by  "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+  </sql>
+</mapper>