zx 2 năm trước cách đây
mục cha
commit
7ce9d2040a
29 tập tin đã thay đổi với 4496 bổ sung143 xóa
  1. 1 6
      pom.xml
  2. 27 0
      src/main/java/com/steerinfo/dil/controller/AmsContractTruckPriceController.java
  3. 149 28
      src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java
  4. 1 0
      src/main/java/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.java
  5. 19 0
      src/main/java/com/steerinfo/dil/mapper/AmsSaleMaterialMapper.java
  6. 22 1
      src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMapper.java
  7. 16 0
      src/main/java/com/steerinfo/dil/mapper/RmsLineNodePointMapper.java
  8. 23 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.java
  9. 23 0
      src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java
  10. 19 0
      src/main/java/com/steerinfo/dil/mapper/WmspOutboundResultMaterialMapper.java
  11. 184 0
      src/main/java/com/steerinfo/dil/model/RmsLineNodePoint.java
  12. 400 0
      src/main/java/com/steerinfo/dil/model/TmstruckLoadResult.java
  13. 366 0
      src/main/java/com/steerinfo/dil/model/TmstruckWeightResult.java
  14. 211 0
      src/main/java/com/steerinfo/dil/model/WmspOutboundResultMaterial.java
  15. 4 0
      src/main/java/com/steerinfo/dil/service/IAmsContractTruckPriceService.java
  16. 13 3
      src/main/java/com/steerinfo/dil/service/IAmsSaleOrderService.java
  17. 28 0
      src/main/java/com/steerinfo/dil/service/impl/AmsContractTruckPriceServiceImpl.java
  18. 334 19
      src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java
  19. 8 0
      src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java
  20. 1 1
      src/main/resources/application-prod.yml
  21. 3 3
      src/main/resources/bootstrap.yml
  22. 8 5
      src/main/resources/com/steerinfo/dil/mapper/AmsContaactPriceMaterialMapper.xml
  23. 39 1
      src/main/resources/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.xml
  24. 79 0
      src/main/resources/com/steerinfo/dil/mapper/AmsSaleMaterialMapper.xml
  25. 387 76
      src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml
  26. 344 0
      src/main/resources/com/steerinfo/dil/mapper/RmsLineNodePointMapper.xml
  27. 732 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml
  28. 660 0
      src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml
  29. 395 0
      src/main/resources/com/steerinfo/dil/mapper/WmspOutboundResultMaterialMapper.xml

+ 1 - 6
pom.xml

@@ -112,12 +112,7 @@
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
 <!--                        <param>AMS_SALE_ORDER</param>&lt;!&ndash;销售计划&ndash;&gt;-->
-                        <param>TMSTRAIN_PLEASE_APPROVE_RESULT</param><!--销售计划物资中间表-->
-<!--                        <param>AMSTRUCK_RAIL_DAYP·LAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
-<!--                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;-->
-<!--                        <param>RMS_RECEIVE_PLACE</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->
-<!--                        <param>AMS_SALE_TRUCKNO_MATERIAL</param>&lt;!&ndash;车序号物资中间表&ndash;&gt;-->
-<!--                            <param>AMS_CONTRACT_TRANSPORT_PRICE</param>-->
+                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>-->
                     </tables>
                 </configuration>
                 <executions>

+ 27 - 0
src/main/java/com/steerinfo/dil/controller/AmsContractTruckPriceController.java

@@ -296,10 +296,13 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
         String settleMentType = (String) mapvalue.get("requirementType");
         BigDecimal type = null;
         if("计重".equals(settleMentType)){
+            //在单价表里内转计重是2
             type = new BigDecimal(2);
         }else if("计时".equals(settleMentType)){
+            //在单价表里内转计时是5
             type = new BigDecimal(5);
         }else if("计次".equals(settleMentType)){
+            //在单价表里内转计时是6
             type = new BigDecimal(6);
         }
         mapvalue.put("type",type);
@@ -312,4 +315,28 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
         }
 
     }
+
+    @ApiOperation(value = "承运起止范围与装货点")
+    @PostMapping("/getRangePoint")
+    public RESTfulResult getRangePoint(@RequestBody(required = false)Map<String,Object>mapValue,
+                                       Integer apiId,
+                                       Integer pageNum,
+                                       Integer pageSize,
+                                       String con){
+        if (con != null && !con.equals("undefined")) {
+            mapValue.put("con","%" + con + "%");
+        }
+        //不分页筛选数据
+        PageHelper.startPage(pageNum,pageSize);
+        //分页数据
+        List<Map<String, Object>> rangePointList = amsContractTruckPriceService.getRangePoint(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,rangePointList);
+        return success(pageList);
+    }
+
+    @ApiOperation(value = "插入承运起止范围与装货点")
+    @PostMapping("/insertLineNodePoint")
+    public RESTfulResult insertLineNodePoint(@RequestBody(required = false)Map<String,Object>map){
+        return success(amsContractTruckPriceService.insertLineNodePoint(map));
+    }
 }

+ 149 - 28
src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java

@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
@@ -152,7 +153,7 @@ public class AmsSaleOrderController extends BaseRESTfulController {
             @ApiImplicitParam(name = "saleOrderId", value = "销售订单ID", required = false, dataType = "java.math.BigDecimal")
     })
     @PostMapping(value = "/uploadSaleOrder")
-    public RESTfulResult uploadSaleOrder(@RequestParam BigDecimal saleOrderId){
+    public RESTfulResult uploadSaleOrder(@RequestParam BigDecimal saleOrderId) throws Exception {
         int i = amsSaleOrderService.uploadSaleOrder(saleOrderId);
         return success(i);
     }
@@ -690,9 +691,15 @@ public class AmsSaleOrderController extends BaseRESTfulController {
 
     @ApiModelProperty(value = "新增钢材销售订单")
     @PostMapping("/addSteelSaleOrder")
-    public RESTfulResult addSteelSaleOrder(@RequestBody Map<String,Object> mapValue) {
-        int result = amsSaleOrderService.addSteelSaleOrder(mapValue);
-        return success(result);
+    public RESTfulResult addSteelSaleOrder(@RequestBody Map<String,Object> mapValue){
+        try {
+            // 成功
+            int result = amsSaleOrderService.addSteelSaleOrder(mapValue);
+            return success(result);
+        } catch (Exception e) {
+            // 失败
+            return failed(e.getMessage());
+        }
     }
 
     @ApiModelProperty(value = "展示销售订单下的车序号和物资")
@@ -705,7 +712,12 @@ public class AmsSaleOrderController extends BaseRESTfulController {
     @ApiModelProperty(value = "钢材派单")
     @PostMapping("/dispatchSteelOrder")
     public RESTfulResult dispatchSteelOrder(@RequestBody List<Map<String,Object>> mapList) throws Exception {
-        int result = amsSaleOrderService.dispatchSteelOrder(mapList);
+        int result;
+        try {
+            result = amsSaleOrderService.dispatchSteelOrder(mapList);
+        } catch (Exception e) {
+            return failed(e.getMessage());
+        }
         if (result == 0) {
             return failed("匹配不到车牌号!");
         }
@@ -760,23 +772,26 @@ public class AmsSaleOrderController extends BaseRESTfulController {
             @ApiImplicitParam(name = "apiId", value = "409", required = false, dataType = "BigDecimal")
     })
     @PostMapping("/getSaleOrderListToCarrier")
-    public RESTfulResult getSaleOrderListToCarrier(@RequestBody(required = false) Map<String,Object> mapValue,
-                                                         Integer pageNum,
-                                                         Integer pageSize,
-                                                         Integer apiId,
-                                                         String carrierSsoId,
-                                                         String con) {
-        if (con != null  && !"".equals(con) && !"null".equals(con)) {
-            mapValue.put("con","%" + con + "%");
+    public RESTfulResult getSaleOrderListToCarrier(@RequestBody(required = false) Map<String, Object> mapValue,
+                                                   Integer pageNum,
+                                                   Integer pageSize,
+                                                   Integer apiId,
+                                                   String carrierSsoId,
+                                                   String con,
+                                                   @RequestParam(required = false) String startTime,
+                                                   @RequestParam(required = false) String endTime) {
+        if (con != null && !"".equals(con) && !"null".equals(con)) {
+            mapValue.put("con", "%" + con + "%");
         }
         if ((carrierSsoId != null && !"".equals(carrierSsoId)) && !"undefined".equals(carrierSsoId) && !"null".equals(carrierSsoId)) {
-            mapValue.put("carrierSsoId",carrierSsoId);
+            mapValue.put("carrierSsoId", carrierSsoId);
         }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         //不分页筛选数据
-        PageHelper.startPage(pageNum,pageSize);
+        PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> saleOrderList = amsSaleOrderService.getSaleOrderListToCarrier(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,saleOrderList);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null, saleOrderList);
         return success(pageList);
     }
 
@@ -796,10 +811,13 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                              Integer apiId,
                                              Integer pageNum,
                                              Integer pageSize,
-                                             String con) {
+                                             String con,
+                                             @RequestParam(required = false) String startTime,
+                                             @RequestParam(required = false)String endTime) {
         if (con != null && !con.equals("undefined") && !con.equals("null")) {
             mapValue.put("con", "%" + con + "%");
         }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> saleOrderList = amsSaleOrderService.getSteelTruckNoList(mapValue);
@@ -830,10 +848,13 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                              Integer apiId,
                                              Integer pageNum,
                                              Integer pageSize,
-                                             String con) {
+                                             String con,
+                                             @RequestParam(required = false) String startTime,
+                                             @RequestParam(required = false)String endTime) {
         if (con != null && !con.equals("undefined") && !con.equals("null")) {
             mapValue.put("con", "%" + con + "%");
         }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue,sdfDateTime);//根据时间段查询数据
         PageHelper.startPage(pageNum, pageSize);
         //分页数据
         List<Map<String, Object>> saleOrderList = amsSaleOrderService.getNoCarTruckNoList(mapValue);
@@ -907,7 +928,7 @@ public class AmsSaleOrderController extends BaseRESTfulController {
         return success(i);
     }
 
-    @ApiModelProperty(value = "新增钒渣销售订单")
+    @ApiModelProperty(value = "新增钒渣销售订单(未被使用,实际是走水渣的路线)")
     @PostMapping("/addVanadiumSaleOrder")
     public RESTfulResult addVanadiumSaleOrder(@RequestBody Map<String,Object> mapValue) {
         int result = amsSaleOrderService.addVanadiumSaleOrder(mapValue);
@@ -970,27 +991,31 @@ public class AmsSaleOrderController extends BaseRESTfulController {
             @ApiImplicitParam(name = "map", value = "修改收货地址", required = false, dataType = "java.util.Map")
     })
     @PostMapping(value = "/updateCarAddress")
-    public RESTfulResult updateCarAddress(@RequestBody Map<String, Object> mapValue) {
+    @Transactional
+    public RESTfulResult updateCarAddress(@RequestBody Map<String, Object> mapValue) throws Exception {
         int result = amsSaleOrderService.updateCarAddress(mapValue);
-        // 如果返回结果为0,则认定是关闭了车辆
         if (result == 0) {
+            // 如果返回结果为0,则认定是关闭了车辆
             BigDecimal saleOrderMaterialId = DataChange.dataToBigDecimal(mapValue.get("saleOrderMaterialId"));
-            List<Map<String,Object>> saleMaterialIdList = amsSaleOrderService.getSaleMaterialId(saleOrderMaterialId);
+            List<Map<String, Object>> saleMaterialIdList = amsSaleOrderService.getSaleMaterialId(saleOrderMaterialId);
             String wholeOrder = "0";
             String status = "close";
             String reason = "收货地址修改超过片区范围";
             // 循环调用关闭金蝶分录接口
             for (Map<String, Object> head : saleMaterialIdList) {
-                head.put("wholeOrder",wholeOrder);
-                head.put("status",status);
-                head.put("reason",reason);
-                Map<String,Object> input = new HashMap<>();
-                input.put("head",head);
+                head.put("wholeOrder", wholeOrder);
+                head.put("status", status);
+                head.put("reason", reason);
+                Map<String, Object> input = new HashMap<>();
+                input.put("head", head);
                 Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
-                totalMap.put("input",input);
+                totalMap.put("input", input);
                 String json = JSONUtils.toJSONString(totalMap);
+                System.out.println("--------------------------------------------");
                 System.out.println(json);
+                System.out.println("--------------------------------------------");
                 Map<String, Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
+                System.out.println("--------------------------------------------");
                 System.out.println(resultMap);
             }
         }
@@ -1164,8 +1189,104 @@ public class AmsSaleOrderController extends BaseRESTfulController {
             String json = JSONUtils.toJSONString(totalMap);
             System.out.println(json);
             Map<String, Object> s = joinFeign.pushCarNumberToEas(totalMap);
+            System.out.println("-------------------------------------");
             System.out.println(s);
+            System.out.println("-------------------------------------");
             return success(result);
         }
     }
+
+    @ApiModelProperty(value = "展示下发给承运商的车序号和物资")
+    @PostMapping("/getCarrierTruckNoAndMaterialList")
+    public RESTfulResult getCarrierTruckNoAndMaterialList(@RequestBody Map<String,Object> map) {
+        List<Map<String,Object>> mapList = amsSaleOrderService.getCarrierTruckNoAndMaterialList(map);
+        return success(mapList);
+    }
+
+    @ApiModelProperty(value = "关闭单个钢材物资分录")
+    @PostMapping("/closeSteelMaterialId")
+    public RESTfulResult closeSteelMaterialId(@RequestBody Map<String, Object> mapValue) {
+        int result = amsSaleOrderService.closeSteelMaterialId(mapValue);
+        if (result == 0) {
+            return failed("该物资已装货,无法关闭物资分录!!");
+        }
+        String reason = (String) mapValue.get("reason");
+        String number = (String) mapValue.get("number");
+        String closeEntryId = (String) mapValue.get("closeEntryId");
+        BigDecimal closeWlEntryId = DataChange.dataToBigDecimal(mapValue.get("saleMaterialId"));
+        String wholeOrder = "0";
+        String status = "close";
+        Map<String,Object> head = new HashMap<>();
+        // 销售订单号
+        head.put("number",number);
+        // 关闭原因
+        head.put("reason",reason);
+        // 金蝶分录
+        head.put("closeEntryId",closeEntryId);
+        // 是否整单:(0:分录,1:整单)
+        head.put("wholeOrder",wholeOrder);
+        // 物流销售订单分录主键
+        head.put("closeWlEntryId",closeWlEntryId);
+        // 状态:close为关闭
+        head.put("status",status);
+        Map<String,Object> input = new HashMap<>();
+        Map<String, Object> totalMap = easUtil.getTotalMap();
+        input.put("head",head);
+        totalMap.put("input",input);
+        // 调用金蝶关闭接口
+        String json = JSONUtils.toJSONString(totalMap);
+        System.out.println(json);
+        Map<String,Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
+        System.out.println(resultMap);
+        return success(result);
+    }
+
+    @ApiModelProperty(value = "展示已审核化产焦炭销售订单列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "409/475", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getSaleCokeOrder")
+    public RESTfulResult getSaleCokeOrder(@RequestBody(required = false) Map<String, Object> mapValue,
+                                             Integer pageNum,
+                                             Integer pageSize,
+                                             Integer apiId,
+                                             String con,
+                                             String consigneeSsoId,
+                                             Integer shipperId,
+                                             @RequestParam(required = false) String startTime,
+                                             @RequestParam(required = false) String endTime
+    ) {
+        if (con != null && !"".equals(con) && !"null".equals(con)) {
+            mapValue.put("con", con);
+        }
+        if (consigneeSsoId != null && !"".equals(consigneeSsoId) && !"null".equals(consigneeSsoId)) {
+            mapValue.put("consigneeSsoId",consigneeSsoId);
+        }
+        if (shipperId != null && !"".equals(shipperId) && !"null".equals(shipperId)) {
+            mapValue.put("shipperId", shipperId);
+        }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        //不分页筛选数据
+        PageHelper.startPage(pageNum, pageSize);
+        //分页数据
+        List<Map<String, Object>> saleOrderList = amsSaleOrderService.getSaleCokeOrder(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData4(apiId, null, saleOrderList);
+        return success(pageList);
+    }
+
+    @ApiModelProperty(value = "反关闭金蝶单个分录")
+    @PostMapping("/adverseCloseSaleMaterial")
+    public RESTfulResult adverseCloseSaleMaterial(@RequestParam Integer saleMaterialId) {
+        int result = amsSaleOrderService.adverseCloseSaleMaterial(new BigDecimal(saleMaterialId));
+        return success(result);
+    }
+
+    @ApiModelProperty(value = "反关闭金蝶整个销售订单")
+    @PostMapping("/adverseCloseSaleOrder")
+    public RESTfulResult adverseCloseSaleOrder(@RequestParam Integer saleOrderId) {
+        int result = amsSaleOrderService.adverseCloseSaleOrder(new BigDecimal(saleOrderId));
+        return success(result);
+    }
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.java

@@ -59,5 +59,6 @@ public interface AmsContractTruckPriceMapper extends IBaseMapper<AmsContractTran
 
     List<Map<String, Object>> selectInwardPrice(Map<String, Object> mapvalue);
 
+    List<Map<String, Object>> getRangePoint(Map<String, Object> mapValue);
 
 }

+ 19 - 0
src/main/java/com/steerinfo/dil/mapper/AmsSaleMaterialMapper.java

@@ -3,6 +3,9 @@ package com.steerinfo.dil.mapper;
 import com.steerinfo.dil.model.AmsSaleMaterial;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import java.math.*;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
@@ -12,4 +15,20 @@ public interface AmsSaleMaterialMapper extends IBaseMapper<AmsSaleMaterial, BigD
     BigDecimal selectMaxId();
     // 得到物资出现次数
     Integer getMaterialCount(BigDecimal materialId);
+    // 根据路段顺序号逆序找到装货实际
+    List<Map<String, Object>> findLoadIdList(BigDecimal saleOrderMaterialId);
+    // 根据路段顺序号逆序找到计量实际
+    List<Map<String, Object>> findWeightIdList(BigDecimal saleOrderMaterialId);
+    //
+    int deleteLoadResult(BigDecimal loadId);
+    //
+    int deleteWeightResult(BigDecimal weightId);
+
+    int updateOrderMaterialToClose(Map<String, Object> mapValue);
+
+    int deleteWmspOutResult(Map<String, Object> mapValue);
+    // 开启所有的分录
+    int openAllSaleMaterial(BigDecimal saleOrderId);
+    // 反关闭分录
+    int adverseCloseSaleMaterial(BigDecimal saleMaterialId);
 }

+ 22 - 1
src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMapper.java

@@ -78,7 +78,7 @@ public interface AmsSaleOrderMapper extends IBaseMapper<AmsSaleOrder, BigDecimal
     // 得到销售订单已分配的车数
     BigDecimal getCarNum(BigDecimal saleOrderId);
     // 查询销售订单下的车序号和物资
-    List<Map<String, Object>> getTruckNoAndMaterial(BigDecimal saleOrderId);
+    List<Map<String, Object>> getTruckNoAndMaterial(Map<String,Object> map);
     // 根据详细地址匹配省市县
     BigDecimal getAddressByPlace(BigDecimal placeId);
     // 根据省市县匹配承运商
@@ -134,4 +134,25 @@ public interface AmsSaleOrderMapper extends IBaseMapper<AmsSaleOrder, BigDecimal
     int updateCapacityNumberInFactory(Map<String, Object> mapValue);
     // 根据省市县id匹配承运商
     List<Map<String, Object>> getCarrierByAddress(BigDecimal addressId);
+
+    List<Map<String, Object>> getSaleCokeOrder(Map<String, Object> mapValue);
+    Integer findStatus(BigDecimal saleOrderMaterialId);
+
+    BigDecimal getPlaceId(BigDecimal saleOrderMaterialId);
+
+    List<Map<String, Object>> getAddressPriceList(Map<String, Object> hashMap);
+
+    String findSelfMention(BigDecimal saleOrderMaterialId);
+
+    BigDecimal findReceiveId(Object receiveName);
+
+    BigDecimal findSalerId(Object salerName);
+
+    BigDecimal findMaterialId(Map<String, Object> materialMap);
+
+    BigDecimal findAddressId(Map<String, Object> addressMap);
+
+    Map<String, Object> getSaleMaterialMessage(BigDecimal saleMaterialId);
+
+    int findOrderMaxNum(BigDecimal resultTotalId);
 }

+ 16 - 0
src/main/java/com/steerinfo/dil/mapper/RmsLineNodePointMapper.java

@@ -0,0 +1,16 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsLineNodePoint;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+
+
+@Mapper
+public interface RmsLineNodePointMapper extends IBaseMapper<RmsLineNodePoint, BigDecimal> {
+
+    @Select("select seq__rms_line_node_point.nextval from dual")
+    BigDecimal lineMaxId();
+}

+ 23 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.java

@@ -0,0 +1,23 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstruckLoadResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface TmstruckLoadResultMapper extends IBaseMapper<TmstruckLoadResult, BigDecimal> {
+
+
+    //查询最大ID值
+    @Select("select seq_tmstruck_load_result.nextval from dual")
+    BigDecimal selectMaxId();
+
+
+}

+ 23 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.java

@@ -0,0 +1,23 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstruckWeightResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface TmstruckWeightResultMapper extends IBaseMapper<TmstruckWeightResult, Short> {
+    //查询最大主键Id
+    @Select("select seq_tmstruck_weight_result.nextval from dual")
+    BigDecimal selectMaxId();
+
+
+    @Select("select seq__WMSP_OUTBOUND_RESUL_TMATRIAL.nextval from dual")
+    BigDecimal getOutBoundMaterialMaxId();
+
+}

+ 19 - 0
src/main/java/com/steerinfo/dil/mapper/WmspOutboundResultMaterialMapper.java

@@ -0,0 +1,19 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.WmspOutboundResultMaterial;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface WmspOutboundResultMaterialMapper extends IBaseMapper<WmspOutboundResultMaterial, BigDecimal> {
+
+    @Select("select ${seqName}.nextval from dual")
+    BigDecimal getSeqNumber(@Param("seqName") String seqName);
+}

+ 184 - 0
src/main/java/com/steerinfo/dil/model/RmsLineNodePoint.java

@@ -0,0 +1,184 @@
+package com.steerinfo.dil.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 RmsLineNodePoint implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(LINE_NODE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal lineNodeId;
+
+    /**
+     * 承运起止范围ID(TRANS_RANGE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="承运起止范围ID",required=false)
+    private BigDecimal transRangeId;
+
+    /**
+     * 装货点名称(LOAD_POINT_NAME,VARCHAR,30)
+     */
+    @ApiModelProperty(value="装货点名称",required=false)
+    private String loadPointName;
+
+    /**
+     * 卸货点名称(UNLOAD_POINT_NAME,VARCHAR,30)
+     */
+    @ApiModelProperty(value="卸货点名称",required=false)
+    private String unloadPointName;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 是否删除 0未删除,已已删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除 0未删除,已已删除",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.lineNodeId;
+    }
+
+    @Override
+    public void setId(BigDecimal lineNodeId) {
+        this.lineNodeId = lineNodeId;
+    }
+
+    public BigDecimal getLineNodeId() {
+        return lineNodeId;
+    }
+
+    public void setLineNodeId(BigDecimal lineNodeId) {
+        this.lineNodeId = lineNodeId;
+    }
+
+    public BigDecimal getTransRangeId() {
+        return transRangeId;
+    }
+
+    public void setTransRangeId(BigDecimal transRangeId) {
+        this.transRangeId = transRangeId;
+    }
+
+    public String getLoadPointName() {
+        return loadPointName;
+    }
+
+    public void setLoadPointName(String loadPointName) {
+        this.loadPointName = loadPointName == null ? null : loadPointName.trim();
+    }
+
+    public String getUnloadPointName() {
+        return unloadPointName;
+    }
+
+    public void setUnloadPointName(String unloadPointName) {
+        this.unloadPointName = unloadPointName == null ? null : unloadPointName.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();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", lineNodeId=").append(lineNodeId);
+        sb.append(", transRangeId=").append(transRangeId);
+        sb.append(", loadPointName=").append(loadPointName);
+        sb.append(", unloadPointName=").append(unloadPointName);
+        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(", deleted=").append(deleted);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 400 - 0
src/main/java/com/steerinfo/dil/model/TmstruckLoadResult.java

@@ -0,0 +1,400 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="汽运装货实绩")
+@Component
+public class TmstruckLoadResult implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 实绩总表ID(RESULT_TOTAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="实绩总表ID",required=false)
+    private BigDecimal resultTotalId;
+
+    /**
+     * 装货开始时间(RESULT_LOAD_START_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="装货开始时间",required=false)
+    private Date resultLoadStartTime;
+
+    /**
+     * 装货结束时间(RESULT_LOAD_END_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="装货结束时间",required=false)
+    private Date resultLoadEndTime;
+
+    /**
+     * 装货实绩时长(RESULT_LOAD_DURATION,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装货实绩时长",required=false)
+    private BigDecimal resultLoadDuration;
+
+    /**
+     * 装货标准时长id(LOAD_STANDARD_TIME_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装货标准时长id",required=false)
+    private BigDecimal loadStandardTimeId;
+
+    /**
+     * 装卸工ID(LOADER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装卸工ID",required=false)
+    private BigDecimal loaderId;
+
+    /**
+     * 是否清场(否:未清场;是:清场)(RESULT_ISCLEAR,VARCHAR,10)
+     */
+    @ApiModelProperty(value="是否清场(否:未清场;是:清场)",required=false)
+    private String resultIsclear;
+
+    /**
+     * 废除人(DELETE_NAME,VARCHAR,16)
+     */
+    @ApiModelProperty(value="废除人",required=false)
+    private String deleteName;
+
+    /**
+     * 废除时间(DELETE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="废除时间",required=false)
+    private Date deleteTime;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 状态:0 :正常 1:逻辑删除 (STATUS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="状态:0 :正常 1:逻辑删除 ",required=false)
+    private BigDecimal status;
+
+    /**
+     * 计量吨位  装车时的计量吨位(RESULT_MEASURED_TONNAGE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计量吨位  装车时的计量吨位",required=false)
+    private BigDecimal resultMeasuredTonnage;
+
+    /**
+     * 装货点ID(LOADING_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装货点ID",required=false)
+    private BigDecimal loadingId;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 装车顺序(LOADING_SEQUENCE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装车顺序",required=false)
+    private BigDecimal loadingSequence;
+
+    /**
+     * 是否需要质检(0 :不需要   1:需要)(ISDEDUCT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否需要质检(0 :不需要   1:需要)",required=false)
+    private BigDecimal isdeduct;
+
+    /**
+     * 路段顺序号(SEGMENT_SQE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="路段顺序号",required=false)
+    private BigDecimal segmentSqe;
+
+    /**
+     * 集装箱箱号(CASE_NUMBER,VARCHAR,255)
+     */
+    @ApiModelProperty(value="集装箱箱号",required=false)
+    private String caseNumber;
+
+    @ApiModelProperty(value="集装箱箱号2",required=false)
+    private String caseNumbertwo;
+
+    @ApiModelProperty(value="车型备注",required=false)
+    private String capacityRemark;
+
+    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 getResultTotalId() {
+        return resultTotalId;
+    }
+
+    public void setResultTotalId(BigDecimal resultTotalId) {
+        this.resultTotalId = resultTotalId;
+    }
+
+    public String getCaseNumbertwo() {
+        return caseNumbertwo;
+    }
+
+    public void setCaseNumbertwo(String caseNumbertwo) {
+        this.caseNumbertwo = caseNumbertwo;
+    }
+
+    public Date getResultLoadStartTime() {
+        return resultLoadStartTime;
+    }
+
+    public void setResultLoadStartTime(Date resultLoadStartTime) {
+        this.resultLoadStartTime = resultLoadStartTime;
+    }
+
+    public Date getResultLoadEndTime() {
+        return resultLoadEndTime;
+    }
+
+    public void setResultLoadEndTime(Date resultLoadEndTime) {
+        this.resultLoadEndTime = resultLoadEndTime;
+    }
+
+    public BigDecimal getResultLoadDuration() {
+        return resultLoadDuration;
+    }
+
+    public void setResultLoadDuration(BigDecimal resultLoadDuration) {
+        this.resultLoadDuration = resultLoadDuration;
+    }
+
+    public BigDecimal getLoadStandardTimeId() {
+        return loadStandardTimeId;
+    }
+
+    public void setLoadStandardTimeId(BigDecimal loadStandardTimeId) {
+        this.loadStandardTimeId = loadStandardTimeId;
+    }
+
+    public BigDecimal getLoaderId() {
+        return loaderId;
+    }
+
+    public void setLoaderId(BigDecimal loaderId) {
+        this.loaderId = loaderId;
+    }
+
+    public String getResultIsclear() {
+        return resultIsclear;
+    }
+
+    public void setResultIsclear(String resultIsclear) {
+        this.resultIsclear = resultIsclear == null ? null : resultIsclear.trim();
+    }
+
+    public String getDeleteName() {
+        return deleteName;
+    }
+
+    public void setDeleteName(String deleteName) {
+        this.deleteName = deleteName == null ? null : deleteName.trim();
+    }
+
+    public Date getDeleteTime() {
+        return deleteTime;
+    }
+
+    public void setDeleteTime(Date deleteTime) {
+        this.deleteTime = deleteTime;
+    }
+
+    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();
+    }
+
+    public BigDecimal getStatus() {
+        return status;
+    }
+
+    public void setStatus(BigDecimal status) {
+        this.status = status;
+    }
+
+    public BigDecimal getResultMeasuredTonnage() {
+        return resultMeasuredTonnage;
+    }
+
+    public void setResultMeasuredTonnage(BigDecimal resultMeasuredTonnage) {
+        this.resultMeasuredTonnage = resultMeasuredTonnage;
+    }
+
+    public BigDecimal getLoadingId() {
+        return loadingId;
+    }
+
+    public void setLoadingId(BigDecimal loadingId) {
+        this.loadingId = loadingId;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getLoadingSequence() {
+        return loadingSequence;
+    }
+
+    public void setLoadingSequence(BigDecimal loadingSequence) {
+        this.loadingSequence = loadingSequence;
+    }
+
+    public BigDecimal getIsdeduct() {
+        return isdeduct;
+    }
+
+    public void setIsdeduct(BigDecimal isdeduct) {
+        this.isdeduct = isdeduct;
+    }
+
+    public BigDecimal getSegmentSqe() {
+        return segmentSqe;
+    }
+
+    public void setSegmentSqe(BigDecimal segmentSqe) {
+        this.segmentSqe = segmentSqe;
+    }
+
+    public String getCaseNumber() {
+        return caseNumber;
+    }
+
+    public void setCaseNumber(String caseNumber) {
+        this.caseNumber = caseNumber == null ? null : caseNumber.trim();
+    }
+
+    public String getCapacityRemark() {
+        return capacityRemark;
+    }
+
+    public void setCapacityRemark(String capacityRemark) {
+        this.capacityRemark = capacityRemark;
+    }
+
+    @Override
+    public String toString() {
+        return "TmstruckLoadResult{" +
+                "resultId=" + resultId +
+                ", resultTotalId=" + resultTotalId +
+                ", resultLoadStartTime=" + resultLoadStartTime +
+                ", resultLoadEndTime=" + resultLoadEndTime +
+                ", resultLoadDuration=" + resultLoadDuration +
+                ", loadStandardTimeId=" + loadStandardTimeId +
+                ", loaderId=" + loaderId +
+                ", resultIsclear='" + resultIsclear + '\'' +
+                ", deleteName='" + deleteName + '\'' +
+                ", deleteTime=" + deleteTime +
+                ", insertUsername='" + insertUsername + '\'' +
+                ", insertTime=" + insertTime +
+                ", updateUsername='" + updateUsername + '\'' +
+                ", updateTime=" + updateTime +
+                ", insertUpdateRemark='" + insertUpdateRemark + '\'' +
+                ", status=" + status +
+                ", resultMeasuredTonnage=" + resultMeasuredTonnage +
+                ", loadingId=" + loadingId +
+                ", materialId=" + materialId +
+                ", loadingSequence=" + loadingSequence +
+                ", isdeduct=" + isdeduct +
+                ", segmentSqe=" + segmentSqe +
+                ", caseNumber='" + caseNumber + '\'' +
+                ", caseNumbertwo='" + caseNumbertwo + '\'' +
+                ", capacityRemark='" + capacityRemark + '\'' +
+                '}';
+    }
+}

+ 366 - 0
src/main/java/com/steerinfo/dil/model/TmstruckWeightResult.java

@@ -0,0 +1,366 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="计重作业实绩表")
+@Component
+public class TmstruckWeightResult implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(WEIGHT_TASK_RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal weightTaskResultId;
+
+    /**
+     * 总实绩ID(RESULT_TOTAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="总实绩ID",required=false)
+    private BigDecimal resultTotalId;
+
+    /**
+     * 磅单号(RESULT_POUND_NO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="磅单号",required=false)
+    private String resultPoundNo;
+
+    /**
+     * 毛重(RESULT_GROSS_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="毛重",required=false)
+    private BigDecimal resultGrossWeight;
+
+    /**
+     * 毛重时间(RESULT_GROSS_WEIGHT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="毛重时间",required=false)
+    private Date resultGrossWeightTime;
+
+    /**
+     * 皮重(RESULT_TARE_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="皮重",required=false)
+    private BigDecimal resultTareWeight;
+
+    /**
+     * 皮重时间(RESULT_TARE_WEIGHT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="皮重时间",required=false)
+    private Date resultTareWeightTime;
+
+    /**
+     * 净重(RESULT_NET_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="净重",required=false)
+    private BigDecimal resultNetWeight;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 废除人(DELETE_NAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="废除人",required=false)
+    private String deleteName;
+
+    /**
+     * 废除时间(DELETE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="废除时间",required=false)
+    private Date deleteTime;
+
+    /**
+     * 计毛点ID(汽车衡)(RESULT_GROSS_PLACE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计毛点ID(汽车衡)",required=false)
+    private BigDecimal resultGrossPlaceId;
+
+    /**
+     * 计皮点ID(汽车衡)(RESULT_TARE_PLACE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="计皮点ID(汽车衡)",required=false)
+    private BigDecimal resultTarePlaceId;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 是否需要扣水扣杂(0:否,1:是)(ISDEDUCT,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否需要扣水扣杂(0:否,1:是)",required=false)
+    private BigDecimal isdeduct;
+
+    /**
+     * 是否完成扣水扣杂(0:否,1:是)(ISQUALITY,DECIMAL,38)
+     */
+    @ApiModelProperty(value="是否完成扣水扣杂(0:否,1:是)",required=false)
+    private BigDecimal isquality;
+
+    /**
+     * 毛重路段顺序号(GROSS_SEGMENT_SQE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="毛重路段顺序号",required=false)
+    private BigDecimal grossSegmentSqe;
+
+    /**
+     * 皮重路段顺序号(TARE_SEGMENT_SQE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="皮重路段顺序号",required=false)
+    private BigDecimal tareSegmentSqe;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.weightTaskResultId;
+    }
+
+    @Override
+    public void setId(BigDecimal weightTaskResultId) {
+        this.weightTaskResultId = weightTaskResultId;
+    }
+
+    public BigDecimal getWeightTaskResultId() {
+        return weightTaskResultId;
+    }
+
+    public void setWeightTaskResultId(BigDecimal weightTaskResultId) {
+        this.weightTaskResultId = weightTaskResultId;
+    }
+
+    public BigDecimal getResultTotalId() {
+        return resultTotalId;
+    }
+
+    public void setResultTotalId(BigDecimal resultTotalId) {
+        this.resultTotalId = resultTotalId;
+    }
+
+    public String getResultPoundNo() {
+        return resultPoundNo;
+    }
+
+    public void setResultPoundNo(String resultPoundNo) {
+        this.resultPoundNo = resultPoundNo == null ? null : resultPoundNo.trim();
+    }
+
+    public BigDecimal getResultGrossWeight() {
+        return resultGrossWeight;
+    }
+
+    public void setResultGrossWeight(BigDecimal resultGrossWeight) {
+        this.resultGrossWeight = resultGrossWeight;
+    }
+
+    public Date getResultGrossWeightTime() {
+        return resultGrossWeightTime;
+    }
+
+    public void setResultGrossWeightTime(Date resultGrossWeightTime) {
+        this.resultGrossWeightTime = resultGrossWeightTime;
+    }
+
+    public BigDecimal getResultTareWeight() {
+        return resultTareWeight;
+    }
+
+    public void setResultTareWeight(BigDecimal resultTareWeight) {
+        this.resultTareWeight = resultTareWeight;
+    }
+
+    public Date getResultTareWeightTime() {
+        return resultTareWeightTime;
+    }
+
+    public void setResultTareWeightTime(Date resultTareWeightTime) {
+        this.resultTareWeightTime = resultTareWeightTime;
+    }
+
+    public BigDecimal getResultNetWeight() {
+        return resultNetWeight;
+    }
+
+    public void setResultNetWeight(BigDecimal resultNetWeight) {
+        this.resultNetWeight = resultNetWeight;
+    }
+
+    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();
+    }
+
+    public String getDeleteName() {
+        return deleteName;
+    }
+
+    public void setDeleteName(String deleteName) {
+        this.deleteName = deleteName == null ? null : deleteName.trim();
+    }
+
+    public Date getDeleteTime() {
+        return deleteTime;
+    }
+
+    public void setDeleteTime(Date deleteTime) {
+        this.deleteTime = deleteTime;
+    }
+
+    public BigDecimal getResultGrossPlaceId() {
+        return resultGrossPlaceId;
+    }
+
+    public void setResultGrossPlaceId(BigDecimal resultGrossPlaceId) {
+        this.resultGrossPlaceId = resultGrossPlaceId;
+    }
+
+    public BigDecimal getResultTarePlaceId() {
+        return resultTarePlaceId;
+    }
+
+    public void setResultTarePlaceId(BigDecimal resultTarePlaceId) {
+        this.resultTarePlaceId = resultTarePlaceId;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getIsdeduct() {
+        return isdeduct;
+    }
+
+    public void setIsdeduct(BigDecimal isdeduct) {
+        this.isdeduct = isdeduct;
+    }
+
+    public BigDecimal getIsquality() {
+        return isquality;
+    }
+
+    public void setIsquality(BigDecimal isquality) {
+        this.isquality = isquality;
+    }
+
+    public BigDecimal getGrossSegmentSqe() {
+        return grossSegmentSqe;
+    }
+
+    public void setGrossSegmentSqe(BigDecimal grossSegmentSqe) {
+        this.grossSegmentSqe = grossSegmentSqe;
+    }
+
+    public BigDecimal getTareSegmentSqe() {
+        return tareSegmentSqe;
+    }
+
+    public void setTareSegmentSqe(BigDecimal tareSegmentSqe) {
+        this.tareSegmentSqe = tareSegmentSqe;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", weightTaskResultId=").append(weightTaskResultId);
+        sb.append(", resultTotalId=").append(resultTotalId);
+        sb.append(", resultPoundNo=").append(resultPoundNo);
+        sb.append(", resultGrossWeight=").append(resultGrossWeight);
+        sb.append(", resultGrossWeightTime=").append(resultGrossWeightTime);
+        sb.append(", resultTareWeight=").append(resultTareWeight);
+        sb.append(", resultTareWeightTime=").append(resultTareWeightTime);
+        sb.append(", resultNetWeight=").append(resultNetWeight);
+        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(", deleteName=").append(deleteName);
+        sb.append(", deleteTime=").append(deleteTime);
+        sb.append(", resultGrossPlaceId=").append(resultGrossPlaceId);
+        sb.append(", resultTarePlaceId=").append(resultTarePlaceId);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", isdeduct=").append(isdeduct);
+        sb.append(", isquality=").append(isquality);
+        sb.append(", grossSegmentSqe=").append(grossSegmentSqe);
+        sb.append(", tareSegmentSqe=").append(tareSegmentSqe);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 211 - 0
src/main/java/com/steerinfo/dil/model/WmspOutboundResultMaterial.java

@@ -0,0 +1,211 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="出库实绩与物资中间表")
+@Component
+public class WmspOutboundResultMaterial implements IBasePO<BigDecimal> {
+    /**
+     * 实绩与物资ID中间表(RESULT_MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="实绩与物资ID中间表",required=true)
+    private BigDecimal resultMaterialId;
+
+    /**
+     * 出库实绩ID(OUTBOUND_RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="出库实绩ID",required=false)
+    private BigDecimal outboundResultId;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,200)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,200)
+     */
+    @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;
+
+    /**
+     * 逻辑删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 物资数量(MATERIAL_NUMBER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资数量",required=false)
+    private BigDecimal materialNumber;
+
+    /**
+     * 物资重量(MATERIAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资重量",required=false)
+    private BigDecimal materialWeight;
+
+    /**
+     * 出库状态(0:待出库,1:已出库)(STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="出库状态(0:待出库,1:已出库)",required=false)
+    private BigDecimal status;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultMaterialId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultMaterialId) {
+        this.resultMaterialId = resultMaterialId;
+    }
+
+    public BigDecimal getResultMaterialId() {
+        return resultMaterialId;
+    }
+
+    public BigDecimal getStatus() {
+        return status;
+    }
+
+    public void setStatus(BigDecimal status) {
+        this.status = status;
+    }
+
+    public void setResultMaterialId(BigDecimal resultMaterialId) {
+        this.resultMaterialId = resultMaterialId;
+    }
+
+    public BigDecimal getOutboundResultId() {
+        return outboundResultId;
+    }
+
+    public void setOutboundResultId(BigDecimal outboundResultId) {
+        this.outboundResultId = outboundResultId;
+    }
+
+    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();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getMaterialNumber() {
+        return materialNumber;
+    }
+
+    public void setMaterialNumber(BigDecimal materialNumber) {
+        this.materialNumber = materialNumber;
+    }
+
+    public BigDecimal getMaterialWeight() {
+        return materialWeight;
+    }
+
+    public void setMaterialWeight(BigDecimal materialWeight) {
+        this.materialWeight = materialWeight;
+    }
+
+    @Override
+    public String toString() {
+        return "WmspOutboundResultMaterial{" +
+                "resultMaterialId=" + resultMaterialId +
+                ", outboundResultId=" + outboundResultId +
+                ", insertUsername='" + insertUsername + '\'' +
+                ", insertTime=" + insertTime +
+                ", updateUsername='" + updateUsername + '\'' +
+                ", updateTime=" + updateTime +
+                ", insertUpdateRemark='" + insertUpdateRemark + '\'' +
+                ", deleted=" + deleted +
+                ", materialId=" + materialId +
+                ", materialNumber=" + materialNumber +
+                ", materialWeight=" + materialWeight +
+                ", status=" + status +
+                '}';
+    }
+}

+ 4 - 0
src/main/java/com/steerinfo/dil/service/IAmsContractTruckPriceService.java

@@ -56,4 +56,8 @@ public interface IAmsContractTruckPriceService {
 
     List<Map<String, Object>> selectInwardPrice(Map<String, Object> mapvalue);
 
+    List<Map<String, Object>> getRangePoint(Map<String, Object> mapValue);
+
+    int insertLineNodePoint(Map<String, Object> map);
+
 }

+ 13 - 3
src/main/java/com/steerinfo/dil/service/IAmsSaleOrderService.java

@@ -44,7 +44,7 @@ public interface IAmsSaleOrderService {
     int addAmsSaleOrder(Map<String, Object> map) throws ParseException;
 
     //修改销售订单状态为已上报
-    int uploadSaleOrder(BigDecimal saleOrderId);
+    int uploadSaleOrder(BigDecimal saleOrderId) throws Exception;
 
     //获取要渲染的数据
     List<Map<String, Object>> selectBySaleOrderId(BigDecimal saleOrderId);
@@ -99,13 +99,13 @@ public interface IAmsSaleOrderService {
     List<Map<String, Object>> getCokeSaleOrderList(Map<String,Object> mapValue);
 
     // 新增钢材销售订单
-    int addSteelSaleOrder(Map<String, Object> mapValue);
+    int addSteelSaleOrder(Map<String, Object> mapValue) throws Exception;
 
     // 展示销售订单下的车序号和物资
     List<Map<String, Object>> getTruckNoAndMaterialList(BigDecimal saleOrderId);
 
     // 钢材派发运输订单
-    int dispatchSteelOrder(List<Map<String, Object>> mapList);
+    int dispatchSteelOrder(List<Map<String, Object>> mapList) throws Exception;
 
     // 根据详细地址id匹配承运商
     List<Map<String,Object>> getCarrierByPlace(BigDecimal placeId);
@@ -159,4 +159,14 @@ public interface IAmsSaleOrderService {
     int updateCapacityNumberInFactory(Map<String, Object> mapValue);
     // 得到销售订单物资表主键
     List<Map<String, Object>> getSaleMaterialId(BigDecimal saleOrderMaterialId);
+    // 查询下发给承运商的车序号信息
+    List<Map<String, Object>> getCarrierTruckNoAndMaterialList(Map<String, Object> map);
+    // 关闭单个钢材物资分录
+    int closeSteelMaterialId(Map<String, Object> mapValue);
+    // 展示已审核化产焦炭销售订单列表
+    List<Map<String, Object>> getSaleCokeOrder(Map<String, Object> mapValue);
+    // 反关闭金蝶单个分录
+    int adverseCloseSaleMaterial(BigDecimal saleMaterialId);
+    // 反关闭整个销售订单
+    int adverseCloseSaleOrder(BigDecimal saleOrderId);
 }

+ 28 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsContractTruckPriceServiceImpl.java

@@ -2,9 +2,11 @@ package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.AmsContaactPriceMaterialMapper;
 import com.steerinfo.dil.mapper.AmsContractTruckPriceMapper;
+import com.steerinfo.dil.mapper.RmsLineNodePointMapper;
 import com.steerinfo.dil.mapper.RmsReceivePlaceMapper;
 import com.steerinfo.dil.model.AmsContaactPriceMaterial;
 import com.steerinfo.dil.model.AmsContractTransportPrice;
+import com.steerinfo.dil.model.RmsLineNodePoint;
 import com.steerinfo.dil.model.RmsReceivePlace;
 import com.steerinfo.dil.service.IAmsContractTruckPriceService;
 import com.steerinfo.dil.util.DataChange;
@@ -44,6 +46,12 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
     @Autowired
     AmsContaactPriceMaterialMapper amsContaactPriceMaterialMapper;
 
+    //@Autowired
+    //private RmsLineNodePoint rmsLineNodePoint;
+
+    @Autowired
+    private RmsLineNodePointMapper rmsLineNodePointMapper;
+
     /**
      * 新增汽运单价
      * @Author zzd
@@ -612,4 +620,24 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
     public List<Map<String, Object>> selectInwardPrice(Map<String, Object> mapvalue) {
             return amsContractTruckPriceMapper.selectInwardPrice(mapvalue);
     }
+
+    @Override
+    public List<Map<String, Object>> getRangePoint(Map<String, Object> mapValue) {
+        return amsContractTruckPriceMapper.getRangePoint(mapValue);
+    }
+
+    @Override
+    public int insertLineNodePoint(Map<String, Object> map) {
+        RmsLineNodePoint rmsLineNodePoint = new RmsLineNodePoint();
+        BigDecimal rangeId = DataChange.dataToBigDecimal(map.get("rangeId"));
+        String loadName = (String)map.get("loadPointName");
+        String unloadName = (String)map.get("unloadPointName");
+        rmsLineNodePoint.setId(rmsLineNodePointMapper.lineMaxId());
+        rmsLineNodePoint.setTransRangeId(rangeId);
+        rmsLineNodePoint.setLoadPointName(loadName);
+        rmsLineNodePoint.setUnloadPointName(unloadName);
+        rmsLineNodePoint.setDeleted(new BigDecimal(0));
+        int i = rmsLineNodePointMapper.insertSelective(rmsLineNodePoint);
+        return i;
+    }
 }

+ 334 - 19
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -40,6 +40,14 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     @Autowired
     private AmsSaleTrucknoMaterialMapper trucknoMaterialMapper;
     @Autowired
+    TmstruckLoadResult tmstruckLoadResult;
+    @Autowired
+    TmstruckWeightResult tmstruckWeightResult;
+    @Autowired
+    TmstruckWeightResultMapper tmstruckWeightResultMapper;
+    @Autowired
+    TmstruckLoadResultMapper tmstruckLoadResultMapper;
+    @Autowired
     AmsDispatchSaleOrderMapper amsDispatchSaleOrderMapper;
     @Autowired
     AmsSaleMaterialMapper amsSaleMaterialMapper;
@@ -70,6 +78,10 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     @Autowired
     TmstrainPleaseApproveResultMapper tmstrainPleaseApproveResultMapper;
 
+    @Autowired
+    WmspOutboundResultMaterialMapper wmspOutboundResultMaterialMapper;
+
+
     @Override
     public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
         return amsSaleOrderMapper.getSaleOrderInfo(map);
@@ -204,8 +216,9 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         return i;
     }
 
+    @Transactional(rollbackFor = Exception.class)
     @Override
-    public int uploadSaleOrder(BigDecimal saleOrderId) {
+    public int uploadSaleOrder(BigDecimal saleOrderId) throws Exception {
         AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
         // 调用金蝶接口,将销售订单推送到金蝶系统
         Map<String, Object> input = joinFeign.getSaleOrder(saleOrderId);
@@ -220,7 +233,12 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         System.out.println(totalMap);
         String json = JSONUtils.toJSONString(totalMap);
         System.out.println(json);
+        // 得到金蝶返回结果
         Map<String,Object> s = joinFeign.pushSaleOrderToEas(totalMap);
+        String status = (String) s.get("status");
+        if ("-1".equals(status)) {
+            throw new Exception(amsSaleOrder.getSaleNumber() + "上传金蝶失败!");
+        }
         System.out.println(s);
         amsSaleOrder.setSaleOrderStatus(new BigDecimal(1));
         return amsSaleOrderMapper.updateByPrimaryKey(amsSaleOrder);
@@ -369,7 +387,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         //删除所有从表信息
         //amsSaleOrderMapper.deleteBySaleOrderId(saleOrderId);
         AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
-        amsSaleOrder.setDeleted(new BigDecimal(1));
+        amsSaleOrder.setDeleted(new BigDecimal(2));
         return amsSaleOrderMapper.updateByPrimaryKey(amsSaleOrder);
     }
 
@@ -504,12 +522,19 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
      * @return
      */
     @Override
-    public int addSteelSaleOrder(Map<String, Object> mapValue) {
+    @Transactional(rollbackFor = Exception.class)
+    public int addSteelSaleOrder(Map<String, Object> mapValue) throws Exception {
         List<Map<String,Object>> mapList = (List<Map<String, Object>>) mapValue.get("mapList");
         // 得到发货单位
         BigDecimal shipperId = DataChange.dataToBigDecimal(mapValue.get("shipperId"));
         // 收货单位
         BigDecimal receiveId = DataChange.dataToBigDecimal(mapValue.get("receiveId"));
+        if (receiveId == null || receiveId.intValue() == 0) {
+            receiveId = amsSaleOrderMapper.findReceiveId(mapValue.get("receiveName"));
+            if (receiveId == null) {
+                throw new Exception("您输入的下单客户:" + mapValue.get("receiveName") + "不存在!!");
+            }
+        }
         // 是否自提
         String isSelfMention = (String) mapValue.get("isSelfMention");
         // 备注
@@ -518,6 +543,12 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         String saleOrderReceiveCustomer = (String) mapValue.get("saleOrderReceiveCustomer");
         // 业务员
         BigDecimal salerId = DataChange.dataToBigDecimal(mapValue.get("salerId"));
+        if (salerId == null || salerId.intValue() == 0) {
+            salerId = amsSaleOrderMapper.findSalerId(mapValue.get("salerName"));
+            if (salerId == null) {
+                throw new Exception("您输入的业务员:" + mapValue.get("salerName") +"不存在!!");
+            }
+        }
         BigDecimal saleOrderId = amsSaleOrderMapper.selectMaxId();
         int result = 0;
         // 销售订单
@@ -565,6 +596,19 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                 // 车序号主键
                 BigDecimal saleOrderMaterialId = amsSaleOrderMaterialMapper.selectMaxId();
                 BigDecimal shippingAddressId = DataChange.dataToBigDecimal(map.get("shipperAddressId"));
+                if (shippingAddressId == null || shippingAddressId.intValue() == 0) {
+                    String province = (String) map.get("province");
+                    String district = (String) map.get("district");
+                    String town = (String) map.get("town");
+                    Map<String,Object> addressMap = new HashMap<>();
+                    addressMap.put("province",province);
+                    addressMap.put("district",district);
+                    addressMap.put("town",town);
+                    shippingAddressId = amsSaleOrderMapper.findAddressId(addressMap);
+                    if (shippingAddressId == null) {
+                        throw new Exception("您输入的:" + province + district + town + "地址不存在!!");
+                    }
+                }
                 // 车号备注
                 String truckRemark = (String) (map.get("truckRemark"));
                 String place = (String) (map.get("place"));
@@ -643,6 +687,22 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
              */
             // 物资
             BigDecimal materialId = DataChange.dataToBigDecimal(map.get("materialId"));
+            if (materialId == null || materialId.intValue() == 0) {
+                String name = (String) map.get("materialName");
+                String specification = (String) map.get("materialSpecification");
+                String model = (String) map.get("materialModel");
+                Map<String,Object> materialMap = new HashMap<>();
+                materialMap.put("name",name);
+                materialMap.put("specification",specification);
+                if (model == null || model.equals("") || model.equals("null")) {
+                    model = null;
+                }
+                materialMap.put("model",model);
+                materialId = amsSaleOrderMapper.findMaterialId(materialMap);
+                if (materialId == null) {
+                    throw new Exception("您输入的物资:" + name + specification + model + "不存在!!");
+                }
+            }
             Integer materialCount = amsSaleMaterialMapper.getMaterialCount(materialId);
             RmsMaterial rmsMaterial = new RmsMaterial();
             rmsMaterial.setMaterialId(materialId);
@@ -702,7 +762,9 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
      */
     @Override
     public List<Map<String, Object>> getTruckNoAndMaterialList(BigDecimal saleOrderId) {
-        List<Map<String,Object>> mapList = amsSaleOrderMapper.getTruckNoAndMaterial(saleOrderId);
+        HashMap<String,Object> mapValue = new HashMap<>();
+        mapValue.put("saleOrderId",saleOrderId);
+        List<Map<String,Object>> mapList = amsSaleOrderMapper.getTruckNoAndMaterial(mapValue);
         for (Map<String,Object> map : mapList) {
             BigDecimal placeId = (BigDecimal) map.get("placeId");
             if (placeId != null) {
@@ -720,7 +782,13 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
      */
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public int dispatchSteelOrder(List<Map<String, Object>> mapList) {
+    public int dispatchSteelOrder(List<Map<String, Object>> mapList) throws Exception {
+        Map<String, Object> stringObjectMap = mapList.get(0);
+        Integer saleStatus = amsSaleOrderMapper.findStatus(DataChange.dataToBigDecimal(stringObjectMap.get("saleOrderMaterialId")));
+        String selfMention = amsSaleOrderMapper.findSelfMention(DataChange.dataToBigDecimal(stringObjectMap.get("saleOrderMaterialId")));
+        if (saleStatus == 1) {
+            throw new Exception("订单未审核,无法派车!");
+        }
         int result = 0;
         BigDecimal isSteel=null;
         // 遍历每一行
@@ -733,6 +801,26 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             BigDecimal carrierId = DataChange.dataToBigDecimal(map.get("carrierId"));
             // 查询到车序号的单价
             BigDecimal priceId = amsSaleOrderMapper.getOrderPrice(map);
+            // 得到详细地址id
+            BigDecimal placeId = amsSaleOrderMapper.getPlaceId(saleOrderMaterialId);
+            // 如果详细地址匹配不到单价,则匹配省市县内最高的一条单价(只给非自提的进行匹配)
+            if (priceId == null && selfMention.equals("否")) {
+                // 找到详细地址下的省市县id
+                BigDecimal addressId = amsSaleOrderMapper.getAddressByPlace(placeId);
+                // 根据省市县匹配出省市县下的所有单价
+                Map<String,Object> hashMap = new HashMap<>();
+                hashMap.put("addressId",addressId);
+                hashMap.put("carrierId",carrierId);
+                List<Map<String,Object>> priceList = amsSaleOrderMapper.getAddressPriceList(hashMap);
+                // 如果长度为0,说明此地址所在省市县内也无单价
+                if (priceList != null && priceList.size() != 0) {
+                    Map<String, Object> priceMap = priceList.get(0);
+                    priceId = (BigDecimal) priceMap.get("priceId");
+                }
+                else {
+                    priceId = new BigDecimal(2400);
+                }
+            }
             // 运输线路id
             BigDecimal lineId = DataChange.dataToBigDecimal(map.get("lineId"));
             // 司机电话号码
@@ -980,22 +1068,28 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         int result = 0;
         AmsSaleOrder amsSaleOrder = new AmsSaleOrder();
         amsSaleOrder.setSaleOrderId(saleOrderId);
-        amsSaleOrder.setDeleted(new BigDecimal(1));
+        amsSaleOrder.setDeleted(new BigDecimal(2));
         // 如果是已经上传金蝶的销售订单,则同步删除
         AmsSaleOrder amsSaleOrder1 = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
-        if (amsSaleOrder1.getSaleOrderStatus().intValue() == 2 || amsSaleOrder1.getSaleOrderStatus().intValue() == 4) {
-            Map<String, Object> input = joinFeign.getSaleOrder(saleOrderId);
-            Map<String, Object> head = (Map<String, Object>) input.get("head");
-            head.put("status","close");
-            // 获得金蝶接口配置
-            Map<String, Object> totalMap = easUtil.getTotalMap();
-            // 组装报文
+        if (amsSaleOrder1.getSaleOrderStatus().intValue() == 1 || amsSaleOrder1.getSaleOrderStatus().intValue() == 2 || amsSaleOrder1.getSaleOrderStatus().intValue() == 4) {
+            String reason = "修改物资关闭上一条销售订单";
+            String number = amsSaleOrder1.getSaleNumber();
+            String wholeOrder = "1";
+            String status = "close";
+            Map<String,Object> head = new HashMap<>();
+            head.put("number",number);
+            head.put("reason",reason);
+            head.put("wholeOrder",wholeOrder);
+            head.put("status",status);
+            Map<String,Object> input = new HashMap<>();
+            Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
+            input.put("head",head);
             totalMap.put("input",input);
-            System.out.println(totalMap);
+            // 调用金蝶关闭接口
             String json = JSONUtils.toJSONString(totalMap);
             System.out.println(json);
-            Map<String,Object> s = joinFeign.pushSaleOrderToEas(totalMap);
-            System.out.println(s);
+            Map<String,Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
+            System.out.println(resultMap);
         }
         // 如果是副产品订单则关闭时同步关闭未进厂的运单
         Map<String,Object> map = new HashMap<>();
@@ -1042,6 +1136,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
      * @param saleOrderIdList
      * @return
      */
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public int uploadSaleOrderList(List<Map<String, Object>> saleOrderIdList) {
         int result = 0;
@@ -1062,6 +1157,10 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             String json = JSONUtils.toJSONString(totalMap);
             System.out.println(json);
             Map<String,Object> s = joinFeign.pushSaleOrderToEas(totalMap);
+            String status = (String) s.get("status");
+            if ("-1".equals(status)) {
+                continue;
+            }
             System.out.println(s);
             amsSaleOrder.setSaleOrderId(saleOrderId);
             amsSaleOrder.setSaleOrderStatus(new BigDecimal(1));
@@ -1319,9 +1418,12 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             // 得到销售订单物资表主键
             List<Map<String,Object>> saleMaterialIdList = amsSaleOrderMapper.getSaleMaterialId(saleOrderMaterialId);
             for (Map<String, Object> map : saleMaterialIdList) {
-                // 删除销售订单物资子表
+                // 关闭销售订单物资子表
                 BigDecimal saleMaterialId = (BigDecimal) map.get("saleMaterialId");
-                amsSaleMaterialMapper.deleteByPrimaryKey(saleMaterialId);
+                AmsSaleMaterial amsSaleMaterial = new AmsSaleMaterial();
+                amsSaleMaterial.setDeleted(new BigDecimal(0));
+                amsSaleMaterial.setSaleMaterialId(saleMaterialId);
+                amsSaleMaterialMapper.updateByPrimaryKeySelective(amsSaleMaterial);
             }
             return 0;
         }
@@ -1560,9 +1662,13 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
         String wholeOrder = "1";
         String status = "close";
         Map<String,Object> head = new HashMap<>();
+        // 销售订单号
         head.put("number",number);
+        // 关闭原因
         head.put("reason",reason);
+        // 是否整单
         head.put("wholeOrder",wholeOrder);
+        // 发送状态
         head.put("status",status);
         Map<String,Object> input = new HashMap<>();
         Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
@@ -1613,7 +1719,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     public int updateCapacityNumberInFactory(Map<String, Object> mapValue) {
         Object lineSequence = mapValue.get("lineSequence");
         int result = 0;
-        if (lineSequence == null || lineSequence.equals("0") || lineSequence.equals("1") || lineSequence.equals("2")) {
+        if (lineSequence == null || "0".equals(lineSequence.toString()) || "1".equals(lineSequence.toString()) || "2".equals(lineSequence.toString())) {
             result += amsSaleOrderMapper.updateCapacityNumberInFactory(mapValue);
         }
         return result;
@@ -1623,4 +1729,213 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     public List<Map<String, Object>> getSaleMaterialId(BigDecimal saleOrderMaterialId) {
         return amsSaleOrderMapper.getSaleMaterialId(saleOrderMaterialId);
     }
+
+    /**
+     * 展示下发给承运商的车序号和物资
+     * @param map
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getCarrierTruckNoAndMaterialList(Map<String,Object> map) {
+        Object carrierSsoId = map.get("carrierSsoId");
+        if (carrierSsoId != null && ("".equals(carrierSsoId)) || "null".equals(carrierSsoId) || "undefined".equals(carrierSsoId)) {
+            map.replace("carrierSsoId",null);
+        }
+        List<Map<String,Object>> mapList = amsSaleOrderMapper.getTruckNoAndMaterial(map);
+        for (Map<String,Object> mapValue : mapList) {
+            BigDecimal placeId = (BigDecimal) mapValue.get("placeId");
+            if (placeId != null) {
+                List<Map<String, Object>> carrierAndPriceList = getCarrierByPlace(placeId);
+                mapValue.put("carrierAndPriceList", carrierAndPriceList);
+            }
+        }
+        return mapList;
+    }
+
+    /**
+     * 同步关闭金蝶物资分录
+     * @param mapValue
+     * @return
+     */
+    @Override
+    @Transactional
+    public int closeSteelMaterialId(Map<String, Object> mapValue) {
+        int result = 0;
+        Object orderId = mapValue.get("orderId");
+        Integer orderStatus = (Integer) mapValue.get("orderStatus");
+        BigDecimal saleOrderMaterialId = DataChange.dataToBigDecimal(mapValue.get("saleOrderMaterialId"));
+        List<Map<String, Object>> loadIdList = amsSaleMaterialMapper.findLoadIdList(saleOrderMaterialId);
+        List<Map<String, Object>> weightIdList = amsSaleMaterialMapper.findWeightIdList(saleOrderMaterialId);
+        String reason = (String) mapValue.get("reason");
+        BigDecimal saleMaterialId = DataChange.dataToBigDecimal(mapValue.get("saleMaterialId"));
+        // 如果还未派车
+        if (orderId == null) {
+            // 订单子表设为关闭状态
+            AmsSaleMaterial amsSaleMaterial = new AmsSaleMaterial();
+            amsSaleMaterial.setSaleMaterialId(saleMaterialId);
+            amsSaleMaterial.setDeleted(new BigDecimal(0));
+            amsSaleMaterial.setInsertUpdateRemark(reason);
+            result += amsSaleMaterialMapper.updateByPrimaryKeySelective(amsSaleMaterial);
+            return result;
+        }
+        // 订单子表设为关闭状态
+        AmsSaleMaterial amsSaleMaterial = new AmsSaleMaterial();
+        amsSaleMaterial.setSaleMaterialId(saleMaterialId);
+        amsSaleMaterial.setDeleted(new BigDecimal(0));
+        amsSaleMaterial.setInsertUpdateRemark(reason);
+        result += amsSaleMaterialMapper.updateByPrimaryKeySelective(amsSaleMaterial);
+        // 已派车
+        if (loadIdList == null || loadIdList.size() == 0) {
+            return result;
+        }
+        // 删除实绩表
+        Map<String, Object> loadMap = loadIdList.get(0);
+        Map<String, Object> weightMap = weightIdList.get(0);
+        BigDecimal loadId = (BigDecimal) loadMap.get("loadId");
+        BigDecimal weightId = (BigDecimal) weightMap.get("weightId");
+        result += amsSaleMaterialMapper.updateOrderMaterialToClose(mapValue);
+        result += amsSaleMaterialMapper.deleteLoadResult(loadId);
+        result += amsSaleMaterialMapper.deleteWeightResult(weightId);
+        result += amsSaleMaterialMapper.deleteWmspOutResult(mapValue);
+        return result;
+    }
+
+    /**
+     * 展示已审核化产焦炭销售订单列表
+     * @param mapValue
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getSaleCokeOrder(Map<String, Object> mapValue) {
+        List<Map<String, Object>> resultList = amsSaleOrderMapper.getSaleCokeOrder(mapValue);
+        return resultList;
+    }
+
+    /**
+     * 反关闭金蝶单个分录
+     * @param saleMaterialId
+     * @return
+     */
+    @Override
+    public int adverseCloseSaleMaterial(BigDecimal saleMaterialId) {
+        Map<String,Object> head = new HashMap<>();
+        Map<String,Object> input = new HashMap<>();
+        // 0:代表不关闭整单
+        String wholeOrder = "0";
+        // unClose : 代表反关闭
+        String status = "unClose";
+        AmsSaleMaterial amsSaleMaterial = amsSaleMaterialMapper.selectByPrimaryKey(saleMaterialId);
+        int result = amsSaleMaterialMapper.adverseCloseSaleMaterial(saleMaterialId);
+        AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(amsSaleMaterial.getSaleOrderId());
+        // 根据分录id查询运单id,物资id,总实绩id
+        Map<String,Object> saleMaterialMap = amsSaleOrderMapper.getSaleMaterialMessage(saleMaterialId);
+        BigDecimal orderId = (BigDecimal) saleMaterialMap.get("orderId");
+        BigDecimal orderStatus = (BigDecimal) saleMaterialMap.get("orderStatus");
+        if (orderId != null && orderStatus.intValue() == 5) {
+            BigDecimal resultTotalId = (BigDecimal) saleMaterialMap.get("resultTotalId");
+            BigDecimal materialId = (BigDecimal) saleMaterialMap.get("materialId");
+            // 根据总实绩id查询订单中的最大路段顺序号
+            int maxNum = amsSaleOrderMapper.findOrderMaxNum(resultTotalId);
+            // 得到皮重顺序号
+            int tareNum = maxNum - 3;
+            // 得到装货顺序号
+            int loadNum = maxNum - 2;
+            // 得到毛重顺序号
+            int grossNum = maxNum - 1;
+            // 装货实绩
+            TmstruckLoadResult tmstruckLoadResult = new TmstruckLoadResult();
+            TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
+            tmstruckLoadResult.setResultId(tmstruckLoadResultMapper.selectMaxId());
+            tmstruckLoadResult.setResultTotalId(resultTotalId);
+            tmstruckLoadResult.setMaterialId(materialId);
+            tmstruckLoadResult.setSegmentSqe(new BigDecimal(loadNum));
+            result += tmstruckLoadResultMapper.insertSelective(tmstruckLoadResult);
+            // 计量实绩
+            tmstruckWeightResult.setWeightTaskResultId(tmstruckWeightResultMapper.selectMaxId());
+            tmstruckWeightResult.setResultTotalId(resultTotalId);
+            tmstruckWeightResult.setMaterialId(materialId);
+            tmstruckWeightResult.setResultTarePlaceId(new BigDecimal(10));
+            tmstruckWeightResult.setResultGrossPlaceId(new BigDecimal(2));
+            tmstruckWeightResult.setGrossSegmentSqe(new BigDecimal(grossNum));
+            tmstruckWeightResult.setTareSegmentSqe(new BigDecimal(tareNum));
+            result += tmstruckWeightResultMapper.insertSelective(tmstruckWeightResult);
+            // 出库子表
+            BigDecimal outBoundId = (BigDecimal) saleMaterialMap.get("outBoundId");
+            BigDecimal materialNumber = (BigDecimal) saleMaterialMap.get("materialNumber");
+            if (outBoundId != null) {
+                BigDecimal resultMaterialId = wmspOutboundResultMaterialMapper.getSeqNumber("seq__WMSP_OUTBOUND_RESUL_TMATRIAL");
+                WmspOutboundResultMaterial wmspOutboundResultMaterial = new WmspOutboundResultMaterial();
+                wmspOutboundResultMaterial.setResultMaterialId(resultMaterialId);
+                wmspOutboundResultMaterial.setOutboundResultId(outBoundId);
+                wmspOutboundResultMaterial.setMaterialId(materialId);
+                wmspOutboundResultMaterial.setMaterialNumber(materialNumber);
+                wmspOutboundResultMaterial.setInsertTime(new Date());
+                wmspOutboundResultMaterial.setInsertUsername("admin");
+                wmspOutboundResultMaterial.setStatus(new BigDecimal(1));
+                result += wmspOutboundResultMaterialMapper.insertSelective(wmspOutboundResultMaterial);
+            }
+        }
+        // 设置反关闭分录id
+        head.put("unCloseEntryId",amsSaleMaterial.getEasPrimaryId());
+        // 设置是否整单
+        head.put("wholeOrder",wholeOrder);
+        // 设置销售订单号
+        head.put("number",amsSaleOrder.getSaleNumber());
+        // 设置状态:unClose,反关闭;close,关闭
+        head.put("status",status);
+        input.put("head",head);
+        // 测试
+        Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
+        // 正式
+//        Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
+        input.put("head",head);
+        totalMap.put("input",input);
+        // 调用金蝶关闭接口
+        String json = JSONUtils.toJSONString(totalMap);
+        System.out.println(json);
+        Map<String,Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
+        System.out.println(resultMap);
+        return result;
+    }
+
+    /**
+     * 反关闭金蝶整个销售订单
+     * @param saleOrderId
+     * @return
+     */
+    @Override
+    public int adverseCloseSaleOrder(BigDecimal saleOrderId) {
+        Map<String,Object> head = new HashMap<>();
+        Map<String,Object> input = new HashMap<>();
+        // 0:代表不关闭整单
+        String wholeOrder = "1";
+        // unClose : 代表反关闭
+        String status = "unClose";
+        AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
+        amsSaleOrder.setDeleted(new BigDecimal(0));
+        // 开启所有的分录
+        int result = amsSaleMaterialMapper.openAllSaleMaterial(amsSaleOrder.getSaleOrderId());
+        result += amsSaleOrderMapper.updateByPrimaryKeySelective(amsSaleOrder);
+        // 设置是否整单
+        head.put("wholeOrder",wholeOrder);
+        // 设置销售订单号
+        head.put("number",amsSaleOrder.getSaleNumber());
+        // 设置状态:unClose,反关闭;close,关闭
+        head.put("status",status);
+        input.put("head",head);
+        // 测试
+        Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
+        // 正式
+//        Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
+        input.put("head",head);
+        totalMap.put("input",input);
+        // 调用金蝶关闭接口
+        String json = JSONUtils.toJSONString(totalMap);
+        System.out.println(json);
+        Map<String,Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
+        System.out.println(resultMap);
+        return result;
+    }
+
+
 }

+ 8 - 0
src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java

@@ -47,6 +47,9 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
     @Autowired
     private AmstruckRequirementPlanMapper amstruckRequirementPlanMapper;
 
+    @Autowired
+    AmsContractTruckPriceServiceImpl amsContractTruckPriceService;
+
     @Override
     protected IBaseMapper<AmstruckInwardRequirement, BigDecimal> getMapper() {
         return amstruckInwardRequirementMapper;
@@ -153,6 +156,11 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
             amstruckRequirementMaterial.setInsertUsername("admin");
             amstruckRequirementMaterial.setInsertUpdateRemark(InsertUpdateRemark);
             result += amstruckRequirementMaterialMapper.insertSelective(amstruckRequirementMaterial);
+            if(mapValue.get("rangeId") != null){
+                //承运起止范围
+                requireMaterialMap.put("rangeId",mapValue.get("rangeId"));
+                amsContractTruckPriceService.insertLineNodePoint(requireMaterialMap);
+            }
         }
         return result;
     }

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

@@ -13,7 +13,7 @@ openfeign:
    ESFeign:
      url: ${ESFEIGN_URL:172.16.33.166:8089}
    ColumnDataFeign:
-     url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
+     url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
    TmsTruckFeign:
       url: ${TMSTRUCKFEIGN_URL:172.16.33.166:8088}
    ImFeign:

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

@@ -17,11 +17,11 @@ eureka:
   client:
     service-url:
       defaultZone: http://root:root@${EUREKA_HOST:172.16.33.161}:${EUREKA_PORT:8081}/eureka/
-    register-with-eureka: true #表示向EurekaServer注册自己 默认为true
-    fetch-registry: true #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
+    register-with-eureka: false #表示向EurekaServer注册自己 默认为true
+    fetch-registry: false #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
 
   instance:
-    prefer-ip-address: true
+    prefer-ip-address: false
     status-page-url: http://${spring.cloud.client.ip-address}:${server.port}/swagger-ui.html#/
     instance-id: ${spring.cloud.client.ip-address}:${server.port}
 

+ 8 - 5
src/main/resources/com/steerinfo/dil/mapper/AmsContaactPriceMaterialMapper.xml

@@ -163,11 +163,14 @@
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <select id="getMaterialName" resultType="java.util.Map" parameterType="decimal">
     select
-    rm.MATERIAL_NAME "materialName",
-    rm.MATERIAL_ID "materialId"
+    RMT.MATERIAL_TYPE_NAME "materialName",
+    RMT.MATERIAL_TYPE_ID "materialId"
     from AMS_CONTAACT_PRICE_MATERIAL acpr
-    left join RMS_MATERIAL RM
-    on rm.MATERIAL_ID = acpr.MATERIAL_ID
-    where PRICE_ID = #{priceId}
+    left join RMS_MATERIAL_TYPE RMT
+    on RMT.MATERIAL_TYPE_ID = acpr.MATERIAL_ID
+    where
+    RMT.MATERIAL_ISINWARD = 1
+    AND
+    PRICE_ID = #{priceId}
   </select>
 </mapper>

+ 39 - 1
src/main/resources/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.xml

@@ -903,7 +903,10 @@
                            ON a_t_price.LINE_ID = RGR.TRANS_RANGE_ID
                  LEFT JOIN RMS_OIL_TYPE r_o_type
                            ON a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
-        where TYPE in (2,5,6))
+        where TYPE in (2,5,6)
+        <if test="deleted != null">
+          and a_t_price.DELETED = #{deleted}
+        </if> )
   </select>
     <select id="selectInwardPrice" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
       select * from (select
@@ -928,4 +931,39 @@
       )
       Order by "priceDate" desc
     </select>
+    <select id="getRangePoint" resultType="java.util.Map" parameterType="java.util.Map">
+        SELECT * FROM
+        (SELECT RTR.TRANS_RANGE_VALUE "transRangeValue" ,
+                RLNP.LOAD_POINT_NAME "loadPointName" ,
+                RLNP.UNLOAD_POINT_NAME "unloadPointName",
+                RTR.TRANS_RANGE_ID  "transRangeId",
+                RLNP.LINE_NODE_ID   "lineNodeId"  FROM RMS_TRANS_RANGE RTR
+        LEFT JOIN RMS_LINE_NODE_POINT RLNP on RTR.TRANS_RANGE_ID = RLNP.TRANS_RANGE_ID
+        where RLNP.DELETED = 0
+        <if test="con != null">
+          AND
+          RTR.TRANS_RANGE_VALUE||RLNP.LOAD_POINT_NAME||RLNP.UNLOAD_POINT_NAME like #{con}
+        </if>
+        )
+        <where>
+          <if test="transRangeValue != null">
+            and
+            <foreach collection="transRangeValue" item="item" open="(" separator="or" close=")">
+              "transRangeValue" like '%${item}%'
+            </foreach>
+          </if>
+          <if test="loadPointName != null">
+            and
+            <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
+              "loadPointName" like '%${item}%'
+            </foreach>
+          </if>
+          <if test="loadPointName != null">
+            and
+            <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
+              "loadPointName" like '%${item}%'
+            </foreach>
+          </if>
+        </where>
+    </select>
 </mapper>

+ 79 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsSaleMaterialMapper.xml

@@ -501,5 +501,84 @@
     FROM RMS_MATERIAL RM
     WHERE RM.MATERIAL_ID = #{materialId}
   </select>
+  
+  <select id="findLoadIdList" parameterType="DECIMAL" resultType="java.util.Map">
+    SELECT TLR.RESULT_ID AS "loadId"
+    FROM OMSTRUCK_ORDER OO
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON OO.ORDER_ID = TTR.ORDER_ID
+           LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
+                     ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    WHERE OO.ORDER_TYPE = 1
+      AND OO.ORDER_STATUS = 5
+      AND TLR.MATERIAL_ID IS NULL
+      AND OO.ORDER_PLAN_ID = #{saleOrderMaterialId}
+    ORDER BY TLR.SEGMENT_SQE DESC
+  </select>
+
+  <select id="findWeightIdList" parameterType="DECIMAL" resultType="java.util.Map">
+    SELECT TWR.WEIGHT_TASK_RESULT_ID AS "weightId"
+    FROM OMSTRUCK_ORDER OO
+           LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+                     ON OO.ORDER_ID = TTR.ORDER_ID
+           LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
+                     ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
+    WHERE OO.ORDER_TYPE = 1
+      AND OO.ORDER_STATUS IN (4, 5)
+      AND TWR.MATERIAL_ID IS NULL
+      AND OO.ORDER_PLAN_ID = #{saleOrderMaterialId}
+    ORDER BY TWR.TARE_SEGMENT_SQE DESC
+  </select>
+  
+  <delete id="deleteLoadResult" parameterType="DECIMAL" >
+    DELETE FROM TMSTRUCK_LOAD_RESULT WHERE RESULT_ID = #{loadId}
+  </delete>
+
+  <delete id="deleteWeightResult" parameterType="DECIMAL" >
+    DELETE FROM TMSTRUCK_WEIGHT_RESULT WHERE WEIGHT_TASK_RESULT_ID = #{weightId}
+  </delete>
+
+  <delete id="updateOrderMaterialToClose" parameterType="java.util.Map" >
+    UPDATE OMSTRUCK_ORDER_MATERIAL OOM
+    SET OOM.MATERIAL_PRIORITY = 71
+    WHERE OOM.ORDER_ID =
+          (
+            SELECT OO.ORDER_ID
+            FROM OMSTRUCK_ORDER OO
+            WHERE OO.ORDER_TYPE = 1
+              AND OO.ORDER_PLAN_ID = #{saleOrderMaterialId})
+      AND OOM.MATERIAL_ID =
+          (SELECT ASM.MATERIAL_ID
+           FROM AMS_SALE_MATERIAL ASM
+           WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId})
+  </delete>
+
+  <delete id="deleteWmspOutResult" parameterType="java.util.Map" >
+    DELETE
+    FROM WMSP_OUTBOUND_RESULT_MATERIAL WORM
+    WHERE WORM.OUTBOUND_RESULT_ID =
+          (SELECT WOR.RESULT_ID
+           FROM WMSP_OUTBOUND_RESULT WOR
+                  LEFT JOIN OMSTRUCK_ORDER OO
+                            ON OO.ORDER_ID = WOR.BILL_LADING_ID
+           WHERE OO.ORDER_TYPE = 1
+             AND OO.ORDER_PLAN_ID = #{saleOrderMaterialId})
+      AND WORM.MATERIAL_ID =
+          (SELECT ASM.MATERIAL_ID
+           FROM AMS_SALE_MATERIAL ASM
+           WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId})
+  </delete>
+
+  <update id="openAllSaleMaterial" parameterType="DECIMAL" >
+    UPDATE AMS_SALE_MATERIAL ASM
+    SET ASM.DELETED = NULL
+    WHERE ASM.SALE_ORDER_ID = #{saleOrderId}
+  </update>
+
+  <update id="adverseCloseSaleMaterial" parameterType="DECIMAL">
+    UPDATE AMS_SALE_MATERIAL ASM
+    SET ASM.DELETED = NULL
+    WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
+  </update>
 
 </mapper>

+ 387 - 76
src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml

@@ -854,7 +854,6 @@
     from AMS_SALE_TRUCKNO_MATERIAL truckno_material group by
     truckno_material.SALE_ORDER_MATERIAL_ID) tt
     on tt.s_order_material = sale_material.SALE_ORDER_MATERIAL_ID
-
     group by
     sale_material.SALE_ORDER_ID) allmaterial_info
     on a_s_order.SALE_ORDER_ID=allmaterial_info.saleOrderId
@@ -1541,6 +1540,7 @@
     LEFT JOIN RMS_SALER R_SALER
     ON R_SALER.SALER_ID = a_s_order.SALER_ID
     where a_s_order.SALE_ORDER_STATUS=0 and a_s_order.DELETED=0
+    and ASM.DELETED IS NULL
     <if test="con != null">
       and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
     </if>
@@ -1667,20 +1667,30 @@
     RM.MATERIAL_MODEL "materialModel",
     RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
     ASM.MATERIAL_NUMBER "materialNumber",
-    RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel"
+    RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
+    RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "addressPlace"
     from AMS_SALE_ORDER a_s_order
     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.RECEIVE_ID=r_consignee.CONSIGNEE_ID
+    left join AMS_SALE_ORDER_MATERIAL ASOM
+    on asom.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
+    left join RMS_RECEIVE_PLACE RRP
+    on RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
+    LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+    ON RRP.ADDRESS_ID = RRA.ADDRESS_ID
+    LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+    ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
     LEFT JOIN AMS_SALE_MATERIAL ASM
-    ON ASM.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
+    ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
     LEFT JOIN RMS_MATERIAL RM
     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
     LEFT JOIN RMS_SALER R_SALER
     ON R_SALER.SALER_ID = a_s_order.SALER_ID
     where a_s_order.SALE_ORDER_STATUS=1
     and a_s_order.DELETED = 0
+    AND ASM.DELETED IS NULL
     <if test="con != null">
       and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
     </if>
@@ -1945,15 +1955,28 @@
     RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "specificationModel",
     ASM.MATERIAL_NUMBER "materialNumber",
     RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "nameSpecificationModel",
+    RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "addressPlace",
     ASM.SALE_WAREHOUSE "saleWareHouse",
-    a_s_order.DELETED "deleted"
+    a_s_order.DELETED "deleted",
+    a_s_order.SHIPPER_ID "shipperId",
+    a_s_order.RECEIVE_ID "receiveId",
+    a_s_order.SALE_ORDER_ISSELF_MENTION "isSelfMention",
+    a_s_order.SALER_ID "salerId"
     from AMS_SALE_ORDER a_s_order
     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.RECEIVE_ID=r_consignee.CONSIGNEE_ID
+    left join AMS_SALE_ORDER_MATERIAL ASOM
+    on asom.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
+    left join RMS_RECEIVE_PLACE RRP
+    on RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
+    LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+    ON RRP.ADDRESS_ID = RRA.ADDRESS_ID
+    LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+    ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
     LEFT JOIN AMS_SALE_MATERIAL ASM
-    ON ASM.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
+    ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
     LEFT JOIN RMS_MATERIAL RM
     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
     LEFT JOIN RMS_SALER R_SALER
@@ -1961,6 +1984,7 @@
     where a_s_order.SALE_ORDER_STATUS in (2,4)
     and a_s_order.CLOSE_STATUS is null
     and a_s_order.DELETED = 0
+    and ASM.DELETED IS NULL
     <if test="con != null">
       and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
     </if>
@@ -2218,23 +2242,24 @@
   <select id="getSaleOrderAndMaterialById" resultType="java.util.Map" parameterType="java.util.Map">
     SELECT *
     FROM (
-    select ASO.SALE_ORDER_ID                              as "saleOrderId",
-    ASM.SALE_MATERIAL_ID                           as "saleMaterialId",
-    RM.MATERIAL_ID                                 as "materialId",
-    ASO.SALE_NUMBER                                as "saleNumber",
-    ASO.SALE_ORDER_ISSELF_MENTION                  as "saleOrderIsselfMention",
-    RS.SHIPPER_NAME                                as "shipperName",
-    RC.CONSIGNEE_COMPANY_NAME                      as "consigneeCompanyName",
-    RM.MATERIAL_NAME                               as "materialName",
-    ASM.MATERIAL_NUMBER                            as "materialNumber",
-    ASM.MATERIAL_WEIGHT                            as "materialWeight",
-    ASM.SALE_WAREHOUSE                             as "saleWareHouse",
+    select ASO.SALE_ORDER_ID as "saleOrderId",
+    ASM.SALE_MATERIAL_ID as "saleMaterialId",
+    RM.MATERIAL_ID as "materialId",
+    ASO.SALE_NUMBER as "saleNumber",
+    ASO.SALE_ORDER_ISSELF_MENTION as "saleOrderIsselfMention",
+    ASO.SALE_REMARK as "saleRemark",
+    RS.SHIPPER_NAME as "shipperName",
+    RC.CONSIGNEE_COMPANY_NAME as "consigneeCompanyName",
+    RM.MATERIAL_NAME as "materialName",
+    ASM.MATERIAL_NUMBER as "materialNumber",
+    ASM.MATERIAL_WEIGHT as "materialWeight",
+    ASM.SALE_WAREHOUSE as "saleWareHouse",
     RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL as "specificationModel",
-    RM.MATERIAL_CODE                               as "materialCode",
-    nvl(sumWeight.weight,0)+nvl(sumWeight2.weight,0)             as "totalWeight",
-    nvl(sumWeight.weight ,0)                              as "netWeight",
-    nvl(sumWeight2.weight ,0)                              as "weight",
-    nvl(carCount.coun ,0)                                   as "carCount"
+    RM.MATERIAL_CODE as "materialCode",
+    nvl(sumWeight.weight,0)+nvl(sumWeight2.weight,0) as "totalWeight",
+    nvl(sumWeight.weight ,0) as "netWeight",
+    nvl(sumWeight2.weight ,0) as "weight",
+    nvl(carCount.coun ,0) as "carCount"
     from AMS_SALE_ORDER ASO
     left join RMS_SHIPPER RS
     on ASO.SHIPPER_ID = RS.SHIPPER_ID
@@ -2245,7 +2270,7 @@
     left join RMS_MATERIAL RM
     on RM.MATERIAL_ID = ASM.MATERIAL_ID
     left join (
-    select sum( t_w_result.RESULT_NET_WEIGHT)  weight,a_s_o_material.SALE_ORDER_ID SALE_ORDER_ID
+    select sum( t_w_result.RESULT_NET_WEIGHT) weight,a_s_o_material.SALE_ORDER_ID SALE_ORDER_ID
     from AMS_SALE_ORDER_MATERIAL a_s_o_material
     left join Omstruck_Order o_order
     on a_s_o_material.SALE_ORDER_MATERIAL_ID=o_order.order_plan_id
@@ -2258,7 +2283,7 @@
     ) sumWeight
     on sumWeight.SALE_ORDER_ID=ASO.SALE_ORDER_ID
     left join (
-    select sum( o_o_material.ORDER_MATERIAL_WEIGHT)  weight,a_s_o_Material.SALE_ORDER_ID SALE_ORDER_ID
+    select sum( o_o_material.ORDER_MATERIAL_WEIGHT) weight,a_s_o_Material.SALE_ORDER_ID SALE_ORDER_ID
     from AMS_SALE_ORDER_MATERIAL a_s_o_material
     left join Omstruck_Order o_order
     on a_s_o_material.SALE_ORDER_MATERIAL_ID=o_order.order_plan_id
@@ -2274,7 +2299,7 @@
     ) sumWeight2
     on sumWeight2.SALE_ORDER_ID=ASO.SALE_ORDER_ID
     left join (
-    select count(o_order.order_id)  coun ,a_s_o_Material.SALE_ORDER_ID SALE_ORDER_ID
+    select count(o_order.order_id) coun ,a_s_o_Material.SALE_ORDER_ID SALE_ORDER_ID
     from AMS_SALE_ORDER_MATERIAL a_s_o_material
     left join Omstruck_Order o_order
     on a_s_o_material.SALE_ORDER_MATERIAL_ID=o_order.order_plan_id
@@ -2282,10 +2307,10 @@
     on o_order.order_id=t_t_result.order_id
     left join Tmstruck_Weight_Result t_w_result
     on t_t_result.result_total_id=t_w_result.result_total_id
-    where  o_order.order_status in (2,4,5)
+    where o_order.order_status in (2,4,5)
     GROUP BY
     a_s_o_Material.SALE_ORDER_ID
-  
+
     ) carCount
     on carCount.SALE_ORDER_ID=ASO.SALE_ORDER_ID
     where ASO.SALE_ORDER_ID = #{saleOrderId}
@@ -2431,48 +2456,55 @@
     WHERE ASOM.SALE_ORDER_ID = #{saleOrderId}
   </select>
 
-  <select id="getTruckNoAndMaterial" parameterType="DECIMAL" resultType="java.util.Map" >
-    SELECT DISTINCT ASOM.SALE_ORDER_MATERIAL_TRUCK_NO              AS "truckNo",
-                    RM.MATERIAL_NAME                               AS "materialName",
-                    ASM.MATERIAL_ID                                AS "materialId",
-                    ASM.MATERIAL_NUMBER                            AS "materialNumber",
-                    ASM.MATERIAL_WEIGHT                            AS "materialWeight",
-                    ASOM.SALE_DATE_OF_RECEIPT                      AS "receiptDate",
-                    RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "materialModelSpecification",
-                    RM.MATERIAL_CODE                               AS "materialCode",
-                    RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN ||
-                    RRP.ADDRESS_DELIVERY_ADDRESS                   AS "place",
-                    ASOM.SALE_DATE_OF_RECEIPT                      AS "receiptDate",
-                    ASOM.SALE_ORDER_CONSIGNEE_TEL                  AS "saleOrderConsigneeTel",
-                    ASOM.SALE_ORDER_CONSIGNEE                      AS "saleOrderConsignee",
-                    ASOM.SALE_ORDER_MATERIAL_ID                    AS "saleOrderMaterialId",
-                    ASOM.SALE_SHIPPING_ADDRESS_ID                  AS "placeId",
-                    RC.CAPACITY_NUMBER                             AS "capacityNumber",
-                    ADSO.CARRIER_ID                                AS "carrierId",
-                    RCA.CARRIER_NAME                               AS "carrierName",
-                    ASOM.TRUCK_REMARK                              AS "truckRemark"
+  <select id="getTruckNoAndMaterial" parameterType="java.util.Map" resultType="java.util.Map" >
+    SELECT DISTINCT ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "truckNo",
+    RM.MATERIAL_NAME AS "materialName",
+    ASM.MATERIAL_ID AS "materialId",
+    ASM.MATERIAL_NUMBER AS "materialNumber",
+    ASM.MATERIAL_WEIGHT AS "materialWeight",
+    ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
+    RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "materialModelSpecification",
+    RM.MATERIAL_CODE AS "materialCode",
+    RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN ||
+    RRP.ADDRESS_DELIVERY_ADDRESS AS "place",
+    ASOM.SALE_DATE_OF_RECEIPT AS "receiptDate",
+    ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
+    ASOM.SALE_ORDER_CONSIGNEE AS "saleOrderConsignee",
+    ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId",
+    ASOM.SALE_SHIPPING_ADDRESS_ID AS "placeId",
+    RC.CAPACITY_NUMBER AS "capacityNumber",
+    ADSO.CARRIER_ID AS "carrierId",
+    RCA.CARRIER_NAME AS "carrierName",
+    ASOM.TRUCK_REMARK AS "truckRemark",
+    DECODE(ASO.SALE_ORDER_STATUS,1,'订单已上报',2,'销售已提交',4,'财务已审批') "statusStr"
     FROM AMS_SALE_TRUCKNO_MATERIAL ASTM
-           LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
-                     ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
-           LEFT JOIN RMS_RECEIVE_PLACE RRP
-                     ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
-           LEFT JOIN RMS_RECEIVE_ADDRESS RRA
-                     ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
-           LEFT JOIN AMS_SALE_MATERIAL ASM
-                     ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
-           LEFT JOIN RMS_MATERIAL RM
-                     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
-           LEFT JOIN OMSTRUCK_ORDER OO
-                     ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
-           LEFT JOIN RMS_CAPACITY RC
-                     ON RC.CAPACITY_ID = OO.CAPACITY_ID
-           LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
-                     ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
-           LEFT JOIN RMS_CARRIER RCA
-                     ON RCA.CARRIER_ID = ADSO.CARRIER_ID
+    LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+    ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
+    LEFT JOIN AMS_SALE_ORDER ASO
+    ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    LEFT JOIN RMS_RECEIVE_PLACE RRP
+    ON RRP.PLACE_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
+    LEFT JOIN RMS_RECEIVE_ADDRESS RRA
+    ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
+    LEFT JOIN AMS_SALE_MATERIAL ASM
+    ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = ASM.MATERIAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+    LEFT JOIN RMS_CAPACITY RC
+    ON RC.CAPACITY_ID = OO.CAPACITY_ID
+    LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
+    ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
+    LEFT JOIN RMS_CARRIER RCA
+    ON RCA.CARRIER_ID = ADSO.CARRIER_ID
     WHERE ASOM.SALE_ORDER_ID = #{saleOrderId}
-      AND OO.ORDER_ID IS NULL
-      AND ADSO.DISPATCH_ID IS NOT NULL
+    <if test="carrierSsoId != null">
+      AND RCA.CARRIER_SSO_ID = #{carrierSsoId}
+    </if>
+    AND OO.ORDER_ID IS NULL
+    AND ADSO.DISPATCH_ID IS NOT NULL
+    AND ASM.DELETED IS NULL
     ORDER BY ASOM.SALE_ORDER_MATERIAL_TRUCK_NO ASC
   </select>
 
@@ -2527,7 +2559,7 @@
     a_s_order.SALE_ORDER_TAX "saleOrderTax",
     a_s_order.SALE_REMARK "saleRemark",
     a_s_order.INSERT_TIME "insertTime",
-    DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
+    DECODE(a_s_order.SALE_ORDER_STATUS,1,'订单已上报',2,'销售已提交',4,'财务已审批') "statusStr",
     a_s_order.UPDATE_TIME "updateTime",
     RM.MATERIAL_NAME "materialName",
     RM.MATERIAL_SPECIFICATION "materialSpecification",
@@ -2554,11 +2586,19 @@
     ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
     LEFT JOIN RMS_MATERIAL RM
     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
-    where a_s_order.SALE_ORDER_STATUS in (2,4)
+    where a_s_order.SALE_ORDER_STATUS in (1,2,4)
     and a_s_order.CLOSE_STATUS is null
     and a_s_order.DELETED = 0
     and ADSO.DISPATCH_TYPE = 2
     and OO.ORDER_ID IS NULL
+    AND ASM.DELETED IS NULL
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = a_s_order.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  a_s_order.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  a_s_order.INSERT_TIME
+    </if>
     <if test="carrierSsoId != null" >
       and RC.CARRIER_SSO_ID = #{carrierSsoId}
     </if>
@@ -2820,7 +2860,7 @@
     RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
     "addressDeliveryAddress",
     ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
-    DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
+    DECODE(ASO.SALE_ORDER_STATUS,1,'订单已上报',2, '销售已提交',4, '财务已审批')
     AS "approvalStatus",
     ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
     RSH.SHIPPER_NAME AS "shipperName",
@@ -2854,10 +2894,18 @@
     ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
     LEFT JOIN RMS_MATERIAL RM
     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
-    WHERE ASO.SALE_ORDER_STATUS IN (2,4)
+    WHERE ASO.SALE_ORDER_STATUS IN (1,2,4)
     AND ASOM.ISSUE_STATUS IS NULL
     AND ADSO.CARRIER_ID IS NULL
     AND ASO.DELETED = 0
+    AND ASM.DELETED IS NULL
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASO.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASO.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASO.INSERT_TIME
+    </if>
     <if test="con != null" >
       AND RCO.CONSIGNEE_COMPANY_NAME LIKE #{con}
     </if>
@@ -2965,7 +3013,7 @@
     RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
     "addressDeliveryAddress",
     ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
-    DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
+    DECODE(ASO.SALE_ORDER_STATUS,1,'订单已上报',2, '销售已提交',4, '财务已审批')
     AS "approvalStatus",
     ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
     RSH.SHIPPER_NAME AS "shipperName",
@@ -3009,6 +3057,14 @@
     AND ADSO.DISPATCH_TYPE = 2
     AND OO.ORDER_ID IS NULL
     AND ASO.DELETED = 0
+    AND ASM.DELETED IS NULL
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASO.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASO.INSERT_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASO.INSERT_TIME
+    </if>
     ) "NOCAR"
     <where>
       <if test="con != null" >
@@ -3148,7 +3204,7 @@
     RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS
     "addressDeliveryAddress",
     ASOM.SALE_DATE_OF_RECEIPT AS "saleDateOfReceipt",
-    DECODE(ASO.SALE_ORDER_STATUS,2, '销售已提交',4, '财务已审批')
+    DECODE(ASO.SALE_ORDER_STATUS,1,'订单已上报',2, '销售已提交',4, '财务已审批')
     AS "approvalStatus",
     ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
     RSH.SHIPPER_NAME AS "shipperName",
@@ -3199,6 +3255,7 @@
     AND OO.ORDER_ID IS NOT NULL
     AND OO.ORDER_STATUS IN (4,5)
     AND ASO.DELETED != 2
+    AND ASM.DELETED IS NULL
     <if test="oneDate != null">
       and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = ASOM.INSERT_TIME
     </if>
@@ -3384,7 +3441,8 @@
     RRA.ADDRESS_PROVINCE "addressProvince",
     RRA.ADDRESS_DISTRICT "addressDistrict",
     RRA.ADDRESS_TOWN "addressTown",
-    ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel"
+    ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
+    RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS "addressPlace"
     FROM AMS_SALE_ORDER ASO
     LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
     ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
@@ -3396,9 +3454,6 @@
     AND RRP.PLACE_ID IS NOT NULL
     ORDER BY ASOM.SALE_ORDER_MATERIAL_ID DESC
     )
-    WHERE rownum <![CDATA[
-    <
-    ]]> 2
   </select>
 
   <select id="getSalerByReceiveId" parameterType="DECIMAL" resultType="java.util.Map" >
@@ -4144,4 +4199,260 @@
                      ON RRP.PLACE_ID = ACTP.PLACE_ID
     WHERE RRP.ADDRESS_ID = #{addressId}
   </select>
+
+  <select id="getSaleCokeOrder" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT DISTINCT * FROM(
+    SELECT a_s_order.SALE_ORDER_ID "saleOrderId",
+    a_s_order.SALE_NUMBER "saleNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    r_consignee.CONSIGNEE_WARRANTY_AMOUNT "consigneeWarrantyAmount",
+    r_consignee.CONSIGNEE_WARRANTY_WEIGHT "consigneeWarrantyWeight",
+    a_s_order.SALE_ORDER_ISSELF_MENTION "saleOrderIsselfMention",
+    a_s_order.SALE_ACCOUNT_BALANCE "saleAccountBalance",
+    a_s_order.SALE_CURRENT_ORDER_AMOUNT "saleCurrentOrderAmount",
+    a_s_order.SALE_HISTORICAL_ORDER_AMOUNT "saleHistoricalOrderAmout",
+    a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
+    a_s_order.SALE_UNIT_PRICE "saleUnitPrice",
+    a_s_order.SALE_ORDER_TAX "saleOrderTax",
+    a_s_order.SALE_REMARK "saleRemark",
+    a_s_order.INSERT_TIME "insertTime",
+    DECODE(a_s_order.SALE_ORDER_STATUS,2,'销售已提交',4,'财务已审批') "statusStr",
+    RM.MATERIAL_NAME "materialName",
+    ASM.MATERIAL_NUMBER "materialNumber",
+    ASM.SALE_WAREHOUSE "saleWareHouse",
+    a_s_order.DELETED "deleted",
+    a_s_order.SHIPPER_ID "shipperId",
+    a_s_order.RECEIVE_ID "receiveId",
+    a_s_order.SALE_ORDER_ISSELF_MENTION "isSelfMention"
+    from AMS_SALE_ORDER a_s_order
+    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.RECEIVE_ID=r_consignee.CONSIGNEE_ID
+    LEFT JOIN AMS_SALE_MATERIAL ASM
+    ON ASM.SALE_ORDER_ID = a_s_order.SALE_ORDER_ID
+    LEFT JOIN RMS_MATERIAL RM
+    ON RM.MATERIAL_ID = ASM.MATERIAL_ID
+    where a_s_order.SALE_ORDER_STATUS in (2,4)
+    and a_s_order.CLOSE_STATUS is null
+    and a_s_order.DELETED = 0
+    and ASM.DELETED IS NULL
+    <if test="con != null">
+      and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0 or instr(RM.MATERIAL_NAME, #{con}) > 0 )
+    </if>
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= a_s_order.UPDATE_TIME
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= a_s_order.UPDATE_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= a_s_order.UPDATE_TIME
+    </if>
+    <if test="shipperId != null">
+      and a_s_order.SHIPPER_ID = #{shipperId}
+    </if>
+    <if test="consigneeSsoId != null">
+      and r_consignee.CONSIGNEE_SSO_ID = #{consigneeSsoId}
+    </if>
+    <if test="saleType == null">
+      and a_s_order.SALE_TYPE is null
+    </if>
+    ORDER BY a_s_order.UPDATE_TIME DESC
+    )
+    <where>
+      <if test="saleNumber != null">
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialSpecification != null">
+        <foreach collection="materialSpecification" item="item" open="(" separator="or" close=")">
+          "materialSpecification" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialModel != null">
+        <foreach collection="materialModel" item="item" open="(" separator="or" close=")">
+          "materialModel" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="statusStr != null">
+        <foreach collection="statusStr" item="item" open="(" separator="or" close=")">
+          and "statusStr" like '%${item}%'
+        </foreach>
+      </if>
+
+      <!--      <if test="startTime != null">-->
+      <!--        and "insertTime" &gt;= to_date('${startTime}','yyyy-mm-dd')-->
+      <!--      </if>-->
+      <!--      <if test="endTime != null">-->
+      <!--        and "insertTime" &lt;= to_date('${endTime}','yyyy-mm-dd')-->
+      <!--      </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="consigneeWarrantyAmount != null">
+        and
+        <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">
+          "consigneeWarrantyAmount" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeWarrantyWeight != null">
+        and
+        <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">
+          "consigneeWarrantyWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderIsselfMention != null">
+        and
+        <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">
+          "saleOrderIsselfMention" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleAccountBalance != null">
+        and
+        <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">
+          "saleAccountBalance" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        and
+        <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">
+          "saleCurrentOrderAmount" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleHistoricalOrderAmout != null">
+        and
+        <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">
+          "saleHistoricalOrderAmout" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderReceiveCustomer != null">
+        and
+        <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">
+          "saleOrderReceiveCustomer" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleUnitPrice != null">
+        and
+        <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">
+          "saleUnitPrice" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderTax != null">
+        and
+        <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">
+          "saleOrderTax" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleRemark != null">
+        and
+        <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
+          "saleRemark" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+  </select>
+
+  <select id="findStatus" parameterType="DECIMAL" resultType="java.lang.Integer" >
+    SELECT ASO.SALE_ORDER_STATUS AS "saleStatus"
+    FROM AMS_SALE_ORDER_MATERIAL ASOM
+           LEFT JOIN AMS_SALE_ORDER ASO
+                     ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+  </select>
+
+  <select id="getPlaceId" parameterType="DECIMAL" resultType="DECIMAL" >
+    SELECT ASOM.SALE_SHIPPING_ADDRESS_ID "placeId"
+    FROM AMS_SALE_ORDER_MATERIAL ASOM
+    WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+  </select>
+
+  <select id="getAddressPriceList" parameterType="java.util.Map" resultType="java.util.Map" >
+    SELECT ACTP.PRICE_ID AS "priceId"
+    FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
+           LEFT JOIN RMS_RECEIVE_PLACE RRP
+                     ON RRP.PLACE_ID = ACTP.PLACE_ID
+    WHERE ACTP.CARRIER_ID = #{carrierId}
+      AND RRP.ADDRESS_ID = #{addressId}
+      ORDER BY ACTP.PRICE_ID DESC
+  </select>
+
+  <select id="findSelfMention" parameterType="DECIMAL" resultType="java.lang.String" >
+    SELECT ASO.SALE_ORDER_ISSELF_MENTION AS "selfMention"
+    FROM AMS_SALE_ORDER_MATERIAL ASOM
+           LEFT JOIN AMS_SALE_ORDER ASO
+                     ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
+    WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+  </select>
+
+  <select id="findReceiveId" parameterType="java.lang.String" resultType="DECIMAL" >
+    SELECT RC.CONSIGNEE_ID AS "receiveId"
+    FROM RMS_CONSIGNEE RC
+    WHERE RC.CONSIGNEE_COMPANY_NAME = #{receiveName}
+  </select>
+
+  <select id="findSalerId" parameterType="java.lang.String" resultType="DECIMAL" >
+    SELECT RS.SALER_ID AS "salerId"
+    FROM RMS_SALER RS
+    WHERE RS.SALER_NAME = #{salerName}
+  </select>
+
+  <select id="findMaterialId" parameterType="java.util.Map" resultType="DECIMAL">
+    SELECT RM.MATERIAL_ID AS "materialId"
+    FROM RMS_MATERIAL RM
+    WHERE RM.MATERIAL_NAME = #{name}
+    AND RM.MATERIAL_SPECIFICATION = #{specification}
+    <if test="model != null">
+      AND RM.MATERIAL_MODEL = #{model}
+    </if>
+  </select>
+
+  <select id="findAddressId" parameterType="java.util.Map" resultType="DECIMAL" >
+    SELECT RRA.ADDRESS_ID AS "addressId"
+    FROM RMS_RECEIVE_ADDRESS RRA
+    WHERE RRA.ADDRESS_PROVINCE = #{province}
+    AND RRA.ADDRESS_DISTRICT = #{district}
+      AND RRA.ADDRESS_TOWN = #{town}
+  </select>
+
+  <select id="getSaleMaterialMessage" parameterType="DECIMAL" resultType="java.util.Map" >
+    SELECT ASM.MATERIAL_ID "materialId",
+           OO.ORDER_ID "orderId",
+           TTR.RESULT_TOTAL_ID "resultTotalId",
+           OO.ORDER_STATUS "orderStatus",
+           WOR.RESULT_ID "outBoundId",
+           ASM.MATERIAL_NUMBER "materialNumber"
+    FROM AMS_SALE_MATERIAL ASM
+    LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+    ON ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
+    LEFT JOIN OMSTRUCK_ORDER OO
+    ON ASTM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+    AND OO.ORDER_TYPE = 1
+    LEFT JOIN WMSP_OUTBOUND_RESULT WOR
+    ON WOR.BILL_LADING_ID = OO.ORDER_ID
+    LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
+    ON TTR.ORDER_ID = OO.ORDER_ID
+    WHERE ASM.SALE_MATERIAL_ID = #{saleMaterialId}
+  </select>
+
+  <select id="findOrderMaxNum" parameterType="DECIMAL" resultType="java.lang.Integer" >
+    SELECT TLFR.SEGMENT_SQE "maxNum"
+    FROM TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
+    WHERE TLFR.RESULT_TOTAL_ID = #{resultTotalId}
+  </select>
 </mapper>

+ 344 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsLineNodePointMapper.xml

@@ -0,0 +1,344 @@
+<?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.RmsLineNodePointMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsLineNodePoint">
+    <id column="LINE_NODE_ID" jdbcType="DECIMAL" property="lineNodeId" />
+    <result column="TRANS_RANGE_ID" jdbcType="DECIMAL" property="transRangeId" />
+    <result column="LOAD_POINT_NAME" jdbcType="VARCHAR" property="loadPointName" />
+    <result column="UNLOAD_POINT_NAME" jdbcType="VARCHAR" property="unloadPointName" />
+    <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="DELETED" jdbcType="DECIMAL" property="deleted" />
+  </resultMap>
+  <sql id="columns">
+    LINE_NODE_ID, TRANS_RANGE_ID, LOAD_POINT_NAME, UNLOAD_POINT_NAME, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.LINE_NODE_ID, t.TRANS_RANGE_ID, t.LOAD_POINT_NAME, t.UNLOAD_POINT_NAME, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM RMS_LINE_NODE_POINT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM RMS_LINE_NODE_POINT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="lineNodeId != null">
+        and LINE_NODE_ID = #{lineNodeId}
+      </if>
+      <if test="transRangeId != null">
+        and TRANS_RANGE_ID = #{transRangeId}
+      </if>
+      <if test="loadPointName != null and loadPointName != ''">
+        and LOAD_POINT_NAME = #{loadPointName}
+      </if>
+      <if test="unloadPointName != null and unloadPointName != ''">
+        and UNLOAD_POINT_NAME = #{unloadPointName}
+      </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="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="lineNodeId != null">
+        and LINE_NODE_ID = #{lineNodeId}
+      </if>
+      <if test="transRangeId != null">
+        and TRANS_RANGE_ID = #{transRangeId}
+      </if>
+      <if test="loadPointName != null and loadPointName != ''">
+        and LOAD_POINT_NAME LIKE '%${loadPointName}%'
+      </if>
+      <if test="unloadPointName != null and unloadPointName != ''">
+        and UNLOAD_POINT_NAME LIKE '%${unloadPointName}%'
+      </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="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from RMS_LINE_NODE_POINT
+    where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from RMS_LINE_NODE_POINT
+    where 1!=1 
+      <if test="transRangeId != null">
+        or TRANS_RANGE_ID = #{transRangeId}
+      </if>
+      <if test="loadPointName != null and loadPointName != ''">
+        or LOAD_POINT_NAME = #{loadPointName}
+      </if>
+      <if test="unloadPointName != null and unloadPointName != ''">
+        or UNLOAD_POINT_NAME = #{unloadPointName}
+      </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="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
+    insert into RMS_LINE_NODE_POINT (LINE_NODE_ID, TRANS_RANGE_ID, LOAD_POINT_NAME, 
+      UNLOAD_POINT_NAME, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED)
+    values (#{lineNodeId,jdbcType=DECIMAL}, #{transRangeId,jdbcType=DECIMAL}, #{loadPointName,jdbcType=VARCHAR}, 
+      #{unloadPointName,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
+      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{deleted,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
+    insert into RMS_LINE_NODE_POINT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="lineNodeId != null">
+        LINE_NODE_ID,
+      </if>
+      <if test="transRangeId != null">
+        TRANS_RANGE_ID,
+      </if>
+      <if test="loadPointName != null">
+        LOAD_POINT_NAME,
+      </if>
+      <if test="unloadPointName != null">
+        UNLOAD_POINT_NAME,
+      </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="deleted != null">
+        DELETED,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="lineNodeId != null">
+        #{lineNodeId,jdbcType=DECIMAL},
+      </if>
+      <if test="transRangeId != null">
+        #{transRangeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadPointName != null">
+        #{loadPointName,jdbcType=VARCHAR},
+      </if>
+      <if test="unloadPointName != null">
+        #{unloadPointName,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>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
+    update RMS_LINE_NODE_POINT
+    set TRANS_RANGE_ID = #{transRangeId,jdbcType=DECIMAL},
+      LOAD_POINT_NAME = #{loadPointName,jdbcType=VARCHAR},
+      UNLOAD_POINT_NAME = #{unloadPointName,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},
+      DELETED = #{deleted,jdbcType=DECIMAL}
+    where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsLineNodePoint">
+    update RMS_LINE_NODE_POINT
+    <set>
+      <if test="transRangeId != null">
+        TRANS_RANGE_ID = #{transRangeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadPointName != null">
+        LOAD_POINT_NAME = #{loadPointName,jdbcType=VARCHAR},
+      </if>
+      <if test="unloadPointName != null">
+        UNLOAD_POINT_NAME = #{unloadPointName,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>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where LINE_NODE_ID = #{lineNodeId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where LINE_NODE_ID = #{lineNodeId,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 RMS_LINE_NODE_POINT 
+      (LINE_NODE_ID, 
+      TRANS_RANGE_ID, LOAD_POINT_NAME, 
+      UNLOAD_POINT_NAME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.lineNodeId,jdbcType=DECIMAL}, 
+      #{item.transRangeId,jdbcType=DECIMAL}, #{item.loadPointName,jdbcType=VARCHAR}, 
+      #{item.unloadPointName,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.deleted,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update RMS_LINE_NODE_POINT
+     set
+       LINE_NODE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.lineNodeId,jdbcType=DECIMAL}
+       </foreach>
+       ,TRANS_RANGE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.transRangeId,jdbcType=DECIMAL}
+       </foreach>
+       ,LOAD_POINT_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.loadPointName,jdbcType=VARCHAR}
+       </foreach>
+       ,UNLOAD_POINT_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.unloadPointName,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_NODE_ID" separator=" ">
+          when #{item.lineNodeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+     where LINE_NODE_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.lineNodeId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from RMS_LINE_NODE_POINT
+    where LINE_NODE_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>

+ 732 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckLoadResultMapper.xml

@@ -0,0 +1,732 @@
+<?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.TmstruckLoadResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+    <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime" />
+    <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime" />
+    <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration" />
+    <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId" />
+    <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId" />
+    <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
+    <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
+    <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
+    <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_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage" />
+    <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="LOADING_SEQUENCE" jdbcType="DECIMAL" property="loadingSequence" />
+    <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
+    <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
+    <result column="CASE_NUMBER" jdbcType="VARCHAR" property="caseNumber" />
+    <result column="CASE_NUMBERTWO" jdbcType="VARCHAR" property="caseNumbertwo" />
+    <result column="CAPACITY_REMARK" jdbcType="VARCHAR" property="capacityRemark" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
+    LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
+    LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE, ISDEDUCT, SEGMENT_SQE, CASE_NUMBER, CASE_NUMBERTWO,
+    CAPACITY_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME,
+    t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
+    t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
+    t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID,
+    t.LOADING_SEQUENCE, t.ISDEDUCT, t.SEGMENT_SQE, t.CASE_NUMBER, t.CASE_NUMBERTWO, t.CAPACITY_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRUCK_LOAD_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRUCK_LOAD_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="resultLoadStartTime != null">
+        and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
+      </if>
+      <if test="resultLoadEndTime != null">
+        and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
+      </if>
+      <if test="resultLoadDuration != null">
+        and RESULT_LOAD_DURATION = #{resultLoadDuration}
+      </if>
+      <if test="loadStandardTimeId != null">
+        and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+      </if>
+      <if test="loaderId != null">
+        and LOADER_ID = #{loaderId}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR = #{resultIsclear}
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME = #{deleteName}
+      </if>
+      <if test="deleteTime != null">
+        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+      </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="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+      </if>
+      <if test="loadingId != null">
+        and LOADING_ID = #{loadingId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="loadingSequence != null">
+        and LOADING_SEQUENCE = #{loadingSequence}
+      </if>
+      <if test="isdeduct != null">
+        and ISDEDUCT = #{isdeduct}
+      </if>
+      <if test="segmentSqe != null">
+        and SEGMENT_SQE = #{segmentSqe}
+      </if>
+      <if test="caseNumber != null and caseNumber != ''">
+        and CASE_NUMBER = #{caseNumber}
+      </if>
+      <if test="caseNumbertwo != null and caseNumbertwo != ''">
+        and CASE_NUMBERTWO = #{caseNumbertwo}
+      </if>
+      <if test="capacityRemark != null and capacityRemark != ''">
+        and CAPACITY_REMARK = #{capacityRemark}
+      </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="resultLoadStartTime != null">
+        and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
+      </if>
+      <if test="resultLoadEndTime != null">
+        and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
+      </if>
+      <if test="resultLoadDuration != null">
+        and RESULT_LOAD_DURATION = #{resultLoadDuration}
+      </if>
+      <if test="loadStandardTimeId != null">
+        and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+      </if>
+      <if test="loaderId != null">
+        and LOADER_ID = #{loaderId}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
+      </if>
+      <if test="deleteName != null and deleteName != ''">
+        and DELETE_NAME LIKE '%${deleteName}%'
+      </if>
+      <if test="deleteTime != null">
+        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+      </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="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+      </if>
+      <if test="loadingId != null">
+        and LOADING_ID = #{loadingId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="loadingSequence != null">
+        and LOADING_SEQUENCE = #{loadingSequence}
+      </if>
+      <if test="isdeduct != null">
+        and ISDEDUCT = #{isdeduct}
+      </if>
+      <if test="segmentSqe != null">
+        and SEGMENT_SQE = #{segmentSqe}
+      </if>
+      <if test="caseNumber != null and caseNumber != ''">
+        and CASE_NUMBER LIKE '%${caseNumber}%'
+      </if>
+      <if test="caseNumbertwo != null and caseNumbertwo != ''">
+        and CASE_NUMBERTWO LIKE '%${caseNumbertwo}%'
+      </if>
+      <if test="capacityRemark != null and capacityRemark != ''">
+        and CAPACITY_REMARK LIKE '%${capacityRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from TMSTRUCK_LOAD_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRUCK_LOAD_RESULT
+    where 1!=1
+    <if test="resultTotalId != null">
+      or RESULT_TOTAL_ID = #{resultTotalId}
+    </if>
+    <if test="resultLoadStartTime != null">
+      or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
+    </if>
+    <if test="resultLoadEndTime != null">
+      or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
+    </if>
+    <if test="resultLoadDuration != null">
+      or RESULT_LOAD_DURATION = #{resultLoadDuration}
+    </if>
+    <if test="loadStandardTimeId != null">
+      or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
+    </if>
+    <if test="loaderId != null">
+      or LOADER_ID = #{loaderId}
+    </if>
+    <if test="resultIsclear != null and resultIsclear != ''">
+      or RESULT_ISCLEAR = #{resultIsclear}
+    </if>
+    <if test="deleteName != null and deleteName != ''">
+      or DELETE_NAME = #{deleteName}
+    </if>
+    <if test="deleteTime != null">
+      or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
+    </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="resultMeasuredTonnage != null">
+      or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
+    </if>
+    <if test="loadingId != null">
+      or LOADING_ID = #{loadingId}
+    </if>
+    <if test="materialId != null">
+      or MATERIAL_ID = #{materialId}
+    </if>
+    <if test="loadingSequence != null">
+      or LOADING_SEQUENCE = #{loadingSequence}
+    </if>
+    <if test="isdeduct != null">
+      or ISDEDUCT = #{isdeduct}
+    </if>
+    <if test="segmentSqe != null">
+      or SEGMENT_SQE = #{segmentSqe}
+    </if>
+    <if test="caseNumber != null and caseNumber != ''">
+      or CASE_NUMBER = #{caseNumber}
+    </if>
+    <if test="caseNumbertwo != null and caseNumbertwo != ''">
+      or CASE_NUMBERTWO = #{caseNumbertwo}
+    </if>
+    <if test="capacityRemark != null and capacityRemark != ''">
+      or CAPACITY_REMARK = #{capacityRemark}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
+                                      RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
+                                      LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR,
+                                      DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
+                                      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                      INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
+                                      LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE,
+                                      ISDEDUCT, SEGMENT_SQE, CASE_NUMBER,
+                                      CASE_NUMBERTWO, CAPACITY_REMARK)
+    values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultLoadStartTime,jdbcType=TIMESTAMP},
+            #{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL},
+            #{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR},
+            #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
+            #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+            #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{resultMeasuredTonnage,jdbcType=DECIMAL},
+            #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{loadingSequence,jdbcType=DECIMAL},
+            #{isdeduct,jdbcType=DECIMAL}, #{segmentSqe,jdbcType=DECIMAL}, #{caseNumber,jdbcType=VARCHAR},
+            #{caseNumbertwo,jdbcType=VARCHAR}, #{capacityRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    insert into TMSTRUCK_LOAD_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID,
+      </if>
+      <if test="resultLoadStartTime != null">
+        RESULT_LOAD_START_TIME,
+      </if>
+      <if test="resultLoadEndTime != null">
+        RESULT_LOAD_END_TIME,
+      </if>
+      <if test="resultLoadDuration != null">
+        RESULT_LOAD_DURATION,
+      </if>
+      <if test="loadStandardTimeId != null">
+        LOAD_STANDARD_TIME_ID,
+      </if>
+      <if test="loaderId != null">
+        LOADER_ID,
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR,
+      </if>
+      <if test="deleteName != null">
+        DELETE_NAME,
+      </if>
+      <if test="deleteTime != null">
+        DELETE_TIME,
+      </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="status != null">
+        STATUS,
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        RESULT_MEASURED_TONNAGE,
+      </if>
+      <if test="loadingId != null">
+        LOADING_ID,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="loadingSequence != null">
+        LOADING_SEQUENCE,
+      </if>
+      <if test="isdeduct != null">
+        ISDEDUCT,
+      </if>
+      <if test="segmentSqe != null">
+        SEGMENT_SQE,
+      </if>
+      <if test="caseNumber != null">
+        CASE_NUMBER,
+      </if>
+      <if test="caseNumbertwo != null">
+        CASE_NUMBERTWO,
+      </if>
+      <if test="capacityRemark != null">
+        CAPACITY_REMARK,
+      </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="resultLoadStartTime != null">
+        #{resultLoadStartTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadEndTime != null">
+        #{resultLoadEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadDuration != null">
+        #{resultLoadDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="loadStandardTimeId != null">
+        #{loadStandardTimeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loaderId != null">
+        #{loaderId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultIsclear != null">
+        #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        #{deleteTime,jdbcType=TIMESTAMP},
+      </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="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        #{resultMeasuredTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingId != null">
+        #{loadingId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingSequence != null">
+        #{loadingSequence,jdbcType=DECIMAL},
+      </if>
+      <if test="isdeduct != null">
+        #{isdeduct,jdbcType=DECIMAL},
+      </if>
+      <if test="segmentSqe != null">
+        #{segmentSqe,jdbcType=DECIMAL},
+      </if>
+      <if test="caseNumber != null">
+        #{caseNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="caseNumbertwo != null">
+        #{caseNumbertwo,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityRemark != null">
+        #{capacityRemark,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    update TMSTRUCK_LOAD_RESULT
+    set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+        RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
+        RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
+        RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
+        LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
+        LOADER_ID = #{loaderId,jdbcType=DECIMAL},
+        RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+        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_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
+        LOADING_ID = #{loadingId,jdbcType=DECIMAL},
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+        LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
+        ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+        SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
+        CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR},
+        CASE_NUMBERTWO = #{caseNumbertwo,jdbcType=VARCHAR},
+        CAPACITY_REMARK = #{capacityRemark,jdbcType=VARCHAR}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
+    update TMSTRUCK_LOAD_RESULT
+    <set>
+      <if test="resultTotalId != null">
+        RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultLoadStartTime != null">
+        RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadEndTime != null">
+        RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultLoadDuration != null">
+        RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="loadStandardTimeId != null">
+        LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
+      </if>
+      <if test="loaderId != null">
+        LOADER_ID = #{loaderId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteName != null">
+        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteTime != null">
+        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+      </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="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultMeasuredTonnage != null">
+        RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingId != null">
+        LOADING_ID = #{loadingId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="loadingSequence != null">
+        LOADING_SEQUENCE = #{loadingSequence,jdbcType=DECIMAL},
+      </if>
+      <if test="isdeduct != null">
+        ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+      </if>
+      <if test="segmentSqe != null">
+        SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
+      </if>
+      <if test="caseNumber != null">
+        CASE_NUMBER = #{caseNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="caseNumbertwo != null">
+        CASE_NUMBERTWO = #{caseNumbertwo,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityRemark != null">
+        CAPACITY_REMARK = #{capacityRemark,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" 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_LOAD_RESULT
+    (RESULT_ID,
+    RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
+    RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
+    LOAD_STANDARD_TIME_ID, LOADER_ID,
+    RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
+    INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
+    LOADING_ID, MATERIAL_ID, LOADING_SEQUENCE,
+    ISDEDUCT, SEGMENT_SQE, CASE_NUMBER,
+    CASE_NUMBERTWO, CAPACITY_REMARK
+    )
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP},
+    #{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL},
+    #{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
+    #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP},
+    #{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.resultMeasuredTonnage,jdbcType=DECIMAL},
+    #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.loadingSequence,jdbcType=DECIMAL},
+    #{item.isdeduct,jdbcType=DECIMAL}, #{item.segmentSqe,jdbcType=DECIMAL}, #{item.caseNumber,jdbcType=VARCHAR},
+    #{item.caseNumbertwo,jdbcType=VARCHAR}, #{item.capacityRemark,jdbcType=VARCHAR}
+    from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update TMSTRUCK_LOAD_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_LOAD_START_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,RESULT_LOAD_END_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,RESULT_LOAD_DURATION=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
+    </foreach>
+    ,LOAD_STANDARD_TIME_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
+    </foreach>
+    ,LOADER_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_ISCLEAR=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETE_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
+    </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>
+    ,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>
+    ,RESULT_MEASURED_TONNAGE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
+    </foreach>
+    ,LOADING_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
+    </foreach>
+    ,MATERIAL_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+    </foreach>
+    ,LOADING_SEQUENCE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingSequence,jdbcType=DECIMAL}
+    </foreach>
+    ,ISDEDUCT=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
+    </foreach>
+    ,SEGMENT_SQE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.segmentSqe,jdbcType=DECIMAL}
+    </foreach>
+    ,CASE_NUMBER=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.caseNumber,jdbcType=VARCHAR}
+    </foreach>
+    ,CASE_NUMBERTWO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.caseNumbertwo,jdbcType=VARCHAR}
+    </foreach>
+    ,CAPACITY_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityRemark,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_LOAD_RESULT
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+</mapper>

+ 660 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckWeightResultMapper.xml

@@ -0,0 +1,660 @@
+<?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.TmstruckWeightResultMapper">
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
+        <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
+        <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
+        <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
+        <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
+        <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
+        <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
+        <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
+        <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
+        <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="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
+        <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
+        <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
+        <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
+        <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+        <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
+        <result column="ISQUALITY" jdbcType="DECIMAL" property="isquality" />
+        <result column="GROSS_SEGMENT_SQE" jdbcType="DECIMAL" property="grossSegmentSqe" />
+        <result column="TARE_SEGMENT_SQE" jdbcType="DECIMAL" property="tareSegmentSqe" />
+    </resultMap>
+    <sql id="columns">
+        WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME, 
+    RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME, 
+    RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE, 
+    TARE_SEGMENT_SQE
+    </sql>
+    <sql id="columns_alias">
+        t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT, 
+    t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
+    t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID, 
+    t.ISDEDUCT, t.ISQUALITY, t.GROSS_SEGMENT_SQE, t.TARE_SEGMENT_SQE
+    </sql>
+    <sql id="select">
+        SELECT <include refid="columns"/> FROM TMSTRUCK_WEIGHT_RESULT
+    </sql>
+    <sql id="select_alias">
+        SELECT <include refid="columns_alias"/> FROM TMSTRUCK_WEIGHT_RESULT t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="weightTaskResultId != null">
+                and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="resultPoundNo != null and resultPoundNo != ''">
+                and RESULT_POUND_NO = #{resultPoundNo}
+            </if>
+            <if test="resultGrossWeight != null">
+                and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
+            </if>
+            <if test="resultTareWeight != null">
+                and RESULT_TARE_WEIGHT = #{resultTareWeight}
+            </if>
+            <if test="resultTareWeightTime != null">
+                and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
+            </if>
+            <if test="resultNetWeight != null">
+                and RESULT_NET_WEIGHT = #{resultNetWeight}
+            </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="deleteName != null and deleteName != ''">
+                and DELETE_NAME = #{deleteName}
+            </if>
+            <if test="deleteTime != null">
+                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+            </if>
+            <if test="resultGrossPlaceId != null">
+                and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+            </if>
+            <if test="resultTarePlaceId != null">
+                and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+            </if>
+            <if test="materialId != null">
+                and MATERIAL_ID = #{materialId}
+            </if>
+            <if test="isdeduct != null">
+                and ISDEDUCT = #{isdeduct}
+            </if>
+            <if test="isquality != null">
+                and ISQUALITY = #{isquality}
+            </if>
+            <if test="grossSegmentSqe != null">
+                and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
+            </if>
+            <if test="tareSegmentSqe != null">
+                and TARE_SEGMENT_SQE = #{tareSegmentSqe}
+            </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="weightTaskResultId != null">
+                and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
+            </if>
+            <if test="resultTotalId != null">
+                and RESULT_TOTAL_ID = #{resultTotalId}
+            </if>
+            <if test="resultPoundNo != null and resultPoundNo != ''">
+                and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
+            </if>
+            <if test="resultGrossWeight != null">
+                and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+            </if>
+            <if test="resultGrossWeightTime != null">
+                and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
+            </if>
+            <if test="resultTareWeight != null">
+                and RESULT_TARE_WEIGHT = #{resultTareWeight}
+            </if>
+            <if test="resultTareWeightTime != null">
+                and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
+            </if>
+            <if test="resultNetWeight != null">
+                and RESULT_NET_WEIGHT = #{resultNetWeight}
+            </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="deleteName != null and deleteName != ''">
+                and DELETE_NAME LIKE '%${deleteName}%'
+            </if>
+            <if test="deleteTime != null">
+                and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
+            </if>
+            <if test="resultGrossPlaceId != null">
+                and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+            </if>
+            <if test="resultTarePlaceId != null">
+                and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+            </if>
+            <if test="materialId != null">
+                and MATERIAL_ID = #{materialId}
+            </if>
+            <if test="isdeduct != null">
+                and ISDEDUCT = #{isdeduct}
+            </if>
+            <if test="isquality != null">
+                and ISQUALITY = #{isquality}
+            </if>
+            <if test="grossSegmentSqe != null">
+                and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
+            </if>
+            <if test="tareSegmentSqe != null">
+                and TARE_SEGMENT_SQE = #{tareSegmentSqe}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+        delete from TMSTRUCK_WEIGHT_RESULT
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from TMSTRUCK_WEIGHT_RESULT
+        where 1!=1
+        <if test="resultTotalId != null">
+            or RESULT_TOTAL_ID = #{resultTotalId}
+        </if>
+        <if test="resultPoundNo != null and resultPoundNo != ''">
+            or RESULT_POUND_NO = #{resultPoundNo}
+        </if>
+        <if test="resultGrossWeight != null">
+            or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
+        </if>
+        <if test="resultGrossWeightTime != null">
+            or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
+        </if>
+        <if test="resultTareWeight != null">
+            or RESULT_TARE_WEIGHT = #{resultTareWeight}
+        </if>
+        <if test="resultTareWeightTime != null">
+            or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
+        </if>
+        <if test="resultNetWeight != null">
+            or RESULT_NET_WEIGHT = #{resultNetWeight}
+        </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="deleteName != null and deleteName != ''">
+            or DELETE_NAME = #{deleteName}
+        </if>
+        <if test="deleteTime != null">
+            or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
+        </if>
+        <if test="resultGrossPlaceId != null">
+            or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
+        </if>
+        <if test="resultTarePlaceId != null">
+            or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
+        </if>
+        <if test="materialId != null">
+            or MATERIAL_ID = #{materialId}
+        </if>
+        <if test="isdeduct != null">
+            or ISDEDUCT = #{isdeduct}
+        </if>
+        <if test="isquality != null">
+            or ISQUALITY = #{isquality}
+        </if>
+        <if test="grossSegmentSqe != null">
+            or GROSS_SEGMENT_SQE = #{grossSegmentSqe}
+        </if>
+        <if test="tareSegmentSqe != null">
+            or TARE_SEGMENT_SQE = #{tareSegmentSqe}
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
+                                            RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
+                                            RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
+                                            RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
+                                            UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                                            DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
+                                            RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
+                                            ISQUALITY, GROSS_SEGMENT_SQE, TARE_SEGMENT_SQE
+        )
+        values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
+                #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+                #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
+                #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+                #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+                #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
+                #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
+                #{isquality,jdbcType=DECIMAL}, #{grossSegmentSqe,jdbcType=DECIMAL}, #{tareSegmentSqe,jdbcType=DECIMAL}
+               )
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        insert into TMSTRUCK_WEIGHT_RESULT
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="weightTaskResultId != null">
+                WEIGHT_TASK_RESULT_ID,
+            </if>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID,
+            </if>
+            <if test="resultPoundNo != null">
+                RESULT_POUND_NO,
+            </if>
+            <if test="resultGrossWeight != null">
+                RESULT_GROSS_WEIGHT,
+            </if>
+            <if test="resultGrossWeightTime != null">
+                RESULT_GROSS_WEIGHT_TIME,
+            </if>
+            <if test="resultTareWeight != null">
+                RESULT_TARE_WEIGHT,
+            </if>
+            <if test="resultTareWeightTime != null">
+                RESULT_TARE_WEIGHT_TIME,
+            </if>
+            <if test="resultNetWeight != null">
+                RESULT_NET_WEIGHT,
+            </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="deleteName != null">
+                DELETE_NAME,
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME,
+            </if>
+            <if test="resultGrossPlaceId != null">
+                RESULT_GROSS_PLACE_ID,
+            </if>
+            <if test="resultTarePlaceId != null">
+                RESULT_TARE_PLACE_ID,
+            </if>
+            <if test="materialId != null">
+                MATERIAL_ID,
+            </if>
+            <if test="isdeduct != null">
+                ISDEDUCT,
+            </if>
+            <if test="isquality != null">
+                ISQUALITY,
+            </if>
+            <if test="grossSegmentSqe != null">
+                GROSS_SEGMENT_SQE,
+            </if>
+            <if test="tareSegmentSqe != null">
+                TARE_SEGMENT_SQE,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="weightTaskResultId != null">
+                #{weightTaskResultId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTotalId != null">
+                #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultPoundNo != null">
+                #{resultPoundNo,jdbcType=VARCHAR},
+            </if>
+            <if test="resultGrossWeight != null">
+                #{resultGrossWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultGrossWeightTime != null">
+                #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultTareWeight != null">
+                #{resultTareWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTareWeightTime != null">
+                #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultNetWeight != null">
+                #{resultNetWeight,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="deleteName != null">
+                #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                #{deleteTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultGrossPlaceId != null">
+                #{resultGrossPlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTarePlaceId != null">
+                #{resultTarePlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="materialId != null">
+                #{materialId,jdbcType=DECIMAL},
+            </if>
+            <if test="isdeduct != null">
+                #{isdeduct,jdbcType=DECIMAL},
+            </if>
+            <if test="isquality != null">
+                #{isquality,jdbcType=DECIMAL},
+            </if>
+            <if test="grossSegmentSqe != null">
+                #{grossSegmentSqe,jdbcType=DECIMAL},
+            </if>
+            <if test="tareSegmentSqe != null">
+                #{tareSegmentSqe,jdbcType=DECIMAL},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        update TMSTRUCK_WEIGHT_RESULT
+        set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+            RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
+            RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
+            RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
+            RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            RESULT_NET_WEIGHT = #{resultNetWeight,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},
+            DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+            DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+            RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
+            RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
+            MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+            ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+            ISQUALITY = #{isquality,jdbcType=DECIMAL},
+            GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
+            TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL}
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
+        update TMSTRUCK_WEIGHT_RESULT
+        <set>
+            <if test="resultTotalId != null">
+                RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultPoundNo != null">
+                RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
+            </if>
+            <if test="resultGrossWeight != null">
+                RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultGrossWeightTime != null">
+                RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultTareWeight != null">
+                RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTareWeightTime != null">
+                RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultNetWeight != null">
+                RESULT_NET_WEIGHT = #{resultNetWeight,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="deleteName != null">
+                DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="resultGrossPlaceId != null">
+                RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="resultTarePlaceId != null">
+                RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
+            </if>
+            <if test="materialId != null">
+                MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+            </if>
+            <if test="isdeduct != null">
+                ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
+            </if>
+            <if test="isquality != null">
+                ISQUALITY = #{isquality,jdbcType=DECIMAL},
+            </if>
+            <if test="grossSegmentSqe != null">
+                GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
+            </if>
+            <if test="tareSegmentSqe != null">
+                TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
+            </if>
+        </set>
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,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_WEIGHT_RESULT
+        (WEIGHT_TASK_RESULT_ID,
+        RESULT_TOTAL_ID, RESULT_POUND_NO,
+        RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
+        RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
+        RESULT_NET_WEIGHT, INSERT_USERNAME,
+        INSERT_TIME, UPDATE_USERNAME,
+        UPDATE_TIME, INSERT_UPDATE_REMARK,
+        DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
+        RESULT_TARE_PLACE_ID, MATERIAL_ID,
+        ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
+        TARE_SEGMENT_SQE)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.weightTaskResultId,jdbcType=DECIMAL},
+        #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
+        #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
+        #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
+        #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
+        #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+        #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+        #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
+        #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
+        #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL}, #{item.grossSegmentSqe,jdbcType=DECIMAL},
+        #{item.tareSegmentSqe,jdbcType=DECIMAL} from dual
+    </foreach> )
+    </insert>
+
+    <update id="batchUpdate" parameterType="java.util.List">
+        update TMSTRUCK_WEIGHT_RESULT
+        set
+        WEIGHT_TASK_RESULT_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
+        </foreach>
+        ,RESULT_TOTAL_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
+        </foreach>
+        ,RESULT_POUND_NO=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
+        </foreach>
+        ,RESULT_GROSS_WEIGHT=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
+        </foreach>
+        ,RESULT_GROSS_WEIGHT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,RESULT_TARE_WEIGHT=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
+        </foreach>
+        ,RESULT_TARE_WEIGHT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,RESULT_NET_WEIGHT=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
+        </foreach>
+        ,INSERT_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,INSERT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,INSERT_UPDATE_REMARK=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+        </foreach>
+        ,DELETE_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
+        </foreach>
+        ,DELETE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,RESULT_GROSS_PLACE_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
+        </foreach>
+        ,RESULT_TARE_PLACE_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
+        </foreach>
+        ,MATERIAL_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+        </foreach>
+        ,ISDEDUCT=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
+        </foreach>
+        ,ISQUALITY=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
+        </foreach>
+        ,GROSS_SEGMENT_SQE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.grossSegmentSqe,jdbcType=DECIMAL}
+        </foreach>
+        ,TARE_SEGMENT_SQE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
+            when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.tareSegmentSqe,jdbcType=DECIMAL}
+        </foreach>
+        where WEIGHT_TASK_RESULT_ID in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.weightTaskResultId,jdbcType=DECIMAL}
+        </foreach>
+    </update>
+
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from TMSTRUCK_WEIGHT_RESULT
+        where WEIGHT_TASK_RESULT_ID in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+</mapper>

+ 395 - 0
src/main/resources/com/steerinfo/dil/mapper/WmspOutboundResultMaterialMapper.xml

@@ -0,0 +1,395 @@
+<?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.WmspOutboundResultMaterialMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.WmspOutboundResultMaterial">
+    <id column="RESULT_MATERIAL_ID" jdbcType="DECIMAL" property="resultMaterialId" />
+    <result column="OUTBOUND_RESULT_ID" jdbcType="DECIMAL" property="outboundResultId" />
+    <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="DELETED" jdbcType="DECIMAL" property="deleted" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="MATERIAL_NUMBER" jdbcType="DECIMAL" property="materialNumber" />
+    <result column="MATERIAL_WEIGHT" jdbcType="DECIMAL" property="materialWeight" />
+    <result column="STATUS" jdbcType="DECIMAL" property="status" />
+    
+  </resultMap>
+  <sql id="columns">
+    RESULT_MATERIAL_ID, OUTBOUND_RESULT_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, MATERIAL_ID,MATERIAL_NUMBER,MATERIAL_WEIGHT,STATUS
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_MATERIAL_ID, t.OUTBOUND_RESULT_ID, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, 
+    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.MATERIAL_ID,t.MATERIAL_NUMBER,t.MATERIAL_WEIGHT,t.STATUS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM WMSP_OUTBOUND_RESULT_MATERIAL
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM WMSP_OUTBOUND_RESULT_MATERIAL t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultMaterialId != null">
+        and RESULT_MATERIAL_ID = #{resultMaterialId}
+      </if>
+      <if test="outboundResultId != null">
+        and OUTBOUND_RESULT_ID = #{outboundResultId}
+      </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="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="materialNumber != null">
+        and MATERIAL_NUMBER = #{materialNumber}
+      </if>
+      
+      <if test="materialWeight != null">
+        and MATERIAL_WEIGHT = #{materialWeight}
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultMaterialId != null">
+        and RESULT_MATERIAL_ID = #{resultMaterialId}
+      </if>
+      <if test="outboundResultId != null">
+        and OUTBOUND_RESULT_ID = #{outboundResultId}
+      </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="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="materialNumber != null">
+        and MATERIAL_NUMBER = #{materialNumber}
+      </if>
+      
+      <if test="materialWeight != null">
+        and MATERIAL_WEIGHT = #{materialWeight}
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from WMSP_OUTBOUND_RESULT_MATERIAL
+    where RESULT_MATERIAL_ID = #{resultMaterialId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from WMSP_OUTBOUND_RESULT_MATERIAL
+    where 1!=1 
+      <if test="outboundResultId != null">
+        or OUTBOUND_RESULT_ID = #{outboundResultId}
+      </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="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+      <if test="materialId != null">
+        or MATERIAL_ID = #{materialId}
+      </if>
+      <if test="materialNumber != null">
+        or MATERIAL_NUMBER = #{materialNumber}
+      </if>
+      <if test="materialWeight != null">
+        or MATERIAL_WEIGHT = #{materialWeight}
+      </if>
+    <if test="status != null">
+      or STATUS = #{status}
+    </if>
+    
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.WmspOutboundResultMaterial">
+    insert into WMSP_OUTBOUND_RESULT_MATERIAL (RESULT_MATERIAL_ID, OUTBOUND_RESULT_ID, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, 
+      MATERIAL_ID,MATERIAL_NUMBER,MATERIAL_WEIGHT,STATUS)
+    values (#{resultMaterialId,jdbcType=DECIMAL}, #{outboundResultId,jdbcType=DECIMAL}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
+      #{materialId,jdbcType=DECIMAL},#{materialNumber,jdbcType=DECIMAL},#{materialWeight,jdbcType=DECIMAL},#{status,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.WmspOutboundResultMaterial">
+    insert into WMSP_OUTBOUND_RESULT_MATERIAL
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultMaterialId != null">
+        RESULT_MATERIAL_ID,
+      </if>
+      <if test="outboundResultId != null">
+        OUTBOUND_RESULT_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="deleted != null">
+        DELETED,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="materialNumber != null">
+        MATERIAL_NUMBER,
+      </if>
+      <if test="materialWeight != null">
+        MATERIAL_WEIGHT,
+      </if>
+      <if test="status != null">
+        STATUS,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultMaterialId != null">
+        #{resultMaterialId,jdbcType=DECIMAL},
+      </if>
+      <if test="outboundResultId != null">
+        #{outboundResultId,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="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="materialNumber != null">
+        #{materialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="materialWeight != null">
+        #{materialWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.WmspOutboundResultMaterial">
+    update WMSP_OUTBOUND_RESULT_MATERIAL
+    set OUTBOUND_RESULT_ID = #{outboundResultId,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},
+      DELETED = #{deleted,jdbcType=DECIMAL},
+      MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
+      MATERIAL_WEIGHT = #{materialWeight,jdbcType=DECIMAL},
+      STATUS= #{status,jdbcType=DECIMAL}
+    where RESULT_MATERIAL_ID = #{resultMaterialId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.WmspOutboundResultMaterial">
+    update WMSP_OUTBOUND_RESULT_MATERIAL
+    <set>
+      <if test="outboundResultId != null">
+        OUTBOUND_RESULT_ID = #{outboundResultId,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="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialNumber != null">
+        MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="materialWeight != null">
+        MATERIAL_WEIGHT = #{materialWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_MATERIAL_ID = #{resultMaterialId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_MATERIAL_ID = #{resultMaterialId,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 WMSP_OUTBOUND_RESULT_MATERIAL 
+      (RESULT_MATERIAL_ID, 
+      OUTBOUND_RESULT_ID, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED, MATERIAL_ID,MATERIAL_NUMBER,MATERIAL_WEIGHT,STATUS)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultMaterialId,jdbcType=DECIMAL}, 
+      #{item.outboundResultId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+      #{item.deleted,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL} , #{item.materialNumber,jdbcType=DECIMAL} , #{item.materialWeight,jdbcType=DECIMAL} from dual
+   </foreach> )
+  </insert>
+  
+  <update id="batchUpdate" parameterType="java.util.List">
+     update WMSP_OUTBOUND_RESULT_MATERIAL
+     set
+       RESULT_MATERIAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.resultMaterialId,jdbcType=DECIMAL}
+       </foreach>
+       ,OUTBOUND_RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.outboundResultId,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+       ,MATERIAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+          when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+       </foreach>
+      ,MATERIAL_NUMBER=
+      <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+        when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.materialNumber,jdbcType=DECIMAL}
+      </foreach>
+      ,MATERIAL_WEIGHT=
+      <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+        when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.materialWeight,jdbcType=DECIMAL}
+      </foreach>
+    ,STATUS=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_MATERIAL_ID" separator=" ">
+      when #{item.resultMaterialId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+    </foreach>
+    where RESULT_MATERIAL_ID in
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.resultMaterialId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from WMSP_OUTBOUND_RESULT_MATERIAL
+    where RESULT_MATERIAL_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+</mapper>