txf %!s(int64=3) %!d(string=hai) anos
pai
achega
d05c2c85cd
Modificáronse 53 ficheiros con 9336 adicións e 3 borrados
  1. 3 3
      pom.xml
  2. 78 0
      src/main/java/com/steerinfo/dil/controller/AmsRailOffsetDayplanController.java
  3. 411 0
      src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java
  4. 136 0
      src/main/java/com/steerinfo/dil/controller/AmsSaleOrderMaterialController.java
  5. 150 0
      src/main/java/com/steerinfo/dil/controller/AmsSalePlanController.java
  6. 97 0
      src/main/java/com/steerinfo/dil/controller/AmstruckInwardPlanController.java
  7. 96 0
      src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java
  8. 138 0
      src/main/java/com/steerinfo/dil/controller/AmstruckRailDayplanController.java
  9. 20 0
      src/main/java/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.java
  10. 26 0
      src/main/java/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.java
  11. 40 0
      src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMapper.java
  12. 24 0
      src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMaterialMapper.java
  13. 23 0
      src/main/java/com/steerinfo/dil/mapper/AmsSalePlanMapper.java
  14. 18 0
      src/main/java/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.java
  15. 19 0
      src/main/java/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.java
  16. 33 0
      src/main/java/com/steerinfo/dil/mapper/AmstruckRailDayplanMapper.java
  17. 14 0
      src/main/java/com/steerinfo/dil/mapper/AmstruckRequirementPlanMapper.java
  18. 214 0
      src/main/java/com/steerinfo/dil/model/AmsDispatchSaleOrder.java
  19. 331 0
      src/main/java/com/steerinfo/dil/model/AmsRailOffsetDayplan.java
  20. 334 0
      src/main/java/com/steerinfo/dil/model/AmsSaleOrder.java
  21. 289 0
      src/main/java/com/steerinfo/dil/model/AmsSaleOrderMaterial.java
  22. 199 0
      src/main/java/com/steerinfo/dil/model/AmsSalePlan.java
  23. 199 0
      src/main/java/com/steerinfo/dil/model/AmstruckInwardPlan.java
  24. 334 0
      src/main/java/com/steerinfo/dil/model/AmstruckInwardRequirement.java
  25. 274 0
      src/main/java/com/steerinfo/dil/model/AmstruckRailDayplan.java
  26. 154 0
      src/main/java/com/steerinfo/dil/model/AmstruckRequirementPlan.java
  27. 32 0
      src/main/java/com/steerinfo/dil/service/IAmsDispatchSaleOrderService.java
  28. 37 0
      src/main/java/com/steerinfo/dil/service/IAmsRailOffsetDayplanService.java
  29. 40 0
      src/main/java/com/steerinfo/dil/service/IAmsSaleOrderMaterialService.java
  30. 53 0
      src/main/java/com/steerinfo/dil/service/IAmsSaleOrderService.java
  31. 37 0
      src/main/java/com/steerinfo/dil/service/IAmsSalePlanService.java
  32. 28 0
      src/main/java/com/steerinfo/dil/service/IAmstruckInwardPlanService.java
  33. 28 0
      src/main/java/com/steerinfo/dil/service/IAmstruckInwardRequirementService.java
  34. 38 0
      src/main/java/com/steerinfo/dil/service/IAmstruckRailDayplanService.java
  35. 24 0
      src/main/java/com/steerinfo/dil/service/IAmstruckRequirementPlanService.java
  36. 60 0
      src/main/java/com/steerinfo/dil/service/impl/AmsDispatchSaleOrderServiceImpl.java
  37. 67 0
      src/main/java/com/steerinfo/dil/service/impl/AmsRailOffsetDayplanServiceImpl.java
  38. 110 0
      src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderMaterialServiceImpl.java
  39. 170 0
      src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java
  40. 81 0
      src/main/java/com/steerinfo/dil/service/impl/AmsSalePlanServiceImpl.java
  41. 84 0
      src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardPlanServiceImpl.java
  42. 60 0
      src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java
  43. 74 0
      src/main/java/com/steerinfo/dil/service/impl/AmstruckRailDayplanServiceImpl.java
  44. 48 0
      src/main/java/com/steerinfo/dil/service/impl/AmstruckRequirementPlanServiceImpl.java
  45. 357 0
      src/main/resources/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.xml
  46. 181 0
      src/main/resources/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.xml
  47. 1189 0
      src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml
  48. 579 0
      src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMaterialMapper.xml
  49. 474 0
      src/main/resources/com/steerinfo/dil/mapper/AmsSalePlanMapper.xml
  50. 394 0
      src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.xml
  51. 627 0
      src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml
  52. 518 0
      src/main/resources/com/steerinfo/dil/mapper/AmstruckRailDayplanMapper.xml
  53. 292 0
      src/main/resources/com/steerinfo/dil/mapper/AmstruckRequirementPlanMapper.xml

+ 3 - 3
pom.xml

@@ -111,9 +111,9 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<!--                        <param>AMS_PURCHASE_ORDER</param>&lt;!&ndash;采购订单&ndash;&gt;-->
-<!--                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;运费&ndash;&gt;-->
-<!--                        <param>AMS_CONTRACT_BREACH</param>&lt;!&ndash;违约规则&ndash;&gt;-->
+                        <param>AMS_DISPATCH_SALE_ORDER</param><!--采购订单-->
+                        <param>AMS_SALE_ORDER</param><!--运费-->
+                        <param>AMS_SALE_ORDER_MATERIAL</param><!--违约规则-->
                     </tables>
                 </configuration>
                 <executions>

+ 78 - 0
src/main/java/com/steerinfo/dil/controller/AmsRailOffsetDayplanController.java

@@ -0,0 +1,78 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.model.AmsRailOffsetDayplan;
+import com.steerinfo.dil.service.impl.AmsRailOffsetDayplanServiceImpl;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/${api.version}/amsrailoffsetdayplan")
+public class AmsRailOffsetDayplanController extends BaseRESTfulController {
+    @Autowired
+    AmsRailOffsetDayplanServiceImpl amsRailOffsetDayplanService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    /**
+     *新增钢材发往异地库计划
+     */
+    @PostMapping("/addRailOffsetDayplan")
+    public RESTfulResult addRailOffsetDayplan(@RequestBody AmsRailOffsetDayplan amsRailOffsetDayplan) {
+        if(amsRailOffsetDayplan==null){
+            return failed();
+        }
+        amsRailOffsetDayplanService.insert(amsRailOffsetDayplan);
+        return success();
+    }
+    /**
+     * 删除钢材发往异地库计划
+     */
+    @PostMapping("/deleteRailOffsetDayplan/{dayPlanId}")
+    public RESTfulResult deleteTruckRailDayPlan(@PathVariable("dayPlanId") BigDecimal dayPlanId) {
+        amsRailOffsetDayplanService.delete(dayPlanId);
+        return success("删除成功");
+    }
+    /**
+     * 修改钢材发往异地库计划
+     */
+    @PostMapping("/updateRailOffsetDayplan")
+    public RESTfulResult updateRailOffsetDayplan(@RequestBody AmsRailOffsetDayplan amsRailOffsetDayplan) {
+        if(amsRailOffsetDayplan.getDayplanId()==null){
+            return failed("传值为空");
+        }
+        amsRailOffsetDayplanService.update(amsRailOffsetDayplan);
+        return success("修改成功");
+    }
+    /**
+     * 查询钢材发往异地库计划
+     */
+    @ApiModelProperty(value = "展示钢材发往异地库计划")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "185", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getRailOffsetDayplan")
+    public RESTfulResult getRailOffsetDayplan(@RequestBody(required = false) Map<String,Object> mapValue,
+                                              Integer pageNum,
+                                              Integer pageSize,
+                                              Integer apiId) {
+        List<Map<String, Object>> list = amsRailOffsetDayplanService.getRailOffsetDayplan(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amsRailOffsetDayplanService.getRailOffsetDayplan(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+}

+ 411 - 0
src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java

@@ -0,0 +1,411 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.model.AmsDispatchSaleOrder;
+import com.steerinfo.dil.model.AmsSaleOrder;
+import com.steerinfo.dil.service.IAmsSaleOrderService;
+import com.steerinfo.dil.service.impl.AmsDispatchSaleOrderServiceImpl;
+import com.steerinfo.dil.service.impl.AmsSaleOrderMaterialServiceImpl;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+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.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrder RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrder RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amssaleorders")
+public class AmsSaleOrderController extends BaseRESTfulController {
+
+    @Autowired
+    IAmsSaleOrderService amsSaleOrderService;
+    @Autowired
+    AmsSaleOrderMaterialServiceImpl amsSaleOrderMaterialService;
+    @Autowired
+    AmsDispatchSaleOrderServiceImpl amsDispatchSaleOrderService;
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    @ApiOperation(value="查询未上报销售订单信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(98)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getSaleOrderInfo")
+    public RESTfulResult getSaleOrderInfo(@RequestBody(required=false) Map<String,Object> mapValue,
+                                         Integer apiId,
+                                         Integer pageNum,
+                                         Integer pageSize){
+
+        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getSaleOrderInfo(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getSaleOrderInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        return success(pageList);
+    }
+
+    @ApiOperation(value="查询已上报销售订单信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(98)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getSaleOrderReported")
+    public RESTfulResult getSaleOrderReported(@RequestBody(required=false) Map<String,Object> mapValue,
+                                          Integer apiId,
+                                          Integer pageNum,
+                                          Integer pageSize){
+
+        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getSaleOrderReported(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getSaleOrderReported(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        return success(pageList);
+    }
+
+    @ApiOperation(value="查询财务已审批销售订单信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(105)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getAmsSaleOrderApproved")
+    public RESTfulResult getAmsSaleOrderApproved(@RequestBody(required=false) Map<String,Object> mapValue,
+                                              Integer apiId,
+                                              Integer pageNum,
+                                              Integer pageSize){
+
+        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getAmsSaleOrderApproved(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getAmsSaleOrderApproved(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        return success(pageList);
+    }
+
+    @ApiOperation(value="根据销售订单号查询销售订单详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(100)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getSaleOrderDetail")
+    public RESTfulResult getSaleOrderDetail(BigDecimal saleOrderId,@RequestBody(required=false) Map<String,Object> mapValue,
+                                          Integer apiId,
+                                          Integer pageNum,
+                                          Integer pageSize){
+        if (mapValue == null) {
+            mapValue = new HashMap<>();
+        }
+        mapValue.put("saleOrderId",saleOrderId);
+        List<Map<String, Object>> amsSaleOrderDetail = amsSaleOrderService.getSaleOrderDetail(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSaleOrderDetail1 = amsSaleOrderService.getSaleOrderDetail(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrderDetail,amsSaleOrderDetail1);
+        return success(pageList);
+    }
+
+    /**
+     * 上传销售订单
+     * @param saleOrderId
+     * @return
+     */
+    @ApiOperation(value="上传销售订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderId", value = "销售订单ID", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/uploadSaleOrder/{saleOrderId}")
+    public RESTfulResult uploadSaleOrder(@PathVariable("saleOrderId") BigDecimal saleOrderId){
+        int i = amsSaleOrderService.uploadSaleOrder(saleOrderId);
+        return success(i);
+    }
+
+
+    /**
+     * 新增销售订单
+     * @param amsSaleOrder
+     * @return
+     */
+    @ApiOperation(value="新增销售订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSaleOrder", value = "销售订单对象", required = false, dataType = "AmsSaleOrder")
+    })
+    @PostMapping(value = "/addAmsSaleOrder")
+    public RESTfulResult addAmsSaleOrder(@RequestBody(required = false) AmsSaleOrder amsSaleOrder){
+        int i = amsSaleOrderService.addAmsSaleOrder(amsSaleOrder);
+        return success(i);
+    }
+
+    /**
+     * 通过主键渲染销售订单信息
+     * @param saleOrderId
+     * @return
+     */
+    @ApiOperation(value="通过主键渲染销售订单信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderId", value = "主键Id", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/getAmsSaleOrderBySaleOrderId/{saleOrderId}")
+    public RESTfulResult getAmsSaleOrderBySaleOrderId(@PathVariable("saleOrderId") BigDecimal saleOrderId){
+        List<Map<String, Object>> maps = amsSaleOrderService.selectBySaleOrderId(saleOrderId);
+        return success(maps);
+    }
+
+    /**
+     * 通过主键修改销售订单
+     * @param amsSaleOrder
+     * @return
+     */
+    @ApiOperation(value="通过主键修改销售订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSaleOrder", value = "销售订单对象", required = false, dataType = "AmsSaleOrder")
+    })
+    @PostMapping(value = "/updateAmsSaleOrder")
+    public RESTfulResult updateAmsSaleOrder(@RequestBody(required = false) AmsSaleOrder amsSaleOrder){
+        int i = amsSaleOrderService.updateAmsSaleOrder(amsSaleOrder);
+        return success(i);
+    }
+
+    /**
+     * 通过主键删除销售订单
+     * @param saleOrderId
+     * @return
+     */
+    @ApiOperation(value="通过主键删除销售订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderId", value = "主键Id", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/deleteAmsSaleOrderBySaleOrderId")
+    public RESTfulResult deleteAmsSaleOrderBySaleOrderId(BigDecimal saleOrderId){
+        int i = amsSaleOrderService.deleteAmsSaleOrderBySaleOrderId(saleOrderId);
+        return success(i);
+    }
+
+    @ApiOperation(value="根据销售订单号查询销售订单修改日志")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(100)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getSaleOrderUpdateLog")
+    public RESTfulResult getSaleOrderUpdateLog(BigDecimal saleOrderId,@RequestBody(required=false) Map<String,Object> mapValue,
+                                            Integer apiId,
+                                            Integer pageNum,
+                                            Integer pageSize){
+        if (mapValue == null) {
+            mapValue = new HashMap<>();
+        }
+        mapValue.put("saleOrderId",saleOrderId);
+        List<Map<String, Object>> amsSaleOrderUpdate = amsSaleOrderService.getSaleOrderUpdateLog(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSaleOrderUpdate1 = amsSaleOrderService.getSaleOrderUpdateLog(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrderUpdate,amsSaleOrderUpdate1);
+        return success(pageList);
+    }
+
+    /**
+     * 获取销售片区
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取销售片区")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getSaleArea")
+    public RESTfulResult getSaleArea(){
+        return success(amsSaleOrderService.getSaleArea());
+    }
+
+    /**
+     * 获取发货单位
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取发货单位")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getShipperName")
+    public RESTfulResult getShipperName(){
+        return success(amsSaleOrderService.getShipperName());
+    }
+
+    /**
+     * 获取收货单位
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取收货单位")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getConsigneeCompanyName")
+    public RESTfulResult getConsigneeCompanyName(){
+        return success(amsSaleOrderService.getConsigneeCompanyName());
+    }
+    /**
+     * 展示销售公司已审核销售订单的车序号列表
+     * @param mapValue
+     * @param pageNum
+     * @param pageSize
+     * @param apiId
+     * @return
+     */
+    @ApiModelProperty(value = "展示销售公司已审核销售订单的车序号列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "181", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getSaleOrderList")
+    public RESTfulResult getSaleOrderList(@RequestBody(required = false) Map<String,Object> mapValue,
+                                          Integer pageNum,
+                                          Integer pageSize,
+                                          Integer apiId) {
+        List<Map<String, Object>> list = amsSaleOrderService.getSaleOrderList(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amsSaleOrderService.getSaleOrderList(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+    /**
+     * 固定派单:通过车序号查询收货地址,截取收货地址的区域,去资源管理中查询对应的承运商,将车序号与承运商绑定
+     */
+    @PostMapping("/addAmsDispatchSaleOrder")
+    public RESTfulResult addAmsDispatchSaleOrder(@RequestBody(required = false) List<Map<String,Object>> mapValue){
+        if(mapValue==null){
+            return failed();
+        }
+        for (Map<String,Object> m:mapValue
+        ) {
+//            Integer id=amsSaleOrderMaterialService.selectByCxh(m);
+            Integer id=Integer.parseInt(m.get("orderMaterialId").toString()) ;
+            System.out.println(id);
+            //通过主键Id获取地址id
+            Integer a=amsSaleOrderMaterialService.selectById(new BigDecimal(id));
+            //通过地址id查询承运商id
+            List<Integer> carriers = amsSaleOrderService.getCarrier(a);
+            //判断是否只有一个承运商
+            if(carriers.size()==1) {
+                //新增固定派单
+                AmsDispatchSaleOrder ad = new AmsDispatchSaleOrder();
+                ad.setDispatchId(amsDispatchSaleOrderService.selectMaxId());
+                ad.setSaleOrderMaterialId(new BigDecimal(id));
+                ad.setCarrierId(new BigDecimal(carriers.get(0)));
+                ad.setDispatchDealTime(new Date());
+                ad.setDispatchTime(new Date());
+                //成交类型(0:定向派单;1:公开抢单)
+                ad.setDispatchType(new BigDecimal(0));
+                //销售订单车序号状态(0:自由;1:锁定)
+                ad.setDispatchStatus(new BigDecimal(1));
+                amsDispatchSaleOrderService.insert(ad);
+                return success("插入成功");
+            }
+        }
+        return success();
+    }
+    /**
+     * 公开派单:查询未分派车辆的销售订单的车序号
+     */
+    @ApiModelProperty(value = "展示车序号列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "182", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getAmsSaleOrderMaterial")
+    public RESTfulResult getAmsSaleOrderMaterial(@RequestBody(required = false) Map<String,Object> mapValue,
+                                                 Integer pageNum,
+                                                 Integer pageSize,
+                                                 Integer apiId) {
+        List<Map<String, Object>> list = amsSaleOrderMaterialService.getSaleMaterial(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amsSaleOrderMaterialService.getSaleMaterial(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+    /**
+     * 公开派单:新增公开派单
+     */
+    @PostMapping("/addOpenAmsDispatchSaleOrder/{saleOrderMaterialId}")
+    public RESTfulResult addOpenAmsDispatchSaleOrder(@PathVariable("saleOrderMaterialId") BigDecimal saleOrderMaterialId){
+        if(saleOrderMaterialId==null){
+            return failed();
+        }
+        //新增公开派单
+        AmsDispatchSaleOrder ad = new AmsDispatchSaleOrder();
+        ad.setDispatchId(amsDispatchSaleOrderService.selectMaxId());
+        ad.setSaleOrderMaterialId(saleOrderMaterialId);
+        //成交类型(0:定向派单;1:公开抢单)
+        ad.setDispatchType(new BigDecimal(1));
+        //销售订单车序号状态(0:自由;1:锁定)
+        ad.setDispatchStatus(new BigDecimal(0));
+        amsDispatchSaleOrderService.insert(ad);
+        return success("插入成功");
+
+    }
+
+    /**
+     * 删除公开派单
+     */
+    @PostMapping("/deleteAmsDispatchSaleOrder/{dispatchId}")
+    public RESTfulResult deleteAmsDispatchSaleOrder(@PathVariable("dispatchId") BigDecimal dispatchId) {
+        amsDispatchSaleOrderService.delete(dispatchId);
+        return success("删除成功");
+    }
+
+    /**
+     * 公开派单:查询公开派单
+     */
+    @ApiModelProperty(value = "展示公开派单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "181", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getOpenDispatchSaleOrder")
+    public RESTfulResult getOpenDispatchSaleOrder(@RequestBody(required = false) Map<String,Object> mapValue,
+                                                  Integer pageNum,
+                                                  Integer pageSize,
+                                                  Integer apiId) {
+        List<Map<String, Object>> list = amsDispatchSaleOrderService.getOpenDispatchSaleOrder(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amsDispatchSaleOrderService.getOpenDispatchSaleOrder(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+    /**
+     *公开派单:修改公开派单
+     */
+    @PostMapping("/updateOpenDispatchSaleOrder")
+    public RESTfulResult updateOpenDispatchSaleOrder(@RequestBody AmsDispatchSaleOrder amsDispatchSaleOrder) {
+        if(amsDispatchSaleOrder.getCarrierId()!=null){
+            amsDispatchSaleOrder.setDispatchStatus(new BigDecimal(1));
+        }
+        amsDispatchSaleOrder.setDispatchDealTime(new Date());
+        amsDispatchSaleOrder.setUpdateTime(new Date());
+        amsDispatchSaleOrder.setUpdateUsername("admin");
+        amsDispatchSaleOrderService.modify(amsDispatchSaleOrder);
+        return success("修改成功");
+    }
+}

+ 136 - 0
src/main/java/com/steerinfo/dil/controller/AmsSaleOrderMaterialController.java

@@ -0,0 +1,136 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.model.AmsSaleOrderMaterial;
+import com.steerinfo.dil.service.IAmsSaleOrderMaterialService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.framework.controller.RESTfulResult;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrderMaterial RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrderMaterial RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amssaleordermaterials")
+public class AmsSaleOrderMaterialController extends BaseRESTfulController {
+
+    @Autowired
+    IAmsSaleOrderMaterialService amsSaleOrderMaterialService;
+
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    /**
+     * 新增销售订单物资信息
+     * @param amsSaleOrderMaterial
+     * @return
+     */
+    @ApiOperation(value="新增销售订单物资信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSaleOrderMaterial", value = "销售订单物资信息对象", required = false, dataType = "AmsSaleOrderMaterial")
+    })
+    @PostMapping(value = "/addAmsSaleOrderMaterial")
+    public RESTfulResult addAmsSaleOrderMaterial(@RequestBody(required = false) AmsSaleOrderMaterial amsSaleOrderMaterial){
+        int i = amsSaleOrderMaterialService.addAmsSaleOrderMaterial(amsSaleOrderMaterial);
+        return success(i);
+    }
+
+    /**
+     * 通过主键渲染销售订单物资信息
+     * @param saleOrderMaterialId
+     * @return
+     */
+    @ApiOperation(value="通过主键渲染销售订单物资信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderMaterialId", value = "主键Id", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/getAmsSaleOrderMaterialBySaleOrderMaterialId/{saleOrderMaterialId}")
+    public RESTfulResult getAmsSaleOrderMaterialBySaleOrderMaterialId(@PathVariable("saleOrderMaterialId") BigDecimal saleOrderMaterialId){
+        List<Map<String, Object>> maps = amsSaleOrderMaterialService.selectBySaleOrderMaterialId(saleOrderMaterialId);
+        return success(maps);
+    }
+
+    /**
+     * 通过主键修改销售订单物资信息
+     * @param amsSaleOrderMaterial
+     * @return
+     */
+    @ApiOperation(value="通过主键修改销售订单物资信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSaleOrderMaterial", value = "销售订单物资信息对象", required = false, dataType = "AmsSaleOrderMaterial")
+    })
+    @PostMapping(value = "/updateAmsSaleOrderMaterial")
+    public RESTfulResult updateAmsSaleOrderMaterial(@RequestBody(required = false) AmsSaleOrderMaterial amsSaleOrderMaterial){
+        int i = amsSaleOrderMaterialService.updateAmsSaleOrderMaterial(amsSaleOrderMaterial);
+        return success(i);
+    }
+
+    /**
+     * 通过主键删除销售订单物资信息
+     * @param saleOrderMaterialId
+     * @return
+     */
+    @ApiOperation(value="通过主键删除销售订单物资信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderMaterialId", value = "主键Id", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/deleteAmsSaleOrderMaterialBySaleOrderMaterialId")
+    public RESTfulResult deleteAmsSaleOrderMaterialBySaleOrderMaterialId(BigDecimal saleOrderMaterialId){
+        int i = amsSaleOrderMaterialService.deleteAmsSaleOrderMaterialBySaleOrderMaterialId(saleOrderMaterialId);
+        return success(i);
+    }
+
+    /**
+     * 通过主键获取收货地址
+     * @param saleOrderMaterialId
+     * @return
+     */
+    @ApiOperation(value="通过主键获取收货地址")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "saleOrderMaterialId", value = "主键Id", required = false, dataType = "java.math.BigDecimal")
+    })
+    @PostMapping(value = "/getAddress/{saleOrderMaterialId}")
+    public RESTfulResult getAddress(@PathVariable("saleOrderMaterialId") BigDecimal saleOrderMaterialId){
+        String address = amsSaleOrderMaterialService.getAddress(saleOrderMaterialId);
+        return success(address);
+    }
+
+    /**
+     * 通过主键修改销售订单信息(新增一条),过去的成为历史记录
+     * @param amsSaleOrderMaterial
+     * @return
+     */
+    @ApiOperation(value="通过主键修改销售订单信息(新增一条),过去的成为历史记录")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSaleOrderMaterial", value = "销售订单物资信息对象", required = false, dataType = "AmsSaleOrderMaterial")
+    })
+    @PostMapping(value = "/updateAddress")
+    public RESTfulResult updateAddress(@RequestBody(required = false) AmsSaleOrderMaterial amsSaleOrderMaterial){
+        System.out.println(amsSaleOrderMaterial);
+        int i = amsSaleOrderMaterialService.updateAddress(amsSaleOrderMaterial);
+        return success(i);
+    }
+
+}

+ 150 - 0
src/main/java/com/steerinfo/dil/controller/AmsSalePlanController.java

@@ -0,0 +1,150 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.feign.ColumnDataFeign;
+import com.steerinfo.dil.model.AmsSalePlan;
+import com.steerinfo.dil.service.IAmsSalePlanService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSalePlan RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSalePlan RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amssaleplans")
+public class AmsSalePlanController extends BaseRESTfulController {
+
+    @Autowired
+    IAmsSalePlanService amsSalePlanService;
+
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    @ApiOperation(value="查询销售计划信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId(92)", value = "表头", required = false, dataType = "Interger")
+    })
+    @PostMapping("/getSalePlanInfo")
+    public RESTfulResult getSalePlanInfo(@RequestBody(required=false) Map<String,Object> mapValue,
+                                              Integer apiId,
+                                              Integer pageNum,
+                                              Integer pageSize){
+
+        List<Map<String, Object>> amsSalePlan = amsSalePlanService.getSalePlanInfo(mapValue);
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String, Object>> amsSalePlan1 = amsSalePlanService.getSalePlanInfo(mapValue);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSalePlan,amsSalePlan1);
+        return success(pageList);
+    }
+
+    /**
+     * 新增销售计划
+     * @param amsSalePlan
+     * @return
+     */
+    @ApiOperation(value="新增销售计划")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSalePlan", value = "销售计划对象", required = false, dataType = "AmsSalePlan")
+    })
+    @PostMapping(value = "/addAmsSalePlan")
+    public RESTfulResult addAmsSalePlan(@RequestBody(required = false) AmsSalePlan amsSalePlan){
+        System.out.println(amsSalePlan);
+        int i = amsSalePlanService.addAmsSalePlan(amsSalePlan);
+        return success(i);
+    }
+
+    /**
+     * 通过主键查询销售计划信息
+     * @param planId
+     * @return
+     */
+    @ApiOperation(value="通过主键查询销售计划信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "planId", value = "销售计划主键", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping(value = "/getAmsSalePlanByPlanId/{planId}")
+    public RESTfulResult getAmsSalePlanByPlanId(@PathVariable("planId") BigDecimal planId){
+        List<Map<String, Object>> amsSalePlan = amsSalePlanService.selectByPlanId(planId);
+        return success(amsSalePlan);
+    }
+
+    /**
+     * 通过主键修改销售计划
+     * @param amsSalePlan
+     * @return
+     */
+    @ApiOperation(value="通过主键修改车皮装车作业实绩")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "amsSalePlan", value = "修改车皮装车map", required = false, dataType = "AmsSalePlan")
+    })
+    @PostMapping(value = "/upadteAmsSalePlanByPlanId")
+    public RESTfulResult upadteAmsSalePlanByPlanId(@RequestBody(required = false) AmsSalePlan amsSalePlan){
+        int i = amsSalePlanService.updateAmsSalePlan(amsSalePlan);
+        return success(i);
+    }
+
+    /**
+     * 通过主键删除销售计划
+     * @param planId
+     * @return
+     */
+    @ApiOperation(value="通过主键删除车皮装车作业实绩")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "planId", value = "主键ID", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping(value = "/deleteAmsSalePlanByPlanId")
+    public RESTfulResult deleteAmsSalePlanByPlanId(@RequestParam BigDecimal planId){
+        int i = amsSalePlanService.deleteAmsSalePlan(planId);
+        return success(i);
+    }
+
+    /**
+     * 获取规格型号
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取规格型号")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getMaterialName")
+    public RESTfulResult getMaterialName(){
+        return success(amsSalePlanService.getMaterialName());
+    }
+
+    /**
+     * 获取销售片区名称
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取销售片区名称")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getAreaName")
+    public RESTfulResult getAreaName(){
+        return success(amsSalePlanService.getAreaName());
+    }
+}

+ 97 - 0
src/main/java/com/steerinfo/dil/controller/AmstruckInwardPlanController.java

@@ -0,0 +1,97 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.model.AmstruckInwardPlan;
+import com.steerinfo.dil.service.IAmstruckInwardPlanService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardPlan RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 03:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardPlan RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amstruckinwardplan")
+public class AmstruckInwardPlanController extends BaseRESTfulController {
+
+    @Autowired
+    IAmstruckInwardPlanService amstruckInwardPlanService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+
+    /**
+     *新增运输计划
+     */
+    @PostMapping("/addTruckPlan")
+    public RESTfulResult addTruckPlan(@RequestBody(required=false) Map<String,Object> mapValue) {
+        amstruckInwardPlanService.insert(mapValue);
+        return success();
+    }
+    /**
+     * 删除运输计划
+     */
+    @PostMapping("/deleteTruckRequirement/{planId}")
+    public RESTfulResult deleteTruckPlan(@PathVariable("planId") BigDecimal planId) {
+        amstruckInwardPlanService.delete(planId);
+        return success("删除成功");
+    }
+    /**
+     * 修改运输计划/下发运输计划/承运商接收运输计划
+     */
+    @PostMapping("/updateTruckPlan")
+    public RESTfulResult updateTruckPlan(@RequestBody AmstruckInwardPlan amstruckInwardPlan) {
+        amstruckInwardPlan.setUpdateTime(new Date());
+        amstruckInwardPlan.setUpdateUsername("admin");
+        amstruckInwardPlanService.modify(amstruckInwardPlan);
+        return success("修改成功");
+    }
+    /**
+     * 展示未下发的运输计划
+     * @param mapValue
+     * @param pageNum
+     * @param pageSize
+     * @param apiId
+     * @return
+     */
+    @ApiModelProperty(value = "展示运输计划")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "181", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getTruckPlanList")
+    public RESTfulResult getTruckPlanList(@RequestBody(required = false) Map<String,Object> mapValue,
+                                          Integer pageNum,
+                                          Integer pageSize,
+                                          Integer apiId) {
+        List<Map<String, Object>> list = amstruckInwardPlanService.getTruckPlanList(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amstruckInwardPlanService.getTruckPlanList(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+
+}

+ 96 - 0
src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java

@@ -0,0 +1,96 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.model.AmstruckInwardRequirement;
+import com.steerinfo.dil.service.IAmstruckInwardRequirementService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardRequirement RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 11:30
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardRequirement RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amstruckinwardrequirement")
+public class AmstruckInwardRequirementController extends BaseRESTfulController {
+
+    @Autowired
+    IAmstruckInwardRequirementService amstruckInwardRequirementService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    /**
+     *用车单位提出需求
+     *新增用车需求
+     */
+    @PostMapping("/addTruckRequirement")
+    public RESTfulResult addTruckRequirement(@RequestBody AmstruckInwardRequirement amstruckInwardRequirement) {
+        amstruckInwardRequirementService.insert(amstruckInwardRequirement);
+        return success();
+    }
+    /**
+     * 删除用车需求
+     */
+    @PostMapping("/deleteTruckRequirement/{requirementId}")
+    public RESTfulResult deleteTruckRequirement(@PathVariable("requirementId") BigDecimal requirementId) {
+        amstruckInwardRequirementService.delete(requirementId);
+        return success("删除成功");
+    }
+    /**
+     * 修改用车需求/下发用车需求
+     */
+    @PostMapping("/updateTruckRequirement")
+    public RESTfulResult updateTruckRequirement(@RequestBody AmstruckInwardRequirement amstruckInwardRequirement) {
+        amstruckInwardRequirement.setUpdateTime(new Date());
+        amstruckInwardRequirement.setUpdateUsername("admin");
+        amstruckInwardRequirementService.modify(amstruckInwardRequirement);
+        return success("修改成功");
+    }
+    /**
+     * 展示未下发的用车需求
+     * @param mapValue
+     * @param pageNum
+     * @param pageSize
+     * @param apiId
+     * @return
+     */
+    @ApiModelProperty(value = "展示未下发的用车需求")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "207", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getTruckRequirementList")
+    public RESTfulResult getTruckRequirementList(@RequestBody(required = false) Map<String,Object> mapValue,
+                                                 Integer pageNum,
+                                                 Integer pageSize,
+                                                 Integer apiId) {
+        List<Map<String, Object>> list = amstruckInwardRequirementService.getTruckRequirementList(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amstruckInwardRequirementService.getTruckRequirementList(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+}

+ 138 - 0
src/main/java/com/steerinfo/dil/controller/AmstruckRailDayplanController.java

@@ -0,0 +1,138 @@
+package com.steerinfo.dil.controller;
+
+
+import com.steerinfo.dil.model.AmstruckRailDayplan;
+import com.steerinfo.dil.service.IAmstruckRailDayplanService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * AmstruckRailDayplan RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 02:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:yk
+ * 参考:
+ * 描述:AmstruckRailDayplan RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/amstruckraildayplans")
+public class AmstruckRailDayplanController extends BaseRESTfulController {
+
+    @Autowired
+    IAmstruckRailDayplanService amstruckRailDayplanService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    /**
+     *新增日计划
+     */
+    @PostMapping("/addTruckRailDayPlan")
+    public RESTfulResult addTruckRailDayPlan(@RequestBody AmstruckRailDayplan amstruckRailDayplan) {
+        amstruckRailDayplanService.insert(amstruckRailDayplan);
+        return success();
+    }
+
+    /**
+     * 删除日计划
+     */
+    @PostMapping("/deleteTruckRailDayPlan/{dayPlanId}")
+    public RESTfulResult deleteTruckRailDayPlan(@PathVariable("dayPlanId") BigDecimal dayPlanId) {
+        amstruckRailDayplanService.delete(dayPlanId);
+        return success("删除成功");
+    }
+    /**
+     * 修改日计划
+     */
+    @PostMapping("/updateTruckRailDayPlan")
+    public RESTfulResult updateTruckRailDayPlan(@RequestBody AmstruckRailDayplan amstruckRailDayplan) {
+        if(amstruckRailDayplan.getCarrierId()!=null){
+            amstruckRailDayplan.setDayplanReceiveStatus(new BigDecimal(1));
+        }
+        amstruckRailDayplanService.modify(amstruckRailDayplan);
+        return success("修改成功");
+    }
+
+    /**
+     * 查询日计划
+     */
+    @ApiModelProperty(value = "展示焦炭日计划")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "183", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getTruckRailDayPlanList")
+    public RESTfulResult getTruckRailDayPlan(@RequestBody(required = false) Map<String,Object> mapValue,
+                                             Integer pageNum,
+                                             Integer pageSize,
+                                             Integer apiId) {
+        List<Map<String, Object>> list = amstruckRailDayplanService.getTruckRailDayPlan(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amstruckRailDayplanService.getTruckRailDayPlan(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+    /**
+     * 查询日计划
+     */
+    @ApiModelProperty(value = "展示水渣日计划")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "183", required = false, dataType = "BigDecimal")
+    })
+    @PostMapping("/getSzTruckRailDayPlanList")
+    public RESTfulResult getSzTruckRailDayPlan(@RequestBody(required = false) Map<String,Object> mapValue,
+                                               Integer pageNum,
+                                               Integer pageSize,
+                                               Integer apiId) {
+        List<Map<String, Object>> list = amstruckRailDayplanService.getSzTruckRailDayPlan(mapValue);
+        PageHelper.startPage(pageNum, pageSize);
+        //分页查询数据
+        List<Map<String, Object>> columnList = amstruckRailDayplanService.getSzTruckRailDayPlan(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
+        return success(data);
+    }
+
+//    /**
+//     * 批量下发
+//     */
+//    @PostMapping("/updateAllTruckRailDayPlan")
+//    public RESTfulResult updateAllTruckRailDayPlan(@RequestBody(required = false) List<Map<String,Object>> mapValue) {
+//        if (mapValue == null) {
+//            return failed();
+//        }
+//        for (Map<String,Object> m:mapValue
+//        ) {
+//            //获取到所选择的主键
+//            Integer id=Integer.parseInt(m.get("dayplanId").toString()) ;
+//            //通过主键查询这条数据
+//           AmstruckRailDayplan a=amstruckRailDayplanService.selectByDayPlanId(id);
+//           if(a==null){
+//               break;
+//           }
+//           a.setDayplanReceiveStatus(new BigDecimal(1));
+//           //修改
+//           amstruckRailDayplanService.modify(a);
+//        }
+//        return success();
+//    }
+}

+ 20 - 0
src/main/java/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.java

@@ -0,0 +1,20 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsDispatchSaleOrder;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmsDispatchSaleOrderMapper extends IBaseMapper<AmsDispatchSaleOrder, BigDecimal> {
+
+    List<Map<String, Object>> getOpenDispatchSaleOrder(Map<String, Object> mapValue);
+
+    //查询序列号主键
+    @Select("select seq_AMS_OTHER.nextval from dual")
+    BigDecimal selectOtherId();
+}

+ 26 - 0
src/main/java/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.java

@@ -0,0 +1,26 @@
+package com.steerinfo.dil.mapper;
+
+
+import com.steerinfo.dil.model.AmsRailOffsetDayplan;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmsRailOffsetDayplanMapper extends IBaseMapper<AmsRailOffsetDayplan, BigDecimal> {
+    /**
+     * 得到最大id
+     * @return
+     */
+    Integer selectMaxId();
+    @Select("select seq_AMS_OTHER.nextval from dual")
+    Integer selectOtherId();
+    //展示钢材发往异地库日计划
+    List<Map<String, Object>> getRailOffsetDayplan(Map<String, Object> mapValue);
+
+
+}

+ 40 - 0
src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMapper.java

@@ -0,0 +1,40 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsSaleOrder;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmsSaleOrderMapper extends IBaseMapper<AmsSaleOrder, BigDecimal> {
+    //查询所有未上报销售订单信息
+    List<Map<String, Object>> getSaleOrderInfo(Map<String,Object> map);
+    //查询所有已上报销售订单信息
+    List<Map<String, Object>> getSaleOrderReported(Map<String,Object> map);
+    //根据车序号查询销售订单详细
+    List<Map<String, Object>> getSaleOrderDetail(Map<String,Object> map);
+    //获取销售片区
+    List<Map<String, Object>> getSaleArea();
+    //获取发货单位
+    List<Map<String, Object>> getShipperName();
+    //获取收货单位
+    List<Map<String, Object>> getConsigneeCompanyName();
+    //查询主键最大值
+    BigDecimal selectMaxId();
+    //获取要渲染的数据
+    List<Map<String, Object>> selectBySaleOrderId(BigDecimal saleOrderId);
+    //删除所有从表信息
+    int deleteBySaleOrderId(BigDecimal saleOrderId);
+    //查询所有财务已经审批的销售订单
+    List<Map<String, Object>> getAmsSaleOrderApproved(Map<String,Object> map);
+    //通过销售订单号查询销售订单的修改日志
+    List<Map<String, Object>> getSaleOrderUpdateLog(Map<String,Object> map);
+
+
+    List<Map<String,Object>> getSaleOrderList(Map<String,Object> mapValue);
+
+    List<Integer>  getCarrier(Integer param);
+}

+ 24 - 0
src/main/java/com/steerinfo/dil/mapper/AmsSaleOrderMaterialMapper.java

@@ -0,0 +1,24 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsSaleOrderMaterial;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmsSaleOrderMaterialMapper extends IBaseMapper<AmsSaleOrderMaterial, BigDecimal> {
+    //查询主键最大值
+    BigDecimal selectMaxId();
+    //获取要渲染的值
+    List<Map<String, Object>> selectBySaleOrderMaterialId(BigDecimal saleOrderMaterialId);
+    //通过主键获得收货地址
+    String getAddress(BigDecimal saleOrderMaterialId);
+    List<Map<String, Object>> getSaleMaterial(Map<String, Object> mapValue);
+
+    Integer selectById(BigDecimal saleOrderMaterialId);
+
+    Integer selectByCxh(Map<String, Object> m);
+}

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

@@ -0,0 +1,23 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsSalePlan;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmsSalePlanMapper extends IBaseMapper<AmsSalePlan, BigDecimal> {
+    //查询所有销售计划信息
+    List<Map<String, Object>> getSalePlanInfo(Map<String,Object> map);
+    //查询主键最大值
+    BigDecimal selectMaxId();
+    //获得规格型号
+    List<Map<String, Object>> getMaterialName();
+    //获得销售片区名称
+    List<Map<String, Object>> getAreaName();
+    //获得要渲染的数据
+    List<Map<String, Object>> selectByPlanId(BigDecimal planId);
+}

+ 18 - 0
src/main/java/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.java

@@ -0,0 +1,18 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmstruckInwardPlan;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmstruckInwardPlanMapper extends IBaseMapper<AmstruckInwardPlan, BigDecimal> {
+    @Select("select seq_inward_plan.nextval from dual")
+    BigDecimal selectOtherId();
+    //展示运输计划
+    List<Map<String, Object>> getTruckPlanList(Map<String, Object> mapValue);
+}

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

@@ -0,0 +1,19 @@
+package com.steerinfo.dil.mapper;
+
+
+import com.steerinfo.dil.model.AmstruckInwardRequirement;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmstruckInwardRequirementMapper extends IBaseMapper<AmstruckInwardRequirement, BigDecimal> {
+    @Select("select seq_inward_requirement.nextval from dual")
+    BigDecimal selectOtherId();
+    //展示用车需求
+    List<Map<String, Object>> getTruckRequirementList(Map<String, Object> mapValue);
+}

+ 33 - 0
src/main/java/com/steerinfo/dil/mapper/AmstruckRailDayplanMapper.java

@@ -0,0 +1,33 @@
+package com.steerinfo.dil.mapper;
+
+
+import com.steerinfo.dil.model.AmstruckRailDayplan;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface AmstruckRailDayplanMapper extends IBaseMapper<AmstruckRailDayplan, BigDecimal> {
+    /**
+     * 得到最大id
+     * @return
+     */
+    BigDecimal selectMaxId();
+    @Select("select seq_AMS_OTHER.nextval from dual")
+    BigDecimal selectOtherId();
+
+    List<Map<String, Object>> getTruckRailDayPlan(Map<String, Object> mapValue);
+    /**
+     * 新增
+     * @return
+     */
+    int insertSelective(AmstruckRailDayplan amstruckRailDayplan);
+
+    List<Map<String, Object>> getSzTruckRailDayPlan(Map<String, Object> mapValue);
+
+    AmstruckRailDayplan selectByDayPlanId(Integer dayplanId);
+}

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

@@ -0,0 +1,14 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmstruckRequirementPlan;
+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 AmstruckRequirementPlanMapper extends IBaseMapper<AmstruckRequirementPlan, BigDecimal> {
+    @Select("select seq_AMSTRUCK_REQUIREMENT_PLAN.nextval from dual")
+    BigDecimal selectOtherId();
+}

+ 214 - 0
src/main/java/com/steerinfo/dil/model/AmsDispatchSaleOrder.java

@@ -0,0 +1,214 @@
+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 AmsDispatchSaleOrder implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(DISPATCH_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal dispatchId;
+
+    /**
+     * 销售订单和物资的中间表主键id(SALE_ORDER_MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售订单和物资的中间表主键id",required=false)
+    private BigDecimal saleOrderMaterialId;
+
+    /**
+     * 承运商ID(CARRIER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
+    /**
+     * 派单时间(DISPATCH_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="派单时间",required=false)
+    private Date dispatchTime;
+
+    /**
+     * 成交时间(DISPATCH_DEAL_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="成交时间",required=false)
+    private Date dispatchDealTime;
+
+    /**
+     * 记录创建人(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:公开抢单)(DISPATCH_TYPE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="成交类型(0:定向派单;1:公开抢单)",required=false)
+    private BigDecimal dispatchType;
+
+    /**
+     * 销售订单车序号状态(0:自由;1:锁定)(DISPATCH_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售订单车序号状态(0:自由;1:锁定)",required=false)
+    private BigDecimal dispatchStatus;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.dispatchId;
+    }
+
+    @Override
+    public void setId(BigDecimal dispatchId) {
+        this.dispatchId = dispatchId;
+    }
+
+    public BigDecimal getDispatchId() {
+        return dispatchId;
+    }
+
+    public void setDispatchId(BigDecimal dispatchId) {
+        this.dispatchId = dispatchId;
+    }
+
+    public BigDecimal getSaleOrderMaterialId() {
+        return saleOrderMaterialId;
+    }
+
+    public void setSaleOrderMaterialId(BigDecimal saleOrderMaterialId) {
+        this.saleOrderMaterialId = saleOrderMaterialId;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
+    public Date getDispatchTime() {
+        return dispatchTime;
+    }
+
+    public void setDispatchTime(Date dispatchTime) {
+        this.dispatchTime = dispatchTime;
+    }
+
+    public Date getDispatchDealTime() {
+        return dispatchDealTime;
+    }
+
+    public void setDispatchDealTime(Date dispatchDealTime) {
+        this.dispatchDealTime = dispatchDealTime;
+    }
+
+    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 getDispatchType() {
+        return dispatchType;
+    }
+
+    public void setDispatchType(BigDecimal dispatchType) {
+        this.dispatchType = dispatchType;
+    }
+
+    public BigDecimal getDispatchStatus() {
+        return dispatchStatus;
+    }
+
+    public void setDispatchStatus(BigDecimal dispatchStatus) {
+        this.dispatchStatus = dispatchStatus;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", dispatchId=").append(dispatchId);
+        sb.append(", saleOrderMaterialId=").append(saleOrderMaterialId);
+        sb.append(", carrierId=").append(carrierId);
+        sb.append(", dispatchTime=").append(dispatchTime);
+        sb.append(", dispatchDealTime=").append(dispatchDealTime);
+        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(", dispatchType=").append(dispatchType);
+        sb.append(", dispatchStatus=").append(dispatchStatus);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 331 - 0
src/main/java/com/steerinfo/dil/model/AmsRailOffsetDayplan.java

@@ -0,0 +1,331 @@
+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 AmsRailOffsetDayplan implements IBasePO<Integer> {
+    /**
+     * 发运计划ID(DAYPLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发运计划ID",required=true)
+    private Integer dayplanId;
+
+    /**
+     * 计划号(DAYPLAN_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="计划号",required=false)
+    private String dayplanNo;
+
+    /**
+     * 计划日期(DAYPLAN_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="计划日期",required=false)
+    private Date dayplanDate;
+
+    /**
+     * 发货单位ID(SHIPPER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发货单位ID",required=false)
+    private Integer shipperId;
+
+    /**
+     * 发货日期(DAYPLAN_DELIVERY_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="发货日期",required=false)
+    private Date dayplanDeliveryDate;
+    /**
+     * 承运商ID(DAYPLAN_MATERIAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+    /**
+     * 自有汽车数(DAYPLAN_OWN_CARS_AMOUT,DECIMAL,38)
+     */
+    @ApiModelProperty(value="自有汽车数",required=false)
+    private Integer dayplanOwnCarsAmout;
+
+    /**
+     * 专用线ID(DAYPLAN_DEDICATED_LINE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="专用线ID",required=false)
+    private Integer dayplanDedicatedLineId;
+
+    /**
+     * 到站ID(DAYPLAN_TO_THE_STATION_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="到站ID",required=false)
+    private Integer dayplanToTheStationId;
+
+    /**
+     * 移库单位ID(TRANSFER_UNIT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="移库单位ID",required=false)
+    private Integer transferUnitId;
+
+    /**
+     * 车皮数(DAYPLAN_WAGON_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="车皮数",required=false)
+    private Integer dayplanWagonNumber;
+
+    /**
+     * 收货单位(RECEIVING_UNIT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="收货单位",required=false)
+    private Integer receivingUnitId;
+
+    /**
+     * 收货人(DAYPLAN_CONSIGNEE_NAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="收货人",required=false)
+    private String dayplanConsigneeName;
+
+    /**
+     * 联系电话(DAYPLAN_CONSIGNEE_TEL,VARCHAR,20)
+     */
+    @ApiModelProperty(value="联系电话",required=false)
+    private String dayplanConsigneeTel;
+
+    /**
+     * 接收状态(0;未接收,1:已接收)(DAYPLAN_RECEIVE_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="接收状态(0;未接收,1:已接收)",required=false)
+    private Integer dayplanReceiveStatus;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public Integer getId() {
+        return this.dayplanId;
+    }
+
+    @Override
+    public void setId(Integer dayplanId) {
+        this.dayplanId = dayplanId;
+    }
+
+    public Integer getDayplanId() {
+        return dayplanId;
+    }
+
+    public void setDayplanId(Integer dayplanId) {
+        this.dayplanId = dayplanId;
+    }
+
+    public String getDayplanNo() {
+        return dayplanNo;
+    }
+
+    public void setDayplanNo(String dayplanNo) {
+        this.dayplanNo = dayplanNo == null ? null : dayplanNo.trim();
+    }
+
+    public Date getDayplanDate() {
+        return dayplanDate;
+    }
+
+    public void setDayplanDate(Date dayplanDate) {
+        this.dayplanDate = dayplanDate;
+    }
+
+    public Integer getShipperId() {
+        return shipperId;
+    }
+
+    public void setShipperId(Integer shipperId) {
+        this.shipperId = shipperId;
+    }
+
+    public Date getDayplanDeliveryDate() {
+        return dayplanDeliveryDate;
+    }
+
+    public void setDayplanDeliveryDate(Date dayplanDeliveryDate) {
+        this.dayplanDeliveryDate = dayplanDeliveryDate;
+    }
+
+    public Integer getDayplanOwnCarsAmout() {
+        return dayplanOwnCarsAmout;
+    }
+
+    public void setDayplanOwnCarsAmout(Integer dayplanOwnCarsAmout) {
+        this.dayplanOwnCarsAmout = dayplanOwnCarsAmout;
+    }
+
+    public Integer getDayplanDedicatedLineId() {
+        return dayplanDedicatedLineId;
+    }
+
+    public void setDayplanDedicatedLineId(Integer dayplanDedicatedLineId) {
+        this.dayplanDedicatedLineId = dayplanDedicatedLineId;
+    }
+
+    public Integer getDayplanToTheStationId() {
+        return dayplanToTheStationId;
+    }
+
+    public void setDayplanToTheStationId(Integer dayplanToTheStationId) {
+        this.dayplanToTheStationId = dayplanToTheStationId;
+    }
+
+    public Integer getTransferUnitId() {
+        return transferUnitId;
+    }
+
+    public void setTransferUnitId(Integer transferUnitId) {
+        this.transferUnitId = transferUnitId;
+    }
+
+    public Integer getDayplanWagonNumber() {
+        return dayplanWagonNumber;
+    }
+
+    public void setDayplanWagonNumber(Integer dayplanWagonNumber) {
+        this.dayplanWagonNumber = dayplanWagonNumber;
+    }
+
+    public Integer getReceivingUnitId() {
+        return receivingUnitId;
+    }
+
+    public void setReceivingUnitId(Integer receivingUnitId) {
+        this.receivingUnitId = receivingUnitId;
+    }
+
+    public String getDayplanConsigneeName() {
+        return dayplanConsigneeName;
+    }
+
+    public void setDayplanConsigneeName(String dayplanConsigneeName) {
+        this.dayplanConsigneeName = dayplanConsigneeName == null ? null : dayplanConsigneeName.trim();
+    }
+
+    public String getDayplanConsigneeTel() {
+        return dayplanConsigneeTel;
+    }
+
+    public void setDayplanConsigneeTel(String dayplanConsigneeTel) {
+        this.dayplanConsigneeTel = dayplanConsigneeTel == null ? null : dayplanConsigneeTel.trim();
+    }
+
+    public Integer getDayplanReceiveStatus() {
+        return dayplanReceiveStatus;
+    }
+
+    public void setDayplanReceiveStatus(Integer dayplanReceiveStatus) {
+        this.dayplanReceiveStatus = dayplanReceiveStatus;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", dayplanId=").append(dayplanId);
+        sb.append(", dayplanNo=").append(dayplanNo);
+        sb.append(", dayplanDate=").append(dayplanDate);
+        sb.append(", shipperId=").append(shipperId);
+        sb.append(", dayplanDeliveryDate=").append(dayplanDeliveryDate);
+        sb.append(", dayplanOwnCarsAmout=").append(dayplanOwnCarsAmout);
+        sb.append(", dayplanDedicatedLineId=").append(dayplanDedicatedLineId);
+        sb.append(", dayplanToTheStationId=").append(dayplanToTheStationId);
+        sb.append(", transferUnitId=").append(transferUnitId);
+        sb.append(", dayplanWagonNumber=").append(dayplanWagonNumber);
+        sb.append(", receivingUnitId=").append(receivingUnitId);
+        sb.append(", dayplanConsigneeName=").append(dayplanConsigneeName);
+        sb.append(", dayplanConsigneeTel=").append(dayplanConsigneeTel);
+        sb.append(", dayplanReceiveStatus=").append(dayplanReceiveStatus);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 334 - 0
src/main/java/com/steerinfo/dil/model/AmsSaleOrder.java

@@ -0,0 +1,334 @@
+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 AmsSaleOrder implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(SALE_ORDER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal saleOrderId;
+
+    /**
+     * 销售计划ID(PLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售计划ID",required=false)
+    private BigDecimal planId;
+
+    /**
+     * 销售订单号(WXSDD-年月日-8位数的顺序号)(SALE_NUMBER,VARCHAR,30)
+     */
+    @ApiModelProperty(value="销售订单号(WXSDD-年月日-8位数的顺序号)",required=false)
+    private String saleNumber;
+
+    /**
+     * 发货单位ID(SHIPPER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发货单位ID",required=false)
+    private BigDecimal shipperId;
+
+    /**
+     * 收货单位ID(CONSIGNEE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="收货单位ID",required=false)
+    private BigDecimal consigneeId;
+
+    /**
+     * 账户余额(SALE_ACCOUNT_BALANCE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="账户余额",required=false)
+    private BigDecimal saleAccountBalance;
+
+    /**
+     * 当前订单金额(SALE_CURRENT_ORDER_AMOUNT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="当前订单金额",required=false)
+    private BigDecimal saleCurrentOrderAmount;
+
+    /**
+     * 历史订单金额(SALE_HISTORICAL_ORDER_AMOUNT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="历史订单金额",required=false)
+    private BigDecimal saleHistoricalOrderAmount;
+
+    /**
+     * 销售订单状态(0:未上报;1:已上报;2:销售公司审核;3:财务部审核)(SALE_ORDER_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售订单状态(0:未上报;1:已上报;2:销售公司审核;3:财务部审核)",required=false)
+    private BigDecimal saleOrderStatus;
+
+    /**
+     * 收款客户(SALE_ORDER_RECEIVE_CUSTOMER,VARCHAR,20)
+     */
+    @ApiModelProperty(value="收款客户",required=false)
+    private String saleOrderReceiveCustomer;
+
+    /**
+     * 是否自提(SALE_ORDER_ISSELF_MENTION,VARCHAR,2)
+     */
+    @ApiModelProperty(value="是否自提",required=false)
+    private String saleOrderIsselfMention;
+
+    /**
+     * 单价(SALE_UNIT_PRICE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="单价",required=false)
+    private BigDecimal saleUnitPrice;
+
+    /**
+     * 税率(SALE_ORDER_TAX,VARCHAR,20)
+     */
+    @ApiModelProperty(value="税率",required=false)
+    private String saleOrderTax;
+
+    /**
+     * 备注(SALE_REMARK,VARCHAR,20)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String saleRemark;
+
+    /**
+     * 记录创建人(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:是)(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除(0:否,1:是)",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.saleOrderId;
+    }
+
+    @Override
+    public void setId(BigDecimal saleOrderId) {
+        this.saleOrderId = saleOrderId;
+    }
+
+    public BigDecimal getSaleOrderId() {
+        return saleOrderId;
+    }
+
+    public void setSaleOrderId(BigDecimal saleOrderId) {
+        this.saleOrderId = saleOrderId;
+    }
+
+    public BigDecimal getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public String getSaleNumber() {
+        return saleNumber;
+    }
+
+    public void setSaleNumber(String saleNumber) {
+        this.saleNumber = saleNumber == null ? null : saleNumber.trim();
+    }
+
+    public BigDecimal getShipperId() {
+        return shipperId;
+    }
+
+    public void setShipperId(BigDecimal shipperId) {
+        this.shipperId = shipperId;
+    }
+
+    public BigDecimal getConsigneeId() {
+        return consigneeId;
+    }
+
+    public void setConsigneeId(BigDecimal consigneeId) {
+        this.consigneeId = consigneeId;
+    }
+
+    public BigDecimal getSaleAccountBalance() {
+        return saleAccountBalance;
+    }
+
+    public void setSaleAccountBalance(BigDecimal saleAccountBalance) {
+        this.saleAccountBalance = saleAccountBalance;
+    }
+
+    public BigDecimal getSaleCurrentOrderAmount() {
+        return saleCurrentOrderAmount;
+    }
+
+    public void setSaleCurrentOrderAmount(BigDecimal saleCurrentOrderAmount) {
+        this.saleCurrentOrderAmount = saleCurrentOrderAmount;
+    }
+
+    public BigDecimal getSaleHistoricalOrderAmount() {
+        return saleHistoricalOrderAmount;
+    }
+
+    public void setSaleHistoricalOrderAmount(BigDecimal saleHistoricalOrderAmount) {
+        this.saleHistoricalOrderAmount = saleHistoricalOrderAmount;
+    }
+
+    public BigDecimal getSaleOrderStatus() {
+        return saleOrderStatus;
+    }
+
+    public void setSaleOrderStatus(BigDecimal saleOrderStatus) {
+        this.saleOrderStatus = saleOrderStatus;
+    }
+
+    public String getSaleOrderReceiveCustomer() {
+        return saleOrderReceiveCustomer;
+    }
+
+    public void setSaleOrderReceiveCustomer(String saleOrderReceiveCustomer) {
+        this.saleOrderReceiveCustomer = saleOrderReceiveCustomer == null ? null : saleOrderReceiveCustomer.trim();
+    }
+
+    public String getSaleOrderIsselfMention() {
+        return saleOrderIsselfMention;
+    }
+
+    public void setSaleOrderIsselfMention(String saleOrderIsselfMention) {
+        this.saleOrderIsselfMention = saleOrderIsselfMention == null ? null : saleOrderIsselfMention.trim();
+    }
+
+    public BigDecimal getSaleUnitPrice() {
+        return saleUnitPrice;
+    }
+
+    public void setSaleUnitPrice(BigDecimal saleUnitPrice) {
+        this.saleUnitPrice = saleUnitPrice;
+    }
+
+    public String getSaleOrderTax() {
+        return saleOrderTax;
+    }
+
+    public void setSaleOrderTax(String saleOrderTax) {
+        this.saleOrderTax = saleOrderTax == null ? null : saleOrderTax.trim();
+    }
+
+    public String getSaleRemark() {
+        return saleRemark;
+    }
+
+    public void setSaleRemark(String saleRemark) {
+        this.saleRemark = saleRemark == null ? null : saleRemark.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(", saleOrderId=").append(saleOrderId);
+        sb.append(", planId=").append(planId);
+        sb.append(", saleNumber=").append(saleNumber);
+        sb.append(", shipperId=").append(shipperId);
+        sb.append(", consigneeId=").append(consigneeId);
+        sb.append(", saleAccountBalance=").append(saleAccountBalance);
+        sb.append(", saleCurrentOrderAmount=").append(saleCurrentOrderAmount);
+        sb.append(", saleHistoricalOrderAmount=").append(saleHistoricalOrderAmount);
+        sb.append(", saleOrderStatus=").append(saleOrderStatus);
+        sb.append(", saleOrderReceiveCustomer=").append(saleOrderReceiveCustomer);
+        sb.append(", saleOrderIsselfMention=").append(saleOrderIsselfMention);
+        sb.append(", saleUnitPrice=").append(saleUnitPrice);
+        sb.append(", saleOrderTax=").append(saleOrderTax);
+        sb.append(", saleRemark=").append(saleRemark);
+        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();
+    }
+}

+ 289 - 0
src/main/java/com/steerinfo/dil/model/AmsSaleOrderMaterial.java

@@ -0,0 +1,289 @@
+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 AmsSaleOrderMaterial implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(SALE_ORDER_MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal saleOrderMaterialId;
+
+    /**
+     * 销售订单ID(SALE_ORDER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售订单ID",required=true)
+    private BigDecimal saleOrderId;
+
+    /**
+     * 车序号(SALE_ORDER_MATERIAL_TRUCK_NO,DECIMAL,38)
+     */
+    @ApiModelProperty(value="车序号",required=false)
+    private BigDecimal saleOrderMaterialTruckNo;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 物资件数(SALE_ORDER_MATERIAL_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资件数",required=false)
+    private BigDecimal saleOrderMaterialNumber;
+
+    /**
+     * 物资理论重量(MATERIAL_THEORETICAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资理论重量",required=false)
+    private BigDecimal materialTheoreticalWeight;
+
+    /**
+     * 收货地址(SALE_SHIPPING_ADDRESS,VARCHAR,50)
+     */
+    @ApiModelProperty(value="收货地址",required=false)
+    private String saleShippingAddress;
+
+    /**
+     * 收货日期(SALE_DATE_OF_RECEIPT,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="收货日期",required=false)
+    private Date saleDateOfReceipt;
+
+    /**
+     * 收货方姓名(SALE_ORDER_CONSIGNEE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="收货方姓名",required=false)
+    private String saleOrderConsignee;
+
+    /**
+     * 收货方电话(SALE_ORDER_CONSIGNEE_TEL,VARCHAR,20)
+     */
+    @ApiModelProperty(value="收货方电话",required=false)
+    private String saleOrderConsigneeTel;
+
+    /**
+     * 记录创建人(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:是)(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除(0:否,1:是)",required=false)
+    private BigDecimal deleted;
+
+    /**
+     * 是否为历史记录(0:否,1:是)(UPDATED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否为历史记录(0:否,1:是)",required=false)
+    private BigDecimal updated;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.saleOrderMaterialId;
+    }
+
+    @Override
+    public void setId(BigDecimal saleOrderMaterialId) {
+        this.saleOrderMaterialId = saleOrderMaterialId;
+    }
+
+    public BigDecimal getSaleOrderMaterialId() {
+        return saleOrderMaterialId;
+    }
+
+    public void setSaleOrderMaterialId(BigDecimal saleOrderMaterialId) {
+        this.saleOrderMaterialId = saleOrderMaterialId;
+    }
+
+    public BigDecimal getSaleOrderId() {
+        return saleOrderId;
+    }
+
+    public void setSaleOrderId(BigDecimal saleOrderId) {
+        this.saleOrderId = saleOrderId;
+    }
+
+    public BigDecimal getSaleOrderMaterialTruckNo() {
+        return saleOrderMaterialTruckNo;
+    }
+
+    public void setSaleOrderMaterialTruckNo(BigDecimal saleOrderMaterialTruckNo) {
+        this.saleOrderMaterialTruckNo = saleOrderMaterialTruckNo;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getSaleOrderMaterialNumber() {
+        return saleOrderMaterialNumber;
+    }
+
+    public void setSaleOrderMaterialNumber(BigDecimal saleOrderMaterialNumber) {
+        this.saleOrderMaterialNumber = saleOrderMaterialNumber;
+    }
+
+    public BigDecimal getMaterialTheoreticalWeight() {
+        return materialTheoreticalWeight;
+    }
+
+    public void setMaterialTheoreticalWeight(BigDecimal materialTheoreticalWeight) {
+        this.materialTheoreticalWeight = materialTheoreticalWeight;
+    }
+
+    public String getSaleShippingAddress() {
+        return saleShippingAddress;
+    }
+
+    public void setSaleShippingAddress(String saleShippingAddress) {
+        this.saleShippingAddress = saleShippingAddress == null ? null : saleShippingAddress.trim();
+    }
+
+    public Date getSaleDateOfReceipt() {
+        return saleDateOfReceipt;
+    }
+
+    public void setSaleDateOfReceipt(Date saleDateOfReceipt) {
+        this.saleDateOfReceipt = saleDateOfReceipt;
+    }
+
+    public String getSaleOrderConsignee() {
+        return saleOrderConsignee;
+    }
+
+    public void setSaleOrderConsignee(String saleOrderConsignee) {
+        this.saleOrderConsignee = saleOrderConsignee == null ? null : saleOrderConsignee.trim();
+    }
+
+    public String getSaleOrderConsigneeTel() {
+        return saleOrderConsigneeTel;
+    }
+
+    public void setSaleOrderConsigneeTel(String saleOrderConsigneeTel) {
+        this.saleOrderConsigneeTel = saleOrderConsigneeTel == null ? null : saleOrderConsigneeTel.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;
+    }
+
+    public BigDecimal getUpdated() {
+        return updated;
+    }
+
+    public void setUpdated(BigDecimal updated) {
+        this.updated = updated;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", saleOrderMaterialId=").append(saleOrderMaterialId);
+        sb.append(", saleOrderId=").append(saleOrderId);
+        sb.append(", saleOrderMaterialTruckNo=").append(saleOrderMaterialTruckNo);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", saleOrderMaterialNumber=").append(saleOrderMaterialNumber);
+        sb.append(", materialTheoreticalWeight=").append(materialTheoreticalWeight);
+        sb.append(", saleShippingAddress=").append(saleShippingAddress);
+        sb.append(", saleDateOfReceipt=").append(saleDateOfReceipt);
+        sb.append(", saleOrderConsignee=").append(saleOrderConsignee);
+        sb.append(", saleOrderConsigneeTel=").append(saleOrderConsigneeTel);
+        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(", updated=").append(updated);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 199 - 0
src/main/java/com/steerinfo/dil/model/AmsSalePlan.java

@@ -0,0 +1,199 @@
+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 AmsSalePlan implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(PLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal planId;
+
+    /**
+     * 计划日期(PLAN_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="计划日期",required=false)
+    private Date planDate;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 物资件数(PLAN_MATERIAL_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资件数",required=false)
+    private BigDecimal planMaterialNumber;
+
+    /**
+     * 销售片区ID(SALE_AREA_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="销售片区ID",required=false)
+    private BigDecimal saleAreaId;
+
+    /**
+     * 记录创建人(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、是)(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除(0、否  1、是)",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.planId;
+    }
+
+    @Override
+    public void setId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public BigDecimal getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public Date getPlanDate() {
+        return planDate;
+    }
+
+    public void setPlanDate(Date planDate) {
+        this.planDate = planDate;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getPlanMaterialNumber() {
+        return planMaterialNumber;
+    }
+
+    public void setPlanMaterialNumber(BigDecimal planMaterialNumber) {
+        this.planMaterialNumber = planMaterialNumber;
+    }
+
+    public BigDecimal getSaleAreaId() {
+        return saleAreaId;
+    }
+
+    public void setSaleAreaId(BigDecimal saleAreaId) {
+        this.saleAreaId = saleAreaId;
+    }
+
+    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(", planId=").append(planId);
+        sb.append(", planDate=").append(planDate);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", planMaterialNumber=").append(planMaterialNumber);
+        sb.append(", saleAreaId=").append(saleAreaId);
+        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();
+    }
+}

+ 199 - 0
src/main/java/com/steerinfo/dil/model/AmstruckInwardPlan.java

@@ -0,0 +1,199 @@
+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 AmstruckInwardPlan implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(PLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal planId;
+
+    /**
+     * 运输计划号(PLAN_NUMBER,VARCHAR,20)
+     */
+    @ApiModelProperty(value="运输计划号",required=false)
+    private String planNumber;
+
+    /**
+     * 承运商ID(CARRIER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
+    /**
+     * 车数(PLAN_TRUCK_NUMBER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="车数",required=false)
+    private BigDecimal planTruckNumber;
+
+    /**
+     * 计划状态(0:未下发;1:已下发;2:已接收)(PLAN_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="计划状态(0:未下发;1:已下发;2:已接收)",required=false)
+    private BigDecimal planStatus;
+
+    /**
+     * 计划下发时间(PLAN_ISSUE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="计划下发时间",required=false)
+    private Date planIssueTime;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.planId;
+    }
+
+    @Override
+    public void setId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public BigDecimal getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public String getPlanNumber() {
+        return planNumber;
+    }
+
+    public void setPlanNumber(String planNumber) {
+        this.planNumber = planNumber == null ? null : planNumber.trim();
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
+    public BigDecimal getPlanTruckNumber() {
+        return planTruckNumber;
+    }
+
+    public void setPlanTruckNumber(BigDecimal planTruckNumber) {
+        this.planTruckNumber = planTruckNumber;
+    }
+
+    public BigDecimal getPlanStatus() {
+        return planStatus;
+    }
+
+    public void setPlanStatus(BigDecimal planStatus) {
+        this.planStatus = planStatus;
+    }
+
+    public Date getPlanIssueTime() {
+        return planIssueTime;
+    }
+
+    public void setPlanIssueTime(Date planIssueTime) {
+        this.planIssueTime = planIssueTime;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", planId=").append(planId);
+        sb.append(", planNumber=").append(planNumber);
+        sb.append(", carrierId=").append(carrierId);
+        sb.append(", planTruckNumber=").append(planTruckNumber);
+        sb.append(", planStatus=").append(planStatus);
+        sb.append(", planIssueTime=").append(planIssueTime);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 334 - 0
src/main/java/com/steerinfo/dil/model/AmstruckInwardRequirement.java

@@ -0,0 +1,334 @@
+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 AmstruckInwardRequirement implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(REQUIREMENT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal requirementId;
+
+    /**
+     * 采购订单ID(PURCHASE_ORDER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="采购订单ID",required=false)
+    private BigDecimal purchaseOrderId;
+
+    /**
+     * 运输需求号(REQUIREMENT_NUMBER,VARCHAR,20)
+     */
+    @ApiModelProperty(value="运输需求号",required=false)
+    private String requirementNumber;
+
+    /**
+     * 需求类型(0:计重;1:计时;2:计次;3:包月)(REQUIREMENT_TYPE,VARCHAR,6)
+     */
+    @ApiModelProperty(value="需求类型(0:计重;1:计时;2:计次;3:包月)",required=false)
+    private String requirementType;
+
+    /**
+     * 运力类型ID(CAPACITY_TYPE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="运力类型ID",required=false)
+    private BigDecimal capacityTypeId;
+
+    /**
+     * 用车时间(REQUIREMENT_TRUCK_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="用车时间",required=false)
+    private Date requirementTruckTime;
+
+    /**
+     * 用车单位ID(REQUIREMENT_SHIPPER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="用车单位ID",required=false)
+    private BigDecimal requirementShipperId;
+
+    /**
+     * 费用类别(日常内转费,推进办费用,大修费用,新增建设项目,外委吊车,外委转机,环保绿化项目)(REQUIREMENT_WORK_TYPE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="费用类别(日常内转费,推进办费用,大修费用,新增建设项目,外委吊车,外委转机,环保绿化项目)",required=false)
+    private BigDecimal requirementWorkType;
+
+    /**
+     * 作业内容(REQUIREMENT_WORK_CONTENT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="作业内容",required=false)
+    private String requirementWorkContent;
+
+    /**
+     * 作业路径ID(LINE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="作业路径ID",required=false)
+    private BigDecimal lineId;
+
+    /**
+     * 作业环境(REQUIREMENT_WORK_ENVIRONMENT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="作业环境",required=false)
+    private String requirementWorkEnvironment;
+
+    /**
+     * 预计作业时长(REQUIREMENT_ESTIMATED_DURATION,DECIMAL,0)
+     */
+    @ApiModelProperty(value="预计作业时长",required=false)
+    private Short requirementEstimatedDuration;
+
+    /**
+     * 是否超限(REQUIREMENT_OVERLIMIT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="是否超限",required=false)
+    private String requirementOverlimit;
+
+    /**
+     * 用车单位ID(REQUIREMNT_UNIT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="用车单位ID",required=false)
+    private BigDecimal requiremntUnitId;
+
+    /**
+     * 需求状态(0:未下发;1:已下发;2:已接收)(REQUIREMENT_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="需求状态(0:未下发;1:已下发;2:已接收)",required=false)
+    private BigDecimal requirementStatus;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.requirementId;
+    }
+
+    @Override
+    public void setId(BigDecimal requirementId) {
+        this.requirementId = requirementId;
+    }
+
+    public BigDecimal getRequirementId() {
+        return requirementId;
+    }
+
+    public void setRequirementId(BigDecimal requirementId) {
+        this.requirementId = requirementId;
+    }
+
+    public BigDecimal getPurchaseOrderId() {
+        return purchaseOrderId;
+    }
+
+    public void setPurchaseOrderId(BigDecimal purchaseOrderId) {
+        this.purchaseOrderId = purchaseOrderId;
+    }
+
+    public String getRequirementNumber() {
+        return requirementNumber;
+    }
+
+    public void setRequirementNumber(String requirementNumber) {
+        this.requirementNumber = requirementNumber == null ? null : requirementNumber.trim();
+    }
+
+    public String getRequirementType() {
+        return requirementType;
+    }
+
+    public void setRequirementType(String requirementType) {
+        this.requirementType = requirementType == null ? null : requirementType.trim();
+    }
+
+    public BigDecimal getCapacityTypeId() {
+        return capacityTypeId;
+    }
+
+    public void setCapacityTypeId(BigDecimal capacityTypeId) {
+        this.capacityTypeId = capacityTypeId;
+    }
+
+    public Date getRequirementTruckTime() {
+        return requirementTruckTime;
+    }
+
+    public void setRequirementTruckTime(Date requirementTruckTime) {
+        this.requirementTruckTime = requirementTruckTime;
+    }
+
+    public BigDecimal getRequirementShipperId() {
+        return requirementShipperId;
+    }
+
+    public void setRequirementShipperId(BigDecimal requirementShipperId) {
+        this.requirementShipperId = requirementShipperId;
+    }
+
+    public BigDecimal getRequirementWorkType() {
+        return requirementWorkType;
+    }
+
+    public void setRequirementWorkType(BigDecimal requirementWorkType) {
+        this.requirementWorkType = requirementWorkType;
+    }
+
+    public String getRequirementWorkContent() {
+        return requirementWorkContent;
+    }
+
+    public void setRequirementWorkContent(String requirementWorkContent) {
+        this.requirementWorkContent = requirementWorkContent == null ? null : requirementWorkContent.trim();
+    }
+
+    public BigDecimal getLineId() {
+        return lineId;
+    }
+
+    public void setLineId(BigDecimal lineId) {
+        this.lineId = lineId;
+    }
+
+    public String getRequirementWorkEnvironment() {
+        return requirementWorkEnvironment;
+    }
+
+    public void setRequirementWorkEnvironment(String requirementWorkEnvironment) {
+        this.requirementWorkEnvironment = requirementWorkEnvironment == null ? null : requirementWorkEnvironment.trim();
+    }
+
+    public Short getRequirementEstimatedDuration() {
+        return requirementEstimatedDuration;
+    }
+
+    public void setRequirementEstimatedDuration(Short requirementEstimatedDuration) {
+        this.requirementEstimatedDuration = requirementEstimatedDuration;
+    }
+
+    public String getRequirementOverlimit() {
+        return requirementOverlimit;
+    }
+
+    public void setRequirementOverlimit(String requirementOverlimit) {
+        this.requirementOverlimit = requirementOverlimit == null ? null : requirementOverlimit.trim();
+    }
+
+    public BigDecimal getRequiremntUnitId() {
+        return requiremntUnitId;
+    }
+
+    public void setRequiremntUnitId(BigDecimal requiremntUnitId) {
+        this.requiremntUnitId = requiremntUnitId;
+    }
+
+    public BigDecimal getRequirementStatus() {
+        return requirementStatus;
+    }
+
+    public void setRequirementStatus(BigDecimal requirementStatus) {
+        this.requirementStatus = requirementStatus;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", requirementId=").append(requirementId);
+        sb.append(", purchaseOrderId=").append(purchaseOrderId);
+        sb.append(", requirementNumber=").append(requirementNumber);
+        sb.append(", requirementType=").append(requirementType);
+        sb.append(", capacityTypeId=").append(capacityTypeId);
+        sb.append(", requirementTruckTime=").append(requirementTruckTime);
+        sb.append(", requirementShipperId=").append(requirementShipperId);
+        sb.append(", requirementWorkType=").append(requirementWorkType);
+        sb.append(", requirementWorkContent=").append(requirementWorkContent);
+        sb.append(", lineId=").append(lineId);
+        sb.append(", requirementWorkEnvironment=").append(requirementWorkEnvironment);
+        sb.append(", requirementEstimatedDuration=").append(requirementEstimatedDuration);
+        sb.append(", requirementOverlimit=").append(requirementOverlimit);
+        sb.append(", requiremntUnitId=").append(requiremntUnitId);
+        sb.append(", requirementStatus=").append(requirementStatus);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 274 - 0
src/main/java/com/steerinfo/dil/model/AmstruckRailDayplan.java

@@ -0,0 +1,274 @@
+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 AmstruckRailDayplan implements IBasePO<BigDecimal> {
+    /**
+     * 发运计划ID(DAYPLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发运计划ID",required=true)
+    private BigDecimal dayplanId;
+
+    /**
+     * 发运计划号(DAYPLAN_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="发运计划号",required=false)
+    private String dayplanNo;
+
+    /**
+     * 发货车数(DAYPLAN_TRUCK_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发货车数",required=false)
+    private BigDecimal dayplanTruckNumber;
+
+    /**
+     * 发货单位(托运人)(SHIPMENT_UNIT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发货单位(托运人)",required=false)
+    private BigDecimal shipmentUnitId;
+
+    /**
+     * 发货地(DAYPLAN_DELIVERY_PLACE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="发货地",required=false)
+    private String dayplanDeliveryPlace;
+
+    /**
+     * 收货单位(DAYPLAN_RECEIVE_UNIT,VARCHAR,20)
+     */
+    @ApiModelProperty(value="收货单位",required=false)
+    private String dayplanReceiveUnit;
+
+    /**
+     * 发货日期(DAYPLAN_DELIVERY_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="发货日期",required=false)
+    private Date dayplanDeliveryDate;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 物资重量(DAYPLAN_MATERIAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资重量",required=false)
+    private Short dayplanMaterialWeight;
+
+    /**
+     * 承运商ID(DAYPLAN_MATERIAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+    /**
+     * 接收状态(0:未接收;1:接收)(DAYPLAN_RECEIVE_STATUS,DECIMAL,38)
+     */
+    @ApiModelProperty(value="接收状态(0:未接收;1:接收)",required=false)
+    private BigDecimal dayplanReceiveStatus;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.dayplanId;
+    }
+
+    @Override
+    public void setId(BigDecimal dayplanId) {
+        this.dayplanId = dayplanId;
+    }
+
+    public BigDecimal getDayplanId() {
+        return dayplanId;
+    }
+
+    public void setDayplanId(BigDecimal dayplanId) {
+        this.dayplanId = dayplanId;
+    }
+
+    public String getDayplanNo() {
+        return dayplanNo;
+    }
+
+    public void setDayplanNo(String dayplanNo) {
+        this.dayplanNo = dayplanNo == null ? null : dayplanNo.trim();
+    }
+
+    public BigDecimal getDayplanTruckNumber() {
+        return dayplanTruckNumber;
+    }
+
+    public void setDayplanTruckNumber(BigDecimal dayplanTruckNumber) {
+        this.dayplanTruckNumber = dayplanTruckNumber;
+    }
+
+    public BigDecimal getShipmentUnitId() {
+        return shipmentUnitId;
+    }
+
+    public void setShipmentUnitId(BigDecimal shipmentUnitId) {
+        this.shipmentUnitId = shipmentUnitId;
+    }
+
+    public String getDayplanDeliveryPlace() {
+        return dayplanDeliveryPlace;
+    }
+
+    public void setDayplanDeliveryPlace(String dayplanDeliveryPlace) {
+        this.dayplanDeliveryPlace = dayplanDeliveryPlace == null ? null : dayplanDeliveryPlace.trim();
+    }
+
+    public String getDayplanReceiveUnit() {
+        return dayplanReceiveUnit;
+    }
+
+    public void setDayplanReceiveUnit(String dayplanReceiveUnit) {
+        this.dayplanReceiveUnit = dayplanReceiveUnit == null ? null : dayplanReceiveUnit.trim();
+    }
+
+    public Date getDayplanDeliveryDate() {
+        return dayplanDeliveryDate;
+    }
+
+    public void setDayplanDeliveryDate(Date dayplanDeliveryDate) {
+        this.dayplanDeliveryDate = dayplanDeliveryDate;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public Short getDayplanMaterialWeight() {
+        return dayplanMaterialWeight;
+    }
+
+    public void setDayplanMaterialWeight(Short dayplanMaterialWeight) {
+        this.dayplanMaterialWeight = dayplanMaterialWeight;
+    }
+
+    public BigDecimal getDayplanReceiveStatus() {
+        return dayplanReceiveStatus;
+    }
+
+    public void setDayplanReceiveStatus(BigDecimal dayplanReceiveStatus) {
+        this.dayplanReceiveStatus = dayplanReceiveStatus;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", dayplanId=").append(dayplanId);
+        sb.append(", dayplanNo=").append(dayplanNo);
+        sb.append(", dayplanTruckNumber=").append(dayplanTruckNumber);
+        sb.append(", shipmentUnitId=").append(shipmentUnitId);
+        sb.append(", dayplanDeliveryPlace=").append(dayplanDeliveryPlace);
+        sb.append(", dayplanReceiveUnit=").append(dayplanReceiveUnit);
+        sb.append(", dayplanDeliveryDate=").append(dayplanDeliveryDate);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", dayplanMaterialWeight=").append(dayplanMaterialWeight);
+        sb.append(", dayplanReceiveStatus=").append(dayplanReceiveStatus);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 154 - 0
src/main/java/com/steerinfo/dil/model/AmstruckRequirementPlan.java

@@ -0,0 +1,154 @@
+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 AmstruckRequirementPlan implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(REQUIREMENT_PLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal requirementPlanId;
+
+    /**
+     * 计划ID(PLAN_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="计划ID",required=false)
+    private BigDecimal planId;
+
+    /**
+     * 需求ID(REQUIREMENT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="需求ID",required=false)
+    private BigDecimal requirementId;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.requirementPlanId;
+    }
+
+    @Override
+    public void setId(BigDecimal requirementPlanId) {
+        this.requirementPlanId = requirementPlanId;
+    }
+
+    public BigDecimal getRequirementPlanId() {
+        return requirementPlanId;
+    }
+
+    public void setRequirementPlanId(BigDecimal requirementPlanId) {
+        this.requirementPlanId = requirementPlanId;
+    }
+
+    public BigDecimal getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(BigDecimal planId) {
+        this.planId = planId;
+    }
+
+    public BigDecimal getRequirementId() {
+        return requirementId;
+    }
+
+    public void setRequirementId(BigDecimal requirementId) {
+        this.requirementId = requirementId;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", requirementPlanId=").append(requirementPlanId);
+        sb.append(", planId=").append(planId);
+        sb.append(", requirementId=").append(requirementId);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 32 - 0
src/main/java/com/steerinfo/dil/service/IAmsDispatchSaleOrderService.java

@@ -0,0 +1,32 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmsDispatchSaleOrder;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsDispatchSaleOrder服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-10 03:59
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-10
+ * 作者:generator
+ * 参考:
+ * 描述:AmsDispatchSaleOrder服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmsDispatchSaleOrderService{
+    List<Map<String, Object>> getOpenDispatchSaleOrder(Map<String, Object> mapValue);
+
+    /**
+     * 得到最大id
+     * @return
+     */
+    BigDecimal selectMaxId();
+    //新增固定派单
+    int insert(AmsDispatchSaleOrder ad);
+}

+ 37 - 0
src/main/java/com/steerinfo/dil/service/IAmsRailOffsetDayplanService.java

@@ -0,0 +1,37 @@
+package com.steerinfo.dil.service;
+
+
+import com.steerinfo.dil.model.AmsRailOffsetDayplan;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsRailOffsetDayplan服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 04:17
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:generator
+ * 参考:
+ * 描述:AmsRailOffsetDayplan服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmsRailOffsetDayplanService extends IBaseService<AmsRailOffsetDayplan, BigDecimal> {
+    /**
+     * 得到最大id
+     * @return
+     */
+    Integer selectMaxId();
+
+    List<Map<String, Object>> getRailOffsetDayplan(Map<String, Object> mapValue);
+    //新增钢材发往异地库日计划
+    int insert(AmsRailOffsetDayplan amsRailOffsetDayplan);
+
+    //修改钢材发往异地库日计划
+    int update(AmsRailOffsetDayplan amsRailOffsetDayplan);
+}

+ 40 - 0
src/main/java/com/steerinfo/dil/service/IAmsSaleOrderMaterialService.java

@@ -0,0 +1,40 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmsSaleOrderMaterial;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrderMaterial服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrderMaterial服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmsSaleOrderMaterialService{
+    //新增销售订单物资信息
+    int addAmsSaleOrderMaterial(AmsSaleOrderMaterial amsSaleOrderMaterial);
+    //获取要渲染的值
+    List<Map<String, Object>> selectBySaleOrderMaterialId(BigDecimal saleOrderMaterialId);
+    //修改销售订单物资信息
+    int updateAmsSaleOrderMaterial(AmsSaleOrderMaterial amsSaleOrderMaterial);
+    //通过主键删除销售订单物资信息
+    int deleteAmsSaleOrderMaterialBySaleOrderMaterialId(BigDecimal saleOrderMaterialId);
+    //通过主键获得收货地址
+    String getAddress(BigDecimal saleOrderMaterialId);
+    //通过主键修改销售订单信息(新增一条),过去的成为历史记录
+    int updateAddress(AmsSaleOrderMaterial amsSaleOrderMaterial);
+
+    List<Map<String, Object>> getSaleMaterial(Map<String, Object> mapValue);
+    Integer selectById(BigDecimal saleOrderMaterialId);
+
+    Integer selectByCxh(Map<String, Object> m);
+}

+ 53 - 0
src/main/java/com/steerinfo/dil/service/IAmsSaleOrderService.java

@@ -0,0 +1,53 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmsSaleOrder;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrder服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrder服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmsSaleOrderService{
+    //查询所有未上报销售订单信息
+    List<Map<String, Object>> getSaleOrderInfo(Map<String,Object> map);
+    //查询所有已上报销售订单信息
+    List<Map<String, Object>> getSaleOrderReported(Map<String,Object> map);
+    //根据车序号查询销售订单详细
+    List<Map<String, Object>> getSaleOrderDetail(Map<String,Object> map);
+    //获取销售片区
+    List<Map<String, Object>> getSaleArea();
+    //获取发货单位
+    List<Map<String, Object>> getShipperName();
+    //获取收货单位
+    List<Map<String, Object>> getConsigneeCompanyName();
+    //新增销售订单
+    int addAmsSaleOrder(AmsSaleOrder amsSaleOrder);
+    //修改销售订单状态为已上报
+    int uploadSaleOrder(BigDecimal saleOrderId);
+    //获取要渲染的数据
+    List<Map<String, Object>> selectBySaleOrderId(BigDecimal saleOrderId);
+    //修改销售订单信息
+    int updateAmsSaleOrder(AmsSaleOrder amsSaleOrder);
+    //通过主键删除销售订单及其从表使用信息
+    int deleteAmsSaleOrderBySaleOrderId(BigDecimal saleOrderId);
+    //查询所有财务已经审批的销售订单
+    List<Map<String, Object>> getAmsSaleOrderApproved(Map<String,Object> map);
+    //通过销售订单号查询销售订单的修改日志
+    List<Map<String, Object>> getSaleOrderUpdateLog(Map<String,Object> map);
+
+    List<Map<String,Object>> getSaleOrderList(Map<String,Object> mapValue);
+
+    List<Integer> getCarrier(Integer integer);
+}

+ 37 - 0
src/main/java/com/steerinfo/dil/service/IAmsSalePlanService.java

@@ -0,0 +1,37 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmsSalePlan;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSalePlan服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSalePlan服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmsSalePlanService{
+    //查询所有销售计划信息
+    List<Map<String, Object>> getSalePlanInfo(Map<String,Object> map);
+    //新增销售计划
+    int addAmsSalePlan(AmsSalePlan amsSalePlan);
+    //获得规格型号
+    List<Map<String, Object>> getMaterialName();
+    //获得销售片区名称
+    List<Map<String, Object>> getAreaName();
+    //获得要渲染的数据
+    List<Map<String, Object>> selectByPlanId(BigDecimal planId);
+    //修改销售计划
+    int updateAmsSalePlan(AmsSalePlan amsSalePlan);
+    //删除销售计划
+    int deleteAmsSalePlan(BigDecimal planId);
+}

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

@@ -0,0 +1,28 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmstruckInwardPlan;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardPlan服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 03:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardPlan服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmstruckInwardPlanService extends IBaseService<AmstruckInwardPlan, BigDecimal> {
+
+    int insert(Map<String,Object> mapValue);
+
+    List<Map<String, Object>> getTruckPlanList(Map<String, Object> mapValue);
+}

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

@@ -0,0 +1,28 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmstruckInwardRequirement;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardRequirement服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 11:30
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardRequirement服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmstruckInwardRequirementService extends IBaseService<AmstruckInwardRequirement, BigDecimal> {
+
+    int insert(AmstruckInwardRequirement amstruckInwardRequirement);
+
+    List<Map<String, Object>> getTruckRequirementList(Map<String, Object> mapValue);
+}

+ 38 - 0
src/main/java/com/steerinfo/dil/service/IAmstruckRailDayplanService.java

@@ -0,0 +1,38 @@
+package com.steerinfo.dil.service;
+
+
+import com.steerinfo.dil.model.AmstruckRailDayplan;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckRailDayplan服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 02:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckRailDayplan服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmstruckRailDayplanService extends IBaseService<AmstruckRailDayplan, BigDecimal> {
+    /**
+     * 得到最大id
+     * @return
+     */
+    BigDecimal selectMaxId();
+
+    List<Map<String, Object>> getTruckRailDayPlan(Map<String, Object> mapValue);
+
+    int insert(AmstruckRailDayplan amstruckRailDayplan);
+
+    List<Map<String, Object>> getSzTruckRailDayPlan(Map<String, Object> mapValue);
+
+    AmstruckRailDayplan selectByDayPlanId(Integer dayplanId);
+}

+ 24 - 0
src/main/java/com/steerinfo/dil/service/IAmstruckRequirementPlanService.java

@@ -0,0 +1,24 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.AmstruckRequirementPlan;
+import com.steerinfo.framework.service.IBaseService;
+
+import java.math.BigDecimal;
+
+/**
+ * AmstruckRequirementPlan服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-30 03:41
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-30
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckRequirementPlan服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IAmstruckRequirementPlanService extends IBaseService<AmstruckRequirementPlan, BigDecimal>{
+
+    int insert(BigDecimal requirementId, BigDecimal planId);
+}

+ 60 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsDispatchSaleOrderServiceImpl.java

@@ -0,0 +1,60 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmsDispatchSaleOrderMapper;
+import com.steerinfo.dil.model.AmsDispatchSaleOrder;
+import com.steerinfo.dil.service.IAmsDispatchSaleOrderService;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsDispatchSaleOrder服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-10 03:59
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-10
+ * 作者:generator
+ * 参考:
+ * 描述:AmsDispatchSaleOrder服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amsDispatchSaleOrderService")
+public class AmsDispatchSaleOrderServiceImpl extends BaseServiceImpl<AmsDispatchSaleOrder, BigDecimal> implements IAmsDispatchSaleOrderService {
+
+    @Autowired
+    private AmsDispatchSaleOrderMapper amsDispatchSaleOrderMapper;
+
+    @Override
+    protected IBaseMapper<AmsDispatchSaleOrder, BigDecimal> getMapper() {
+        return amsDispatchSaleOrderMapper;
+    }
+
+    public List<Map<String, Object>> getOpenDispatchSaleOrder(Map<String, Object> mapValue) {
+        return amsDispatchSaleOrderMapper.getOpenDispatchSaleOrder(mapValue);
+    }
+
+    /**
+     * 查询最大id
+     * @return
+     */
+    @Override
+    public BigDecimal selectMaxId() {
+
+        return amsDispatchSaleOrderMapper.selectOtherId();
+    }
+
+    public int insert(AmsDispatchSaleOrder ad) {
+        ad.setDispatchTime(new Date());
+        ad.setInsertTime(new Date());
+        ad.setInsertUsername("admin");
+        return amsDispatchSaleOrderMapper.insertSelective(ad);
+    }
+}

+ 67 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsRailOffsetDayplanServiceImpl.java

@@ -0,0 +1,67 @@
+package com.steerinfo.dil.service.impl;
+
+
+import com.steerinfo.dil.mapper.AmsRailOffsetDayplanMapper;
+import com.steerinfo.dil.model.AmsRailOffsetDayplan;
+import com.steerinfo.dil.service.IAmsRailOffsetDayplanService;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsRailOffsetDayplan服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 04:17
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:generator
+ * 参考:
+ * 描述:AmsRailOffsetDayplan服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amsRailOffsetDayplanService")
+public class AmsRailOffsetDayplanServiceImpl extends BaseServiceImpl<AmsRailOffsetDayplan, BigDecimal> implements IAmsRailOffsetDayplanService {
+
+    @Autowired
+    private AmsRailOffsetDayplanMapper amsRailOffsetDayplanMapper;
+
+    @Override
+    protected IBaseMapper<AmsRailOffsetDayplan, BigDecimal> getMapper() {
+        return amsRailOffsetDayplanMapper;
+    }
+
+    /**
+     * 查询最大id
+     * @return
+     */
+    @Override
+    public Integer selectMaxId() {
+
+        return amsRailOffsetDayplanMapper.selectOtherId();
+    }
+
+    public List<Map<String, Object>> getRailOffsetDayplan(Map<String, Object> mapValue) {
+        return amsRailOffsetDayplanMapper.getRailOffsetDayplan(mapValue);
+    }
+    @Override
+    public int insert(AmsRailOffsetDayplan amsRailOffsetDayplan) {
+        amsRailOffsetDayplan.setDayplanId(selectMaxId());
+        amsRailOffsetDayplan.setInsertTime(new Date());
+        amsRailOffsetDayplan.setUpdateTime(new Date());
+        amsRailOffsetDayplan.setInsertUsername("admin");
+        amsRailOffsetDayplan.setUpdateUsername("admin");
+        return amsRailOffsetDayplanMapper.insertSelective(amsRailOffsetDayplan);
+    }
+
+    public int update(AmsRailOffsetDayplan amsRailOffsetDayplan) {
+        return amsRailOffsetDayplanMapper.updateByPrimaryKey(amsRailOffsetDayplan);
+    }
+}

+ 110 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderMaterialServiceImpl.java

@@ -0,0 +1,110 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmsSaleOrderMaterialMapper;
+import com.steerinfo.dil.model.AmsSaleOrderMaterial;
+import com.steerinfo.dil.service.IAmsSaleOrderMaterialService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrderMaterial服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrderMaterial服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amsSaleOrderMaterialService")
+public class AmsSaleOrderMaterialServiceImpl implements IAmsSaleOrderMaterialService {
+
+    @Autowired
+    private AmsSaleOrderMaterialMapper amsSaleOrderMaterialMapper;
+
+    @Override
+    public int addAmsSaleOrderMaterial(AmsSaleOrderMaterial amsSaleOrderMaterial) {
+        long id;
+        if(amsSaleOrderMaterialMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = amsSaleOrderMaterialMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        amsSaleOrderMaterial.setSaleOrderMaterialId(new BigDecimal(id));
+        //常规字段
+        amsSaleOrderMaterial.setInsertUsername("admin");
+        amsSaleOrderMaterial.setInsertTime(new Date());
+        amsSaleOrderMaterial.setUpdateUsername("admin");
+        amsSaleOrderMaterial.setUpdateTime(new Date());
+        amsSaleOrderMaterial.setInsertUpdateRemark("无");
+        amsSaleOrderMaterial.setDeleted(new BigDecimal(0));
+        return amsSaleOrderMaterialMapper.insert(amsSaleOrderMaterial);
+    }
+
+    @Override
+    public List<Map<String, Object>> selectBySaleOrderMaterialId(BigDecimal saleOrderMaterialId) {
+        return amsSaleOrderMaterialMapper.selectBySaleOrderMaterialId(saleOrderMaterialId);
+    }
+
+    @Override
+    public int updateAmsSaleOrderMaterial(AmsSaleOrderMaterial amsSaleOrderMaterial) {
+        amsSaleOrderMaterial.setUpdateTime(new Date());
+        return amsSaleOrderMaterialMapper.updateByPrimaryKeySelective(amsSaleOrderMaterial);
+    }
+
+    @Override
+    public int deleteAmsSaleOrderMaterialBySaleOrderMaterialId(BigDecimal saleOrderMaterialId) {
+        AmsSaleOrderMaterial amsSaleOrderMaterial = amsSaleOrderMaterialMapper.selectByPrimaryKey(saleOrderMaterialId);
+        amsSaleOrderMaterial.setDeleted(new BigDecimal(1));
+        return amsSaleOrderMaterialMapper.updateByPrimaryKey(amsSaleOrderMaterial);
+    }
+
+    @Override
+    public String getAddress(BigDecimal saleOrderMaterialId) {
+        return amsSaleOrderMaterialMapper.getAddress(saleOrderMaterialId);
+    }
+
+    @Override
+    public int updateAddress(AmsSaleOrderMaterial amsSaleOrderMaterial) {
+        BigDecimal saleOrderMaterialId = amsSaleOrderMaterial.getSaleOrderMaterialId();
+        AmsSaleOrderMaterial amsSaleOrderMaterial1 = amsSaleOrderMaterialMapper.selectByPrimaryKey(saleOrderMaterialId);
+        String saleShippingAddress = amsSaleOrderMaterial1.getSaleShippingAddress();
+        long id;
+        if(amsSaleOrderMaterialMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = amsSaleOrderMaterialMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        amsSaleOrderMaterial1.setSaleOrderMaterialId(new BigDecimal(id));
+        amsSaleOrderMaterial1.setSaleShippingAddress(amsSaleOrderMaterial.getSaleShippingAddress());
+        //新增修改了地址的数据
+        System.out.println("amsSaleOrderMaterial1 = "+amsSaleOrderMaterial1);
+        amsSaleOrderMaterialMapper.insert(amsSaleOrderMaterial1);
+        //地址回插
+        amsSaleOrderMaterial.setSaleShippingAddress(saleShippingAddress);
+        amsSaleOrderMaterial.setUpdated(new BigDecimal(1));
+        return amsSaleOrderMaterialMapper.updateByPrimaryKeySelective(amsSaleOrderMaterial);
+    }
+    public List<Map<String, Object>> getSaleMaterial(Map<String, Object> mapValue) {
+        return amsSaleOrderMaterialMapper.getSaleMaterial(mapValue);
+    }
+
+
+    public Integer selectById(BigDecimal saleOrderMaterialId) {
+        return amsSaleOrderMaterialMapper.selectById(saleOrderMaterialId);
+    }
+
+    public Integer selectByCxh(Map<String, Object> m) {
+        return amsSaleOrderMaterialMapper.selectByCxh(m);
+    }
+}

+ 170 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -0,0 +1,170 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmsSaleOrderMapper;
+import com.steerinfo.dil.model.AmsSaleOrder;
+import com.steerinfo.dil.service.IAmsSaleOrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSaleOrder服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSaleOrder服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amsSaleOrderService")
+public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
+
+    @Autowired
+    private AmsSaleOrderMapper amsSaleOrderMapper;
+
+    @Override
+    public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
+        return amsSaleOrderMapper.getSaleOrderInfo(map);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSaleOrderReported(Map<String, Object> map) {
+        return amsSaleOrderMapper.getSaleOrderReported(map);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSaleOrderDetail(Map<String,Object> map) {
+        return amsSaleOrderMapper.getSaleOrderDetail(map);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSaleArea() {
+        return amsSaleOrderMapper.getSaleArea();
+    }
+
+    @Override
+    public List<Map<String, Object>> getShipperName() {
+        return amsSaleOrderMapper.getShipperName();
+    }
+
+    @Override
+    public List<Map<String, Object>> getConsigneeCompanyName() {
+        return amsSaleOrderMapper.getConsigneeCompanyName();
+    }
+
+    @Override
+    public int addAmsSaleOrder(AmsSaleOrder amsSaleOrder) {
+        long id;
+        if(amsSaleOrderMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = amsSaleOrderMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        amsSaleOrder.setSaleOrderId(new BigDecimal(id));
+        //WXSDD-年月日-8位数的顺序号
+        Calendar now = Calendar.getInstance();
+        String number = "WXSDD-" +  now.get(Calendar.YEAR);
+        if (now.get(Calendar.MONTH)+1 < 10) {
+            number = number + "0" + (now.get(Calendar.MONTH)+1);
+        }
+        else {
+            number = number + now.get(Calendar.MONTH)+1;
+        }
+        if(now.get(now.DAY_OF_MONTH)<10){
+            number = number + "0" + now.get(now.DAY_OF_MONTH)+"-";
+        }
+        else {
+            number = number + now.get(now.DAY_OF_MONTH)+"-";
+        }
+        switch ((new BigDecimal(id).toString()).length()) {
+            case 1:
+                number = number + "0000000" + id;
+                break;
+            case 2:
+                number = number + "000000" + id;
+                break;
+            case 3:
+                number = number + "00000" + id;
+                break;
+            case 4:
+                number = number + "0000" + id;
+                break;
+            case 5:
+                number = number + "000" + id;
+                break;
+            case 6:
+                number = number + "00" + id;
+                break;
+            case 7:
+                number = number + "0" + id;
+                break;
+            default:number = number + id;
+        }
+        amsSaleOrder.setSaleNumber(number);
+        amsSaleOrder.setSaleOrderStatus(new BigDecimal(0));
+        amsSaleOrder.setSaleUnitPrice(new BigDecimal(4000));
+        amsSaleOrder.setSaleOrderTax("13%");
+        amsSaleOrder.setInsertUsername("admin");
+        amsSaleOrder.setInsertTime(new Date());
+        amsSaleOrder.setUpdateUsername("admin");
+        amsSaleOrder.setUpdateTime(new Date());
+        amsSaleOrder.setInsertUpdateRemark("无");
+        amsSaleOrder.setDeleted(new BigDecimal(0));
+        return amsSaleOrderMapper.insert(amsSaleOrder);
+    }
+
+    @Override
+    public int uploadSaleOrder(BigDecimal saleOrderId) {
+        AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
+        amsSaleOrder.setSaleOrderStatus(new BigDecimal(1));
+        return amsSaleOrderMapper.updateByPrimaryKey(amsSaleOrder);
+    }
+
+    @Override
+    public List<Map<String, Object>> selectBySaleOrderId(BigDecimal saleOrderId) {
+        return amsSaleOrderMapper.selectBySaleOrderId(saleOrderId);
+    }
+
+    @Override
+    public int updateAmsSaleOrder(AmsSaleOrder amsSaleOrder) {
+        amsSaleOrder.setUpdateTime(new Date());
+        return amsSaleOrderMapper.updateByPrimaryKeySelective(amsSaleOrder);
+    }
+
+    @Override
+    public int deleteAmsSaleOrderBySaleOrderId(BigDecimal saleOrderId) {
+        //删除所有从表信息
+        amsSaleOrderMapper.deleteBySaleOrderId(saleOrderId);
+        AmsSaleOrder amsSaleOrder = amsSaleOrderMapper.selectByPrimaryKey(saleOrderId);
+        amsSaleOrder.setDeleted(new BigDecimal(1));
+        return amsSaleOrderMapper.updateByPrimaryKey(amsSaleOrder);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSaleOrderUpdateLog(Map<String, Object> map) {
+        return amsSaleOrderMapper.getSaleOrderUpdateLog(map);
+    }
+
+    @Override
+    public List<Map<String, Object>> getAmsSaleOrderApproved(Map<String, Object> map) {
+        return amsSaleOrderMapper.getAmsSaleOrderApproved(map);
+    }
+    @Override
+    public List<Map<String, Object>> getSaleOrderList(Map<String, Object> mapValue) {
+        return amsSaleOrderMapper.getSaleOrderList(mapValue);
+    }
+
+    public List<Integer>  getCarrier(Integer integer) {
+        return amsSaleOrderMapper.getCarrier(integer);
+    }
+}

+ 81 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsSalePlanServiceImpl.java

@@ -0,0 +1,81 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmsSalePlanMapper;
+import com.steerinfo.dil.model.AmsSalePlan;
+import com.steerinfo.dil.service.IAmsSalePlanService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmsSalePlan服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-09-06 07:10
+ * 类描述
+ * 修订历史:
+ * 日期:2021-09-06
+ * 作者:generator
+ * 参考:
+ * 描述:AmsSalePlan服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amsSalePlanService")
+public class AmsSalePlanServiceImpl implements IAmsSalePlanService {
+
+    @Autowired
+    private AmsSalePlanMapper amsSalePlanMapper;
+
+    @Override
+    public int deleteAmsSalePlan(BigDecimal planId) {
+        AmsSalePlan amsSalePlan = amsSalePlanMapper.selectByPrimaryKey(planId);
+        amsSalePlan.setDeleted(new BigDecimal(1));
+        return amsSalePlanMapper.updateByPrimaryKey(amsSalePlan);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSalePlanInfo(Map<String, Object> map) {
+        return amsSalePlanMapper.getSalePlanInfo(map);
+    }
+
+    @Override
+    public int addAmsSalePlan(AmsSalePlan amsSalePlan) {
+        long id;
+        if(amsSalePlanMapper.selectMaxId()==null){
+            id = 1;
+        }else {
+            id = amsSalePlanMapper.selectMaxId().longValue()+1;
+        }
+        //生成主键id
+        amsSalePlan.setPlanId(new BigDecimal(id));
+        amsSalePlan.setUpdateUsername("admin");
+        amsSalePlan.setUpdateTime(new Date());
+        amsSalePlan.setDeleted(new BigDecimal(0));
+        return amsSalePlanMapper.insert(amsSalePlan);
+    }
+
+    @Override
+    public List<Map<String, Object>> getMaterialName() {
+        return amsSalePlanMapper.getMaterialName();
+    }
+
+    @Override
+    public List<Map<String, Object>> getAreaName() {
+        return amsSalePlanMapper.getAreaName();
+    }
+
+    @Override
+    public List<Map<String, Object>> selectByPlanId(BigDecimal planId) {
+        return amsSalePlanMapper.selectByPlanId(planId);
+    }
+
+    @Override
+    public int updateAmsSalePlan(AmsSalePlan amsSalePlan) {
+        amsSalePlan.setUpdateTime(new Date());
+        return amsSalePlanMapper.updateByPrimaryKeySelective(amsSalePlan);
+    }
+}

+ 84 - 0
src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardPlanServiceImpl.java

@@ -0,0 +1,84 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmstruckInwardPlanMapper;
+import com.steerinfo.dil.model.AmstruckInwardPlan;
+import com.steerinfo.dil.model.AmstruckInwardRequirement;
+import com.steerinfo.dil.service.IAmstruckInwardPlanService;
+import com.steerinfo.dil.service.IAmstruckInwardRequirementService;
+import com.steerinfo.dil.service.IAmstruckRequirementPlanService;
+import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardPlan服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 03:21
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardPlan服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amstruckInwardPlanService")
+public class AmstruckInwardPlanServiceImpl extends BaseServiceImpl<AmstruckInwardPlan, BigDecimal> implements IAmstruckInwardPlanService {
+
+    @Autowired
+    private AmstruckInwardPlanMapper amstruckInwardPlanMapper;
+    @Autowired
+    private IAmstruckInwardRequirementService amstruckInwardRequirementService;
+    @Autowired
+    private IAmstruckRequirementPlanService amstruckRequirementPlanService;
+    @Override
+    protected IBaseMapper<AmstruckInwardPlan, BigDecimal> getMapper() {
+        return amstruckInwardPlanMapper;
+    }
+
+    @Override
+    public int insert(Map<String,Object> mapValue) {
+        BigDecimal requirementId=new BigDecimal(mapValue.get("requirementId").toString());
+        //修改需求的状态为已接受
+        AmstruckInwardRequirement amstruckInwardRequirement =new AmstruckInwardRequirement();
+        amstruckInwardRequirement.setRequirementId(requirementId);
+        amstruckInwardRequirement.setRequirementStatus(new BigDecimal(2));
+        amstruckInwardRequirement.setUpdateTime(new Date());
+        amstruckInwardRequirement.setUpdateUsername("damin");
+        amstruckInwardRequirementService.modify(amstruckInwardRequirement);
+
+        BigDecimal planId=amstruckInwardPlanMapper.selectOtherId();
+        //在中间表中将需求与计划绑定
+        amstruckRequirementPlanService.insert(requirementId,planId);
+        AmstruckInwardPlan amstruckInwardPlan=new AmstruckInwardPlan();
+        //设置主键
+        amstruckInwardPlan.setPlanId(planId);
+        //获取承运商id,车数
+        BigDecimal carrierId=new BigDecimal(mapValue.get("carrierId").toString());
+        BigDecimal planTruckNumber=new BigDecimal(mapValue.get("planTruckNumber").toString());
+        amstruckInwardPlan.setCarrierId(carrierId);
+        amstruckInwardPlan.setPlanTruckNumber(planTruckNumber);
+        DataChange dataChange=new DataChange();
+        amstruckInwardPlan.setPlanNumber(dataChange.generateEightDigitsNumber("YSJH",amstruckInwardPlanMapper.selectOtherId().intValue()));
+        //设置计划状态为未下发
+        amstruckInwardPlan.setPlanStatus(new BigDecimal(0));
+        // 设置常规字段
+        amstruckInwardPlan.setInsertTime(new Date());
+        amstruckInwardPlan.setInsertUsername("admin");
+        amstruckInwardPlan.setInsertUpdateRemark("无");
+        return amstruckInwardPlanMapper.insertSelective(amstruckInwardPlan);
+    }
+
+    @Override
+    public List<Map<String, Object>> getTruckPlanList(Map<String, Object> mapValue) {
+        return amstruckInwardPlanMapper.getTruckPlanList(mapValue);
+    }
+}

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

@@ -0,0 +1,60 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmstruckInwardRequirementMapper;
+import com.steerinfo.dil.model.AmstruckInwardRequirement;
+import com.steerinfo.dil.service.IAmstruckInwardRequirementService;
+import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckInwardRequirement服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-25 11:30
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-25
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckInwardRequirement服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amstruckInwardRequirementService")
+public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<AmstruckInwardRequirement, BigDecimal> implements IAmstruckInwardRequirementService {
+
+    @Autowired
+    private AmstruckInwardRequirementMapper amstruckInwardRequirementMapper;
+
+    @Override
+    protected IBaseMapper<AmstruckInwardRequirement, BigDecimal> getMapper() {
+        return amstruckInwardRequirementMapper;
+    }
+
+
+    @Override
+    public int insert(AmstruckInwardRequirement amstruckInwardRequirement) {
+        //设置主键
+        amstruckInwardRequirement.setRequirementId(amstruckInwardRequirementMapper.selectOtherId());
+        DataChange dataChange=new DataChange();
+        amstruckInwardRequirement.setRequirementNumber(dataChange.generateEightDigitsNumber("YSXQ",amstruckInwardRequirementMapper.selectOtherId().intValue()));
+        amstruckInwardRequirement.setRequirementStatus(new BigDecimal(0));
+        // 设置常规字段
+        amstruckInwardRequirement.setInsertTime(new Date());
+        amstruckInwardRequirement.setInsertUsername("admin");
+        amstruckInwardRequirement.setInsertUpdateRemark("无");
+        return amstruckInwardRequirementMapper.insertSelective(amstruckInwardRequirement);
+    }
+
+    @Override
+    public List<Map<String, Object>> getTruckRequirementList(Map<String, Object> mapValue) {
+        return amstruckInwardRequirementMapper.getTruckRequirementList(mapValue);
+    }
+}

+ 74 - 0
src/main/java/com/steerinfo/dil/service/impl/AmstruckRailDayplanServiceImpl.java

@@ -0,0 +1,74 @@
+package com.steerinfo.dil.service.impl;
+
+
+import com.steerinfo.dil.mapper.AmstruckRailDayplanMapper;
+import com.steerinfo.dil.model.AmstruckRailDayplan;
+import com.steerinfo.dil.service.IAmstruckRailDayplanService;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * AmstruckRailDayplan服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-16 02:43
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-16
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckRailDayplan服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amstruckRailDayplanService")
+public class AmstruckRailDayplanServiceImpl extends BaseServiceImpl<AmstruckRailDayplan, BigDecimal> implements IAmstruckRailDayplanService {
+
+    @Autowired
+    private AmstruckRailDayplanMapper amstruckRailDayplanMapper;
+
+    @Override
+    protected IBaseMapper<AmstruckRailDayplan, BigDecimal> getMapper() {
+        return amstruckRailDayplanMapper;
+    }
+
+    /**
+     * 查询最大id
+     * @return
+     */
+    @Override
+    public BigDecimal selectMaxId() {
+
+        return amstruckRailDayplanMapper.selectOtherId();
+    }
+
+    @Override
+    public List<Map<String, Object>> getTruckRailDayPlan(Map<String, Object> mapValue) {
+        return amstruckRailDayplanMapper.getTruckRailDayPlan(mapValue);
+    }
+    @Override
+    public int insert(AmstruckRailDayplan amstruckRailDayplan) {
+        amstruckRailDayplan.setDayplanId(selectMaxId());
+        amstruckRailDayplan.setInsertTime(new Date());
+        amstruckRailDayplan.setUpdateTime(new Date());
+        amstruckRailDayplan.setInsertUsername("admin");
+        amstruckRailDayplan.setUpdateUsername("admin");
+        return amstruckRailDayplanMapper.insertSelective(amstruckRailDayplan);
+    }
+
+    @Override
+    public List<Map<String, Object>> getSzTruckRailDayPlan(Map<String, Object> mapValue) {
+        return amstruckRailDayplanMapper.getSzTruckRailDayPlan(mapValue);
+    }
+
+    @Override
+    public AmstruckRailDayplan selectByDayPlanId(Integer dayplanId) {
+        return amstruckRailDayplanMapper.selectByDayPlanId(dayplanId);
+    }
+}

+ 48 - 0
src/main/java/com/steerinfo/dil/service/impl/AmstruckRequirementPlanServiceImpl.java

@@ -0,0 +1,48 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.AmstruckRequirementPlanMapper;
+import com.steerinfo.dil.model.AmstruckRequirementPlan;
+import com.steerinfo.dil.service.IAmstruckRequirementPlanService;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * AmstruckRequirementPlan服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2021-10-30 03:41
+ * 类描述
+ * 修订历史:
+ * 日期:2021-10-30
+ * 作者:generator
+ * 参考:
+ * 描述:AmstruckRequirementPlan服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "amstruckRequirementPlanService")
+public class AmstruckRequirementPlanServiceImpl extends BaseServiceImpl<AmstruckRequirementPlan, BigDecimal> implements IAmstruckRequirementPlanService {
+
+    @Autowired
+    private AmstruckRequirementPlanMapper amstruckRequirementPlanMapper;
+
+    @Override
+    protected IBaseMapper<AmstruckRequirementPlan, BigDecimal> getMapper() {
+        return amstruckRequirementPlanMapper;
+    }
+
+    @Override
+    public int insert(BigDecimal requirementId, BigDecimal planId) {
+        AmstruckRequirementPlan amstruckRequirementPlan=new AmstruckRequirementPlan();
+        amstruckRequirementPlan.setRequirementPlanId(amstruckRequirementPlanMapper.selectOtherId());
+        amstruckRequirementPlan.setRequirementId(requirementId);
+        amstruckRequirementPlan.setPlanId(planId);
+        amstruckRequirementPlan.setInsertTime(new Date());
+        amstruckRequirementPlan.setInsertUsername("admin");
+        return amstruckRequirementPlanMapper.insertSelective(amstruckRequirementPlan);
+    }
+}

+ 357 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsDispatchSaleOrderMapper.xml

@@ -0,0 +1,357 @@
+<?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.AmsDispatchSaleOrderMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+    <id column="DISPATCH_ID" jdbcType="DECIMAL" property="dispatchId" />
+    <result column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="DISPATCH_TIME" jdbcType="TIMESTAMP" property="dispatchTime" />
+    <result column="DISPATCH_DEAL_TIME" jdbcType="TIMESTAMP" property="dispatchDealTime" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.DISPATCH_ID, t.SALE_ORDER_ID, t.CARRIER_ID, t.DISPATCH_TIME, t.DISPATCH_DEAL_TIME, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM AMS_DISPATCH_SALE_ORDER
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMS_DISPATCH_SALE_ORDER t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="dispatchId != null">
+        and DISPATCH_ID = #{dispatchId}
+      </if>
+      <if test="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="dispatchTime != null">
+        and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
+      </if>
+      <if test="dispatchDealTime != null">
+        and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="dispatchId != null">
+        and DISPATCH_ID = #{dispatchId}
+      </if>
+      <if test="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="dispatchTime != null">
+        and TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = #{dispatchTime}
+      </if>
+      <if test="dispatchDealTime != null">
+        and TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = #{dispatchDealTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMS_DISPATCH_SALE_ORDER
+    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMS_DISPATCH_SALE_ORDER
+    where 1!=1 
+      <if test="saleOrderId != null">
+        or SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="dispatchTime != null">
+        or TO_CHAR(DISPATCH_TIME,'yyyy-MM-dd') = '#{dispatchTime}'
+      </if>
+      <if test="dispatchDealTime != null">
+        or TO_CHAR(DISPATCH_DEAL_TIME,'yyyy-MM-dd') = '#{dispatchDealTime}'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+    insert into AMS_DISPATCH_SALE_ORDER (DISPATCH_ID, SALE_ORDER_ID, CARRIER_ID, 
+      DISPATCH_TIME, DISPATCH_DEAL_TIME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK)
+    values (#{dispatchId,jdbcType=DECIMAL}, #{saleOrderId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
+      #{dispatchTime,jdbcType=TIMESTAMP}, #{dispatchDealTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, 
+      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+    insert into AMS_DISPATCH_SALE_ORDER
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="dispatchId != null">
+        DISPATCH_ID,
+      </if>
+      <if test="saleOrderId != null">
+        SALE_ORDER_ID,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="dispatchTime != null">
+        DISPATCH_TIME,
+      </if>
+      <if test="dispatchDealTime != null">
+        DISPATCH_DEAL_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>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="dispatchId != null">
+        #{dispatchId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderId != null">
+        #{saleOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="dispatchTime != null">
+        #{dispatchTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="dispatchDealTime != null">
+        #{dispatchDealTime,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+    update AMS_DISPATCH_SALE_ORDER
+    set SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      DISPATCH_TIME = #{dispatchTime,jdbcType=TIMESTAMP},
+      DISPATCH_DEAL_TIME = #{dispatchDealTime,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}
+    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsDispatchSaleOrder">
+    update AMS_DISPATCH_SALE_ORDER
+    <set>
+      <if test="saleOrderId != null">
+        SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="dispatchTime != null">
+        DISPATCH_TIME = #{dispatchTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="dispatchDealTime != null">
+        DISPATCH_DEAL_TIME = #{dispatchDealTime,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>
+    </set>
+    where DISPATCH_ID = #{dispatchId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where DISPATCH_ID = #{dispatchId,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 AMS_DISPATCH_SALE_ORDER 
+      (DISPATCH_ID, 
+      SALE_ORDER_ID, CARRIER_ID, DISPATCH_TIME, 
+      DISPATCH_DEAL_TIME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.dispatchId,jdbcType=DECIMAL}, 
+      #{item.saleOrderId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.dispatchTime,jdbcType=TIMESTAMP}, 
+      #{item.dispatchDealTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update AMS_DISPATCH_SALE_ORDER
+     set
+       DISPATCH_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchId,jdbcType=DECIMAL}
+       </foreach>
+       ,SALE_ORDER_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,DISPATCH_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,DISPATCH_DEAL_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.dispatchDealTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DISPATCH_ID" close="end">
+          when #{item.dispatchId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+     where DISPATCH_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.dispatchId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMS_DISPATCH_SALE_ORDER
+    where DISPATCH_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 展示所有公开抢单的销售订单的车序号 -->
+  <select id="getOpenDispatchSaleOrder" parameterType="java.util.Map" resultType="java.util.Map">
+    select asom.sale_order_id as "saleOrderId",
+           asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
+           rra.address_delivery_address as "addressDeliveryAddress",
+           asom.sale_date_of_receipt as "saleDateOfReceipt",
+           asom.sale_order_consignee as "saleOrderConsignee",
+           asom.sale_order_consignee_tel as "saleOrderConsigneeTel"
+    from ams_dispatch_sale_order adso
+           left join ams_sale_order_material asom on adso.sale_order_material_id=asom.sale_order_material_id
+           left join rms_receive_address rra on asom.sale_shipping_address_id=rra.address_id
+    where adso.carrier_id is null and adso.dispatch_status=0
+  </select>
+
+</mapper>

+ 181 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.xml

@@ -0,0 +1,181 @@
+<?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.AmsRailOffsetDayplanMapper">
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
+        insert into AMS_RAIL_OFFSET_DAYPLAN
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dayplanId != null">
+                DAYPLAN_ID,
+            </if>
+            <if test="dayplanNo != null">
+                DAYPLAN_NO,
+            </if>
+            <if test="dayplanDate != null">
+                DAYPLAN_DATE,
+            </if>
+            <if test="shipperId != null">
+                SHIPPER_ID,
+            </if>
+            <if test="dayplanDeliveryDate != null">
+                DAYPLAN_DELIVERY_DATE,
+            </if>
+            <if test="dayplanOwnCarsAmout != null">
+                DAYPLAN_OWN_CARS_AMOUT,
+            </if>
+            <if test="dayplanDedicatedLineId != null">
+                DAYPLAN_DEDICATED_LINE_ID,
+            </if>
+            <if test="dayplanToTheStationId != null">
+                DAYPLAN_TO_THE_STATION_ID,
+            </if>
+            <if test="transferUnitId != null">
+                TRANSFER_UNIT_ID,
+            </if>
+            <if test="dayplanWagonNumber != null">
+                DAYPLAN_WAGON_NUMBER,
+            </if>
+            <if test="receivingUnitId != null">
+                RECEIVING_UNIT_ID,
+            </if>
+            <if test="dayplanConsigneeName != null">
+                DAYPLAN_CONSIGNEE_NAME,
+            </if>
+            <if test="dayplanConsigneeTel != null">
+                DAYPLAN_CONSIGNEE_TEL,
+            </if>
+            <if test="dayplanReceiveStatus != null">
+                DAYPLAN_RECEIVE_STATUS,
+            </if>
+            <if test="insertUsername != null">
+                INSERT_USERNAME,
+            </if>
+            <if test="insertTime != null">
+                INSERT_TIME,
+            </if>
+            <if test="updateUsername != null">
+                UPDATE_USERNAME,
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME,
+            </if>
+            <if test="insertUpdateRemark != null">
+                INSERT_UPDATE_REMARK,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dayplanId != null">
+                #{dayplanId,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanNo != null">
+                #{dayplanNo,jdbcType=VARCHAR},
+            </if>
+            <if test="dayplanDate != null">
+                #{dayplanDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="shipperId != null">
+                #{shipperId,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanDeliveryDate != null">
+                #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="dayplanOwnCarsAmout != null">
+                #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanDedicatedLineId != null">
+                #{dayplanDedicatedLineId,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanToTheStationId != null">
+                #{dayplanToTheStationId,jdbcType=DECIMAL},
+            </if>
+            <if test="transferUnitId != null">
+                #{transferUnitId,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanWagonNumber != null">
+                #{dayplanWagonNumber,jdbcType=DECIMAL},
+            </if>
+            <if test="receivingUnitId != null">
+                #{receivingUnitId,jdbcType=DECIMAL},
+            </if>
+            <if test="dayplanConsigneeName != null">
+                #{dayplanConsigneeName,jdbcType=VARCHAR},
+            </if>
+            <if test="dayplanConsigneeTel != null">
+                #{dayplanConsigneeTel,jdbcType=VARCHAR},
+            </if>
+            <if test="dayplanReceiveStatus != null">
+                #{dayplanReceiveStatus,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>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsRailOffsetDayplan">
+    update AMS_RAIL_OFFSET_DAYPLAN
+    set DAYPLAN_NO = #{dayplanNo,jdbcType=VARCHAR},
+      DAYPLAN_DATE = #{dayplanDate,jdbcType=TIMESTAMP},
+      SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
+      DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
+      DAYPLAN_OWN_CARS_AMOUT = #{dayplanOwnCarsAmout,jdbcType=DECIMAL},
+      DAYPLAN_DEDICATED_LINE_ID = #{dayplanDedicatedLineId,jdbcType=DECIMAL},
+      DAYPLAN_TO_THE_STATION_ID = #{dayplanToTheStationId,jdbcType=DECIMAL},
+      TRANSFER_UNIT_ID = #{transferUnitId,jdbcType=DECIMAL},
+      DAYPLAN_WAGON_NUMBER = #{dayplanWagonNumber,jdbcType=DECIMAL},
+      RECEIVING_UNIT_ID = #{receivingUnitId,jdbcType=DECIMAL},
+      DAYPLAN_CONSIGNEE_NAME = #{dayplanConsigneeName,jdbcType=VARCHAR},
+      DAYPLAN_CONSIGNEE_TEL = #{dayplanConsigneeTel,jdbcType=VARCHAR},
+      DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus,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}
+    where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
+  </update>
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMS_RAIL_OFFSET_DAYPLAN
+    where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 得到最大id -->
+    <select id="selectMaxId" resultType="DECIMAL">
+        SELECT MAX(DAYPLAN_ID)
+        FROM ams_rail_offset_dayplan
+    </select>
+
+    <!-- 展示钢材发往异地库日计划 -->
+    <select id="getRailOffsetDayplan" parameterType="java.util.Map" resultType="java.util.Map">
+       select
+           t.DAYPLAN_ID "dayPlanId",
+              t.dayplan_no as "dayplanNo",
+       t.dayplan_date as "dayplanDate",
+       rs.shipper_name as "shipperName",
+       t.dayplan_delivery_date as "dayplanDeliveryDate",
+       t.dayplan_own_cars_amout as "dayplanOwnCarsAmout",
+       ras.arrival_name as "arrivalName",
+       ras.dayplan_dedicated_line as "dayplanDedicatedLine",
+       ras.transfer_unit as "transferUnit",
+       t.dayplan_wagon_number as "dayplanWagonNumber",
+       rc.consignee_company_name as "consigneeCompanyName",
+       t.dayplan_consignee_name as "dayplanConsigneeName",
+       t.dayplan_consignee_tel as "dayplanConsigneeTel"
+from ams_rail_offset_dayplan t
+left join rms_shipper rs on t.shipper_id=rs.shipper_id
+left join rmstrain_arrival_send ras on t.dayplan_to_the_station_id=ras.arrival_id
+left join rms_consignee rc on t.receiving_unit_id =rc.consignee_id
+where t.dayplan_receive_status=0
+    </select>
+</mapper>

+ 1189 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml

@@ -0,0 +1,1189 @@
+<?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.AmsSaleOrderMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsSaleOrder">
+    <id column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId" />
+    <result column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
+    <result column="SALE_NUMBER" jdbcType="VARCHAR" property="saleNumber" />
+    <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId" />
+    <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
+    <result column="SALE_ACCOUNT_BALANCE" jdbcType="DECIMAL" property="saleAccountBalance" />
+    <result column="SALE_CURRENT_ORDER_AMOUNT" jdbcType="DECIMAL" property="saleCurrentOrderAmount" />
+    <result column="SALE_HISTORICAL_ORDER_AMOUNT" jdbcType="DECIMAL" property="saleHistoricalOrderAmount" />
+    <result column="SALE_ORDER_STATUS" jdbcType="DECIMAL" property="saleOrderStatus" />
+    <result column="SALE_ORDER_RECEIVE_CUSTOMER" jdbcType="VARCHAR" property="saleOrderReceiveCustomer" />
+    <result column="SALE_ORDER_ISSELF_MENTION" jdbcType="VARCHAR" property="saleOrderIsselfMention" />
+    <result column="SALE_UNIT_PRICE" jdbcType="DECIMAL" property="saleUnitPrice" />
+    <result column="SALE_ORDER_TAX" jdbcType="VARCHAR" property="saleOrderTax" />
+    <result column="SALE_REMARK" jdbcType="VARCHAR" property="saleRemark" />
+    <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">
+    SALE_ORDER_ID, PLAN_ID, SALE_NUMBER, SHIPPER_ID, CONSIGNEE_ID, SALE_ACCOUNT_BALANCE, 
+    SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT, SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER, 
+    SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE, SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.SALE_ORDER_ID, t.PLAN_ID, t.SALE_NUMBER, t.SHIPPER_ID, t.CONSIGNEE_ID, t.SALE_ACCOUNT_BALANCE, 
+    t.SALE_CURRENT_ORDER_AMOUNT, t.SALE_HISTORICAL_ORDER_AMOUNT, t.SALE_ORDER_STATUS, 
+    t.SALE_ORDER_RECEIVE_CUSTOMER, t.SALE_ORDER_ISSELF_MENTION, t.SALE_UNIT_PRICE, t.SALE_ORDER_TAX, 
+    t.SALE_REMARK, 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 AMS_SALE_ORDER
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMS_SALE_ORDER t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="saleNumber != null and saleNumber != ''">
+        and SALE_NUMBER = #{saleNumber}
+      </if>
+      <if test="shipperId != null">
+        and SHIPPER_ID = #{shipperId}
+      </if>
+      <if test="consigneeId != null">
+        and CONSIGNEE_ID = #{consigneeId}
+      </if>
+      <if test="saleAccountBalance != null">
+        and SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        and SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount}
+      </if>
+      <if test="saleHistoricalOrderAmount != null">
+        and SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount}
+      </if>
+      <if test="saleOrderStatus != null">
+        and SALE_ORDER_STATUS = #{saleOrderStatus}
+      </if>
+      <if test="saleOrderReceiveCustomer != null and saleOrderReceiveCustomer != ''">
+        and SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer}
+      </if>
+      <if test="saleOrderIsselfMention != null and saleOrderIsselfMention != ''">
+        and SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention}
+      </if>
+      <if test="saleUnitPrice != null">
+        and SALE_UNIT_PRICE = #{saleUnitPrice}
+      </if>
+      <if test="saleOrderTax != null and saleOrderTax != ''">
+        and SALE_ORDER_TAX = #{saleOrderTax}
+      </if>
+      <if test="saleRemark != null and saleRemark != ''">
+        and SALE_REMARK = #{saleRemark}
+      </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="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="saleNumber != null and saleNumber != ''">
+        and SALE_NUMBER LIKE '%${saleNumber}%'
+      </if>
+      <if test="shipperId != null">
+        and SHIPPER_ID = #{shipperId}
+      </if>
+      <if test="consigneeId != null">
+        and CONSIGNEE_ID = #{consigneeId}
+      </if>
+      <if test="saleAccountBalance != null">
+        and SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        and SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount}
+      </if>
+      <if test="saleHistoricalOrderAmount != null">
+        and SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount}
+      </if>
+      <if test="saleOrderStatus != null">
+        and SALE_ORDER_STATUS = #{saleOrderStatus}
+      </if>
+      <if test="saleOrderReceiveCustomer != null and saleOrderReceiveCustomer != ''">
+        and SALE_ORDER_RECEIVE_CUSTOMER LIKE '%${saleOrderReceiveCustomer}%'
+      </if>
+      <if test="saleOrderIsselfMention != null and saleOrderIsselfMention != ''">
+        and SALE_ORDER_ISSELF_MENTION LIKE '%${saleOrderIsselfMention}%'
+      </if>
+      <if test="saleUnitPrice != null">
+        and SALE_UNIT_PRICE = #{saleUnitPrice}
+      </if>
+      <if test="saleOrderTax != null and saleOrderTax != ''">
+        and SALE_ORDER_TAX LIKE '%${saleOrderTax}%'
+      </if>
+      <if test="saleRemark != null and saleRemark != ''">
+        and SALE_REMARK LIKE '%${saleRemark}%'
+      </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 AMS_SALE_ORDER
+    where SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMS_SALE_ORDER
+    where 1!=1
+    <if test="planId != null">
+      or PLAN_ID = #{planId}
+    </if>
+    <if test="saleNumber != null and saleNumber != ''">
+      or SALE_NUMBER = #{saleNumber}
+    </if>
+    <if test="shipperId != null">
+      or SHIPPER_ID = #{shipperId}
+    </if>
+    <if test="consigneeId != null">
+      or CONSIGNEE_ID = #{consigneeId}
+    </if>
+    <if test="saleAccountBalance != null">
+      or SALE_ACCOUNT_BALANCE = #{saleAccountBalance}
+    </if>
+    <if test="saleCurrentOrderAmount != null">
+      or SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount}
+    </if>
+    <if test="saleHistoricalOrderAmount != null">
+      or SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount}
+    </if>
+    <if test="saleOrderStatus != null">
+      or SALE_ORDER_STATUS = #{saleOrderStatus}
+    </if>
+    <if test="saleOrderReceiveCustomer != null and saleOrderReceiveCustomer != ''">
+      or SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer}
+    </if>
+    <if test="saleOrderIsselfMention != null and saleOrderIsselfMention != ''">
+      or SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention}
+    </if>
+    <if test="saleUnitPrice != null">
+      or SALE_UNIT_PRICE = #{saleUnitPrice}
+    </if>
+    <if test="saleOrderTax != null and saleOrderTax != ''">
+      or SALE_ORDER_TAX = #{saleOrderTax}
+    </if>
+    <if test="saleRemark != null and saleRemark != ''">
+      or SALE_REMARK = #{saleRemark}
+    </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.AmsSaleOrder">
+    insert into AMS_SALE_ORDER (SALE_ORDER_ID, PLAN_ID, SALE_NUMBER,
+                                SHIPPER_ID, CONSIGNEE_ID, SALE_ACCOUNT_BALANCE,
+                                SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT,
+                                SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
+                                SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE,
+                                SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
+                                INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                INSERT_UPDATE_REMARK, DELETED)
+    values (#{saleOrderId,jdbcType=DECIMAL}, #{planId,jdbcType=DECIMAL}, #{saleNumber,jdbcType=VARCHAR},
+            #{shipperId,jdbcType=DECIMAL}, #{consigneeId,jdbcType=DECIMAL}, #{saleAccountBalance,jdbcType=DECIMAL},
+            #{saleCurrentOrderAmount,jdbcType=DECIMAL}, #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
+            #{saleOrderStatus,jdbcType=DECIMAL}, #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
+            #{saleOrderIsselfMention,jdbcType=VARCHAR}, #{saleUnitPrice,jdbcType=DECIMAL},
+            #{saleOrderTax,jdbcType=VARCHAR}, #{saleRemark,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.AmsSaleOrder">
+    insert into AMS_SALE_ORDER
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="saleOrderId != null">
+        SALE_ORDER_ID,
+      </if>
+      <if test="planId != null">
+        PLAN_ID,
+      </if>
+      <if test="saleNumber != null">
+        SALE_NUMBER,
+      </if>
+      <if test="shipperId != null">
+        SHIPPER_ID,
+      </if>
+      <if test="consigneeId != null">
+        CONSIGNEE_ID,
+      </if>
+      <if test="saleAccountBalance != null">
+        SALE_ACCOUNT_BALANCE,
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        SALE_CURRENT_ORDER_AMOUNT,
+      </if>
+      <if test="saleHistoricalOrderAmount != null">
+        SALE_HISTORICAL_ORDER_AMOUNT,
+      </if>
+      <if test="saleOrderStatus != null">
+        SALE_ORDER_STATUS,
+      </if>
+      <if test="saleOrderReceiveCustomer != null">
+        SALE_ORDER_RECEIVE_CUSTOMER,
+      </if>
+      <if test="saleOrderIsselfMention != null">
+        SALE_ORDER_ISSELF_MENTION,
+      </if>
+      <if test="saleUnitPrice != null">
+        SALE_UNIT_PRICE,
+      </if>
+      <if test="saleOrderTax != null">
+        SALE_ORDER_TAX,
+      </if>
+      <if test="saleRemark != null">
+        SALE_REMARK,
+      </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="saleOrderId != null">
+        #{saleOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="planId != null">
+        #{planId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleNumber != null">
+        #{saleNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="shipperId != null">
+        #{shipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="consigneeId != null">
+        #{consigneeId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleAccountBalance != null">
+        #{saleAccountBalance,jdbcType=DECIMAL},
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        #{saleCurrentOrderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="saleHistoricalOrderAmount != null">
+        #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderStatus != null">
+        #{saleOrderStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderReceiveCustomer != null">
+        #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
+      </if>
+      <if test="saleOrderIsselfMention != null">
+        #{saleOrderIsselfMention,jdbcType=VARCHAR},
+      </if>
+      <if test="saleUnitPrice != null">
+        #{saleUnitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderTax != null">
+        #{saleOrderTax,jdbcType=VARCHAR},
+      </if>
+      <if test="saleRemark != null">
+        #{saleRemark,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.AmsSaleOrder">
+    update AMS_SALE_ORDER
+    set PLAN_ID = #{planId,jdbcType=DECIMAL},
+        SALE_NUMBER = #{saleNumber,jdbcType=VARCHAR},
+        SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
+        CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
+        SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
+        SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount,jdbcType=DECIMAL},
+        SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
+        SALE_ORDER_STATUS = #{saleOrderStatus,jdbcType=DECIMAL},
+        SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
+        SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention,jdbcType=VARCHAR},
+        SALE_UNIT_PRICE = #{saleUnitPrice,jdbcType=DECIMAL},
+        SALE_ORDER_TAX = #{saleOrderTax,jdbcType=VARCHAR},
+        SALE_REMARK = #{saleRemark,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 SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleOrder">
+    update AMS_SALE_ORDER
+    <set>
+      <if test="planId != null">
+        PLAN_ID = #{planId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleNumber != null">
+        SALE_NUMBER = #{saleNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="shipperId != null">
+        SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="consigneeId != null">
+        CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleAccountBalance != null">
+        SALE_ACCOUNT_BALANCE = #{saleAccountBalance,jdbcType=DECIMAL},
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        SALE_CURRENT_ORDER_AMOUNT = #{saleCurrentOrderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="saleHistoricalOrderAmount != null">
+        SALE_HISTORICAL_ORDER_AMOUNT = #{saleHistoricalOrderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderStatus != null">
+        SALE_ORDER_STATUS = #{saleOrderStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderReceiveCustomer != null">
+        SALE_ORDER_RECEIVE_CUSTOMER = #{saleOrderReceiveCustomer,jdbcType=VARCHAR},
+      </if>
+      <if test="saleOrderIsselfMention != null">
+        SALE_ORDER_ISSELF_MENTION = #{saleOrderIsselfMention,jdbcType=VARCHAR},
+      </if>
+      <if test="saleUnitPrice != null">
+        SALE_UNIT_PRICE = #{saleUnitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderTax != null">
+        SALE_ORDER_TAX = #{saleOrderTax,jdbcType=VARCHAR},
+      </if>
+      <if test="saleRemark != null">
+        SALE_REMARK = #{saleRemark,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 SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where SALE_ORDER_ID = #{saleOrderId,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 AMS_SALE_ORDER
+    (SALE_ORDER_ID,
+    PLAN_ID, SALE_NUMBER, SHIPPER_ID,
+    CONSIGNEE_ID, SALE_ACCOUNT_BALANCE,
+    SALE_CURRENT_ORDER_AMOUNT, SALE_HISTORICAL_ORDER_AMOUNT,
+    SALE_ORDER_STATUS, SALE_ORDER_RECEIVE_CUSTOMER,
+    SALE_ORDER_ISSELF_MENTION, SALE_UNIT_PRICE,
+    SALE_ORDER_TAX, SALE_REMARK, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK,
+    DELETED)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.saleOrderId,jdbcType=DECIMAL},
+    #{item.planId,jdbcType=DECIMAL}, #{item.saleNumber,jdbcType=VARCHAR}, #{item.shipperId,jdbcType=DECIMAL},
+    #{item.consigneeId,jdbcType=DECIMAL}, #{item.saleAccountBalance,jdbcType=DECIMAL},
+    #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}, #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL},
+    #{item.saleOrderStatus,jdbcType=DECIMAL}, #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR},
+    #{item.saleOrderIsselfMention,jdbcType=VARCHAR}, #{item.saleUnitPrice,jdbcType=DECIMAL},
+    #{item.saleOrderTax,jdbcType=VARCHAR}, #{item.saleRemark,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 AMS_SALE_ORDER
+    set
+    SALE_ORDER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
+    </foreach>
+    ,PLAN_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleNumber,jdbcType=VARCHAR}
+    </foreach>
+    ,SHIPPER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
+    </foreach>
+    ,CONSIGNEE_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.consigneeId,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ACCOUNT_BALANCE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleAccountBalance,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_CURRENT_ORDER_AMOUNT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleCurrentOrderAmount,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_HISTORICAL_ORDER_AMOUNT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleHistoricalOrderAmount,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_STATUS=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderStatus,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_RECEIVE_CUSTOMER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderReceiveCustomer,jdbcType=VARCHAR}
+    </foreach>
+    ,SALE_ORDER_ISSELF_MENTION=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderIsselfMention,jdbcType=VARCHAR}
+    </foreach>
+    ,SALE_UNIT_PRICE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleUnitPrice,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_TAX=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleOrderTax,jdbcType=VARCHAR}
+    </foreach>
+    ,SALE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.saleRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_ID" close="end">
+      when #{item.saleOrderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    where SALE_ORDER_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.saleOrderId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMS_SALE_ORDER
+    where SALE_ORDER_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="getSaleOrderInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select a_s_order.SALE_ORDER_ID "saleOrderId",
+    a_s_order.SALE_NUMBER "saleNumber",
+    tt.SUM1 "materialTheoreticalWeight",
+    tt.SUM2 "saleOrderMaterialNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    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"
+    from AMS_SALE_ORDER a_s_order
+    left join (select sale_material.SALE_ORDER_ID s_order,
+    sum(sale_material.material_theoretical_weight) sum1,
+    sum(sale_material.sale_order_material_number) sum2
+    from ams_sale_order_material sale_material where sale_material.deleted=0 group by
+    sale_material.SALE_ORDER_ID) tt
+    on a_s_order.SALE_ORDER_ID=tt.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
+    where a_s_order.SALE_ORDER_STATUS=0 and a_s_order.DELETED=0)
+    <where>
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and
+        <foreach collection="saleOrderMaterialNumber" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="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>
+      <include refid="orderBy"></include>
+    </where>
+  </select>
+
+  <select id="getSaleOrderReported"  parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select a_s_order.SALE_ORDER_ID "saleOrderId",
+    a_s_order.SALE_NUMBER "saleNumber",
+    tt.SUM1 "materialTheoreticalWeight",
+    tt.SUM2 "saleOrderMaterialNumber",
+    r_shipper.SHIPPER_NAME "shipperName",
+    r_consignee.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    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"
+    from AMS_SALE_ORDER a_s_order
+    left join (select sale_material.SALE_ORDER_ID s_order,
+    sum(sale_material.material_theoretical_weight) sum1,
+    sum(sale_material.sale_order_material_number) sum2
+    from ams_sale_order_material sale_material group by
+    sale_material.SALE_ORDER_ID) tt
+    on a_s_order.SALE_ORDER_ID=tt.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
+    where a_s_order.SALE_ORDER_STATUS=1)
+    <where>
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and
+        <foreach collection="saleOrderMaterialNumber" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="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>
+      <include refid="orderBy"></include>
+    </where>
+  </select>
+
+  <select id="getSaleOrderDetail" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select sale_material.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId",
+    sale_material.SALE_ORDER_MATERIAL_TRUCK_NO "saleOrderMaterialTruckNo",
+    r_material.MATERIAL_NAME "materialName",
+    r_material.MATERIAL_SPECIFICATION "materialSpecification",
+    sale_material.SALE_ORDER_MATERIAL_NUMBER "saleOrderMaterialNumber",
+    sale_material.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+    receive_address.ADDRESS_DELIVERY_ADDRESS "saleShippingAddress",
+    sale_material.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
+    sale_material.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
+    sale_material.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel"
+    from AMS_SALE_ORDER_MATERIAL sale_material
+    left join RMS_MATERIAL r_material
+    on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
+    left join AMS_SALE_ORDER a_s_order
+    on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+    left join RMS_RECEIVE_ADDRESS receive_address
+    on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
+    where sale_material.SALE_ORDER_ID=#{saleOrderId} and sale_material.DELETED=0 and sale_material.UPDATED=0)
+    <where>
+      <if test="saleOrderMaterialTruckNo != null">
+        and
+        <foreach collection="saleOrderMaterialTruckNo" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialTruckNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialSpecification != null">
+        and
+        <foreach collection="materialSpecification" item="item" open="(" separator="or" close=")">
+          "materialSpecification" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and
+        <foreach collection="saleOrderMaterialNumber" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+
+      <if test="saleShippingAddress != null">
+        and
+        <foreach collection="saleShippingAddress" item="item" open="(" separator="or" close=")">
+          "saleShippingAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleDateOfReceipt != null">
+        and
+        <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
+          "saleDateOfReceipt" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderConsignee != null">
+        and
+        <foreach collection="saleOrderConsignee" item="item" open="(" separator="or" close=")">
+          "saleOrderConsignee" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderConsigneeTel != null">
+        and
+        <foreach collection="saleOrderConsigneeTel" item="item" open="(" separator="or" close=")">
+          "saleOrderConsigneeTel" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
+
+  <select id="getSaleOrderUpdateLog" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select
+    sale_material.SALE_ORDER_MATERIAL_TRUCK_NO "saleOrderMaterialTruckNo",
+    r_material.MATERIAL_NAME "materialName",
+    r_material.MATERIAL_SPECIFICATION "materialSpecification",
+    sale_material.SALE_ORDER_MATERIAL_NUMBER "saleOrderMaterialNumber",
+    sale_material.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+    receive_address.ADDRESS_DELIVERY_ADDRESS "saleShippingAddress",
+    sale_material.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
+    sale_material.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
+    sale_material.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel"
+    from AMS_SALE_ORDER_MATERIAL sale_material
+    left join RMS_MATERIAL r_material
+    on sale_material.MATERIAL_ID=r_material.MATERIAL_ID
+    left join AMS_SALE_ORDER a_s_order
+    on sale_material.SALE_ORDER_ID=a_s_order.SALE_ORDER_ID
+    left join RMS_RECEIVE_ADDRESS receive_address
+    on sale_material.SALE_SHIPPING_ADDRESS_ID=receive_address.ADDRESS_ID
+    where sale_material.SALE_ORDER_ID=#{saleOrderId} and sale_material.DELETED=0)
+    <where>
+      <if test="saleOrderMaterialTruckNo != null">
+        and
+        <foreach collection="saleOrderMaterialTruckNo" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialTruckNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialName != null">
+        and
+        <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+          "materialName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialSpecification != null">
+        and
+        <foreach collection="materialSpecification" item="item" open="(" separator="or" close=")">
+          "materialSpecification" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and
+        <foreach collection="saleOrderMaterialNumber" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+
+      <if test="saleShippingAddress != null">
+        and
+        <foreach collection="saleShippingAddress" item="item" open="(" separator="or" close=")">
+          "saleShippingAddress" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleDateOfReceipt != null">
+        and
+        <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
+          "saleDateOfReceipt" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderConsignee != null">
+        and
+        <foreach collection="saleOrderConsignee" item="item" open="(" separator="or" close=")">
+          "saleOrderConsignee" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderConsigneeTel != null">
+        and
+        <foreach collection="saleOrderConsigneeTel" item="item" open="(" separator="or" close=")">
+          "saleOrderConsigneeTel" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
+
+  <select id="getSaleArea" resultType="java.util.LinkedHashMap">
+    select
+      a_s_plan.PLAN_ID "id",
+      a_s_plan.PLAN_ID "value",
+      r_s_area.AREA_NAME "label"
+    from RMS_SALE_AREA r_s_area
+           left join AMS_SALE_PLAN a_s_plan
+                     on r_s_area.AREA_ID=a_s_plan.SALE_AREA_ID
+  </select>
+
+  <select id="getShipperName" resultType="java.util.LinkedHashMap">
+    select
+      SHIPPER_ID "id",
+      SHIPPER_ID "value",
+      SHIPPER_NAME "label"
+    from RMS_SHIPPER
+  </select>
+
+  <select id="getConsigneeCompanyName" resultType="java.util.LinkedHashMap">
+    select
+      CONSIGNEE_ID "id",
+      CONSIGNEE_ID "value",
+      CONSIGNEE_COMPANY_NAME "label"
+    from RMS_CONSIGNEE
+  </select>
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(SALE_ORDER_ID) from AMS_SALE_ORDER
+  </select>
+
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by  "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+  </sql>
+
+  <select id="selectBySaleOrderId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
+    select
+      a_s_order.PLAN_ID "planId",
+      a_s_order.SHIPPER_ID "shipperId",
+      a_s_order.RECEIVE_ID "consigneeId",
+      a_s_order.SALE_ORDER_RECEIVE_CUSTOMER "saleOrderReceiveCustomer",
+      a_s_order.SALE_ORDER_ISSELF_MENTION "saleOrderIsselfMention",
+      a_s_order.SALE_REMARK "saleRemark"
+    from AMS_SALE_ORDER a_s_order
+    where a_s_order.SALE_ORDER_ID = #{saleOrderId}
+  </select>
+
+  <update id="deleteBySaleOrderId" parameterType="java.math.BigDecimal">
+    update AMS_SALE_ORDER_MATERIAL set DELETED = 1 where SALE_ORDER_ID = #{saleOrderId}
+  </update>
+  
+  <select id="getAmsSaleOrderApproved" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+                   select a_s_order.SALE_ORDER_ID "saleOrderId",
+                          a_s_order.SALE_NUMBER "saleNumber",
+                          tt.SUM1 "materialTheoreticalWeight",
+                          tt.SUM2 "saleOrderMaterialNumber",
+                          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"
+                   from AMS_SALE_ORDER a_s_order
+                          left join (select sale_material.SALE_ORDER_ID s_order,
+                                            sum(sale_material.material_theoretical_weight) sum1,
+                                            sum(sale_material.sale_order_material_number) sum2
+                                     from ams_sale_order_material sale_material where sale_material.deleted=0 group by
+                                       sale_material.SALE_ORDER_ID) tt
+                                    on a_s_order.SALE_ORDER_ID=tt.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
+                   where a_s_order.SALE_ORDER_STATUS=4
+                   )
+    <where>
+      <if test="saleNumber != null">
+        and
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and
+        <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
+          "materialTheoreticalWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and
+        <foreach collection="saleOrderMaterialNumber" item="item" open="(" separator="or" close=")">
+          "saleOrderMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="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>
+      <include refid="orderBy"></include>
+    </where>
+  </select>
+  <!-- 展示所有销售公司已审核的销售订单 -->
+  <select id="getSaleOrderList" parameterType="java.util.Map" resultType="java.util.Map">
+    select
+      asom.SALE_ORDER_MATERIAL_ID "orderMaterialId",
+      asom.sale_order_id as "saleOrderId",
+      asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
+      asom.sale_order_material_id,
+      rra.address_delivery_address as "addressDeliveryAddress",
+      asom.sale_date_of_receipt as "saleDateOfReceipt",
+      asom.sale_order_consignee as "saleOrderConsignee",
+      asom.sale_order_consignee_tel as "saleOrderConsigneeTel"
+    from ams_sale_order aso
+           join ams_sale_order_material asom on aso.sale_order_id =asom.sale_order_id
+           left join rms_receive_address rra on asom.sale_shipping_address_id=rra.address_id
+    where asom.sale_order_material_id not in (select adso.sale_order_material_id from ams_dispatch_sale_order adso group by adso.sale_order_material_id) and aso.sale_order_status=2 or aso.sale_order_status=4
+  </select>
+
+  <!-- 通过收货地址,匹配对应的承运商-->
+  <select id="getCarrier" parameterType="java.lang.Integer" resultType="java.lang.Integer">
+    select rc.carrier_id from rms_receive_address rra join rms_carrier rc on rra.address_town = rc.carrier_bid_area
+    WHERE rra.address_id = #{param}
+  </select>
+</mapper>

+ 579 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMaterialMapper.xml

@@ -0,0 +1,579 @@
+<?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.AmsSaleOrderMaterialMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsSaleOrderMaterial">
+    <id column="SALE_ORDER_MATERIAL_ID" jdbcType="DECIMAL" property="saleOrderMaterialId" />
+    <result column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId" />
+    <result column="SALE_ORDER_MATERIAL_TRUCK_NO" jdbcType="DECIMAL" property="saleOrderMaterialTruckNo" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="SALE_ORDER_MATERIAL_NUMBER" jdbcType="DECIMAL" property="saleOrderMaterialNumber" />
+    <result column="MATERIAL_THEORETICAL_WEIGHT" jdbcType="DECIMAL" property="materialTheoreticalWeight" />
+    <result column="SALE_SHIPPING_ADDRESS" jdbcType="VARCHAR" property="saleShippingAddress" />
+    <result column="SALE_DATE_OF_RECEIPT" jdbcType="TIMESTAMP" property="saleDateOfReceipt" />
+    <result column="SALE_ORDER_CONSIGNEE" jdbcType="VARCHAR" property="saleOrderConsignee" />
+    <result column="SALE_ORDER_CONSIGNEE_TEL" jdbcType="VARCHAR" property="saleOrderConsigneeTel" />
+    <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="UPDATED" jdbcType="DECIMAL" property="updated" />
+  </resultMap>
+  <sql id="columns">
+    SALE_ORDER_MATERIAL_ID, SALE_ORDER_ID, SALE_ORDER_MATERIAL_TRUCK_NO, MATERIAL_ID, 
+    SALE_ORDER_MATERIAL_NUMBER, MATERIAL_THEORETICAL_WEIGHT, SALE_SHIPPING_ADDRESS, SALE_DATE_OF_RECEIPT, 
+    SALE_ORDER_CONSIGNEE, SALE_ORDER_CONSIGNEE_TEL, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, UPDATED
+  </sql>
+  <sql id="columns_alias">
+    t.SALE_ORDER_MATERIAL_ID, t.SALE_ORDER_ID, t.SALE_ORDER_MATERIAL_TRUCK_NO, t.MATERIAL_ID, 
+    t.SALE_ORDER_MATERIAL_NUMBER, t.MATERIAL_THEORETICAL_WEIGHT, t.SALE_SHIPPING_ADDRESS, 
+    t.SALE_DATE_OF_RECEIPT, t.SALE_ORDER_CONSIGNEE, t.SALE_ORDER_CONSIGNEE_TEL, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, 
+    t.UPDATED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM AMS_SALE_ORDER_MATERIAL
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMS_SALE_ORDER_MATERIAL t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="saleOrderMaterialId != null">
+        and SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+      </if>
+      <if test="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="saleOrderMaterialTruckNo != null">
+        and SALE_ORDER_MATERIAL_TRUCK_NO = #{saleOrderMaterialTruckNo}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and SALE_ORDER_MATERIAL_NUMBER = #{saleOrderMaterialNumber}
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+      </if>
+      <if test="saleShippingAddress != null and saleShippingAddress != ''">
+        and SALE_SHIPPING_ADDRESS = #{saleShippingAddress}
+      </if>
+      <if test="saleDateOfReceipt != null">
+        and TO_CHAR(SALE_DATE_OF_RECEIPT,'yyyy-MM-dd') = #{saleDateOfReceipt}
+      </if>
+      <if test="saleOrderConsignee != null and saleOrderConsignee != ''">
+        and SALE_ORDER_CONSIGNEE = #{saleOrderConsignee}
+      </if>
+      <if test="saleOrderConsigneeTel != null and saleOrderConsigneeTel != ''">
+        and SALE_ORDER_CONSIGNEE_TEL = #{saleOrderConsigneeTel}
+      </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="updated != null">
+        and UPDATED = #{updated}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="saleOrderMaterialId != null">
+        and SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+      </if>
+      <if test="saleOrderId != null">
+        and SALE_ORDER_ID = #{saleOrderId}
+      </if>
+      <if test="saleOrderMaterialTruckNo != null">
+        and SALE_ORDER_MATERIAL_TRUCK_NO = #{saleOrderMaterialTruckNo}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        and SALE_ORDER_MATERIAL_NUMBER = #{saleOrderMaterialNumber}
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        and MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+      </if>
+      <if test="saleShippingAddress != null and saleShippingAddress != ''">
+        and SALE_SHIPPING_ADDRESS LIKE '%${saleShippingAddress}%'
+      </if>
+      <if test="saleDateOfReceipt != null">
+        and TO_CHAR(SALE_DATE_OF_RECEIPT,'yyyy-MM-dd') = #{saleDateOfReceipt}
+      </if>
+      <if test="saleOrderConsignee != null and saleOrderConsignee != ''">
+        and SALE_ORDER_CONSIGNEE LIKE '%${saleOrderConsignee}%'
+      </if>
+      <if test="saleOrderConsigneeTel != null and saleOrderConsigneeTel != ''">
+        and SALE_ORDER_CONSIGNEE_TEL LIKE '%${saleOrderConsigneeTel}%'
+      </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="updated != null">
+        and UPDATED = #{updated}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMS_SALE_ORDER_MATERIAL
+    where SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMS_SALE_ORDER_MATERIAL
+    where 1!=1
+    <if test="saleOrderId != null">
+      or SALE_ORDER_ID = #{saleOrderId}
+    </if>
+    <if test="saleOrderMaterialTruckNo != null">
+      or SALE_ORDER_MATERIAL_TRUCK_NO = #{saleOrderMaterialTruckNo}
+    </if>
+    <if test="materialId != null">
+      or MATERIAL_ID = #{materialId}
+    </if>
+    <if test="saleOrderMaterialNumber != null">
+      or SALE_ORDER_MATERIAL_NUMBER = #{saleOrderMaterialNumber}
+    </if>
+    <if test="materialTheoreticalWeight != null">
+      or MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+    </if>
+    <if test="saleShippingAddress != null and saleShippingAddress != ''">
+      or SALE_SHIPPING_ADDRESS = #{saleShippingAddress}
+    </if>
+    <if test="saleDateOfReceipt != null">
+      or TO_CHAR(SALE_DATE_OF_RECEIPT,'yyyy-MM-dd') = '#{saleDateOfReceipt}'
+    </if>
+    <if test="saleOrderConsignee != null and saleOrderConsignee != ''">
+      or SALE_ORDER_CONSIGNEE = #{saleOrderConsignee}
+    </if>
+    <if test="saleOrderConsigneeTel != null and saleOrderConsigneeTel != ''">
+      or SALE_ORDER_CONSIGNEE_TEL = #{saleOrderConsigneeTel}
+    </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="updated != null">
+      or UPDATED = #{updated}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleOrderMaterial">
+    insert into AMS_SALE_ORDER_MATERIAL (SALE_ORDER_MATERIAL_ID, SALE_ORDER_ID,
+                                         SALE_ORDER_MATERIAL_TRUCK_NO, MATERIAL_ID, SALE_ORDER_MATERIAL_NUMBER,
+                                         MATERIAL_THEORETICAL_WEIGHT, SALE_SHIPPING_ADDRESS,
+                                         SALE_DATE_OF_RECEIPT, SALE_ORDER_CONSIGNEE,
+                                         SALE_ORDER_CONSIGNEE_TEL, INSERT_USERNAME,
+                                         INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                         INSERT_UPDATE_REMARK, DELETED, UPDATED
+    )
+    values (#{saleOrderMaterialId,jdbcType=DECIMAL}, #{saleOrderId,jdbcType=DECIMAL},
+            #{saleOrderMaterialTruckNo,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{saleOrderMaterialNumber,jdbcType=DECIMAL},
+            #{materialTheoreticalWeight,jdbcType=DECIMAL}, #{saleShippingAddress,jdbcType=VARCHAR},
+            #{saleDateOfReceipt,jdbcType=TIMESTAMP}, #{saleOrderConsignee,jdbcType=VARCHAR},
+            #{saleOrderConsigneeTel,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR},
+            #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+            #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{updated,jdbcType=DECIMAL}
+           )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsSaleOrderMaterial">
+    insert into AMS_SALE_ORDER_MATERIAL
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="saleOrderMaterialId != null">
+        SALE_ORDER_MATERIAL_ID,
+      </if>
+      <if test="saleOrderId != null">
+        SALE_ORDER_ID,
+      </if>
+      <if test="saleOrderMaterialTruckNo != null">
+        SALE_ORDER_MATERIAL_TRUCK_NO,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        SALE_ORDER_MATERIAL_NUMBER,
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        MATERIAL_THEORETICAL_WEIGHT,
+      </if>
+      <if test="saleShippingAddress != null">
+        SALE_SHIPPING_ADDRESS,
+      </if>
+      <if test="saleDateOfReceipt != null">
+        SALE_DATE_OF_RECEIPT,
+      </if>
+      <if test="saleOrderConsignee != null">
+        SALE_ORDER_CONSIGNEE,
+      </if>
+      <if test="saleOrderConsigneeTel != null">
+        SALE_ORDER_CONSIGNEE_TEL,
+      </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="updated != null">
+        UPDATED,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="saleOrderMaterialId != null">
+        #{saleOrderMaterialId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderId != null">
+        #{saleOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderMaterialTruckNo != null">
+        #{saleOrderMaterialTruckNo,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        #{saleOrderMaterialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        #{materialTheoreticalWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="saleShippingAddress != null">
+        #{saleShippingAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="saleDateOfReceipt != null">
+        #{saleDateOfReceipt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="saleOrderConsignee != null">
+        #{saleOrderConsignee,jdbcType=VARCHAR},
+      </if>
+      <if test="saleOrderConsigneeTel != null">
+        #{saleOrderConsigneeTel,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>
+      <if test="updated != null">
+        #{updated,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSaleOrderMaterial">
+    update AMS_SALE_ORDER_MATERIAL
+    set SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
+        SALE_ORDER_MATERIAL_TRUCK_NO = #{saleOrderMaterialTruckNo,jdbcType=DECIMAL},
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+        SALE_ORDER_MATERIAL_NUMBER = #{saleOrderMaterialNumber,jdbcType=DECIMAL},
+        MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight,jdbcType=DECIMAL},
+        SALE_SHIPPING_ADDRESS = #{saleShippingAddress,jdbcType=VARCHAR},
+        SALE_DATE_OF_RECEIPT = #{saleDateOfReceipt,jdbcType=TIMESTAMP},
+        SALE_ORDER_CONSIGNEE = #{saleOrderConsignee,jdbcType=VARCHAR},
+        SALE_ORDER_CONSIGNEE_TEL = #{saleOrderConsigneeTel,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},
+        UPDATED = #{updated,jdbcType=DECIMAL}
+    where SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleOrderMaterial">
+    update AMS_SALE_ORDER_MATERIAL
+    <set>
+      <if test="saleOrderId != null">
+        SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderMaterialTruckNo != null">
+        SALE_ORDER_MATERIAL_TRUCK_NO = #{saleOrderMaterialTruckNo,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="saleOrderMaterialNumber != null">
+        SALE_ORDER_MATERIAL_NUMBER = #{saleOrderMaterialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="materialTheoreticalWeight != null">
+        MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="saleShippingAddress != null">
+        SALE_SHIPPING_ADDRESS = #{saleShippingAddress,jdbcType=VARCHAR},
+      </if>
+      <if test="saleDateOfReceipt != null">
+        SALE_DATE_OF_RECEIPT = #{saleDateOfReceipt,jdbcType=TIMESTAMP},
+      </if>
+      <if test="saleOrderConsignee != null">
+        SALE_ORDER_CONSIGNEE = #{saleOrderConsignee,jdbcType=VARCHAR},
+      </if>
+      <if test="saleOrderConsigneeTel != null">
+        SALE_ORDER_CONSIGNEE_TEL = #{saleOrderConsigneeTel,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>
+      <if test="updated != null">
+        UPDATED = #{updated,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId,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 AMS_SALE_ORDER_MATERIAL
+    (SALE_ORDER_MATERIAL_ID,
+    SALE_ORDER_ID, SALE_ORDER_MATERIAL_TRUCK_NO,
+    MATERIAL_ID, SALE_ORDER_MATERIAL_NUMBER,
+    MATERIAL_THEORETICAL_WEIGHT, SALE_SHIPPING_ADDRESS,
+    SALE_DATE_OF_RECEIPT, SALE_ORDER_CONSIGNEE,
+    SALE_ORDER_CONSIGNEE_TEL, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK,
+    DELETED, UPDATED)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.saleOrderMaterialId,jdbcType=DECIMAL},
+    #{item.saleOrderId,jdbcType=DECIMAL}, #{item.saleOrderMaterialTruckNo,jdbcType=DECIMAL},
+    #{item.materialId,jdbcType=DECIMAL}, #{item.saleOrderMaterialNumber,jdbcType=DECIMAL},
+    #{item.materialTheoreticalWeight,jdbcType=DECIMAL}, #{item.saleShippingAddress,jdbcType=VARCHAR},
+    #{item.saleDateOfReceipt,jdbcType=TIMESTAMP}, #{item.saleOrderConsignee,jdbcType=VARCHAR},
+    #{item.saleOrderConsigneeTel,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}, #{item.updated,jdbcType=DECIMAL} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update AMS_SALE_ORDER_MATERIAL
+    set
+    SALE_ORDER_MATERIAL_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderMaterialId,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_MATERIAL_TRUCK_NO=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderMaterialTruckNo,jdbcType=DECIMAL}
+    </foreach>
+    ,MATERIAL_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_ORDER_MATERIAL_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderMaterialNumber,jdbcType=DECIMAL}
+    </foreach>
+    ,MATERIAL_THEORETICAL_WEIGHT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.materialTheoreticalWeight,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_SHIPPING_ADDRESS=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleShippingAddress,jdbcType=VARCHAR}
+    </foreach>
+    ,SALE_DATE_OF_RECEIPT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleDateOfReceipt,jdbcType=TIMESTAMP}
+    </foreach>
+    ,SALE_ORDER_CONSIGNEE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderConsignee,jdbcType=VARCHAR}
+    </foreach>
+    ,SALE_ORDER_CONSIGNEE_TEL=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.saleOrderConsigneeTel,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    ,UPDATED=
+    <foreach collection="list" item="item" index="index" separator=" " open="case SALE_ORDER_MATERIAL_ID" close="end">
+      when #{item.saleOrderMaterialId,jdbcType=DECIMAL} then #{item.updated,jdbcType=DECIMAL}
+    </foreach>
+    where SALE_ORDER_MATERIAL_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.saleOrderMaterialId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMS_SALE_ORDER_MATERIAL
+    where SALE_ORDER_MATERIAL_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(SALE_ORDER_MATERIAL_ID) from AMS_SALE_ORDER_MATERIAL
+  </select>
+
+  <select id="selectBySaleOrderMaterialId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
+    select
+      sale_material.SALE_ORDER_MATERIAL_TRUCK_NO "saleOrderMaterialTruckNo",
+      sale_material.MATERIAL_ID "materialId",
+      sale_material.SALE_ORDER_MATERIAL_NUMBER "saleOrderMaterialNumber",
+      sale_material.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
+      sale_material.SALE_SHIPPING_ADDRESS "saleShippingAddress",
+      sale_material.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
+      sale_material.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
+      sale_material.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel"
+    from AMS_SALE_ORDER_MATERIAL sale_material
+    where sale_material.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+  </select>
+
+  <select id="getAddress" parameterType="java.math.BigDecimal" resultType="String">
+    select SALE_SHIPPING_ADDRESS from AMS_SALE_ORDER_MATERIAL where SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
+  </select>
+
+  <!-- 展示所有未分派车辆的销售订单的车序号 -->
+  <select id="getSaleMaterial" parameterType="java.util.Map" resultType="java.util.Map">
+    select asom.sale_order_id as "saleOrderId",
+           asom.sale_order_material_truck_no as "saleOrderMaterialTruckNo",
+           rra.address_delivery_address as "addressDeliveryAddress",
+           asom.sale_date_of_receipt as "saleDateOfReceipt",
+           asom.sale_order_consignee as "saleOrderConsignee",
+           asom.sale_order_consignee_tel as "saleOrderConsigneeTel",
+           rc.carrier_name as "carrierName"
+    from ams_sale_order_material asom
+           left join ams_dispatch_sale_order adso on asom.sale_order_material_id=adso.sale_order_material_id
+           left join rms_carrier rc on adso.carrier_id=rc.carrier_id
+           left join rms_receive_address rra on asom.sale_shipping_address_id=rra.address_id
+    where asom.sale_order_material_id not in (select asom.sale_order_material_id
+                                              from ams_sale_order_material asom
+                                                     join omstruck_order oo on asom.sale_order_material_id = oo.order_plan_id)
+  </select>
+  <!-- 展示所有未分派车辆的销售订单的车序号 -->
+  <select id="selectById" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
+    select t.SALE_SHIPPING_ADDRESS_ID from ams_sale_order_material t where t.sale_order_material_id=#{saleOrderMaterialId}
+  </select>
+
+  <!--通过车序号、销售订单号查询中间表id-->
+  <select id="selectByCxh" parameterType="java.util.Map" resultType="java.lang.Integer">
+    select t.sale_order_material_id from ams_sale_order_material t where t.sale_order_id=#{param1} and t.sale_order_material_truck_no=#{param2}
+  </select>
+</mapper>

+ 474 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsSalePlanMapper.xml

@@ -0,0 +1,474 @@
+<?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.AmsSalePlanMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsSalePlan">
+    <id column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
+    <result column="PLAN_DATE" jdbcType="TIMESTAMP" property="planDate" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="PLAN_MATERIAL_NUMBER" jdbcType="DECIMAL" property="planMaterialNumber" />
+    <result column="SALE_AREA_ID" jdbcType="DECIMAL" property="saleAreaId" />
+    <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">
+    PLAN_ID, PLAN_DATE, MATERIAL_ID, PLAN_MATERIAL_NUMBER, SALE_AREA_ID, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.PLAN_ID, t.PLAN_DATE, t.MATERIAL_ID, t.PLAN_MATERIAL_NUMBER, t.SALE_AREA_ID, 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 AMS_SALE_PLAN
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMS_SALE_PLAN t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="planDate != null">
+        and TO_CHAR(PLAN_DATE,'yyyy-MM-dd') = #{planDate}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="planMaterialNumber != null">
+        and PLAN_MATERIAL_NUMBER = #{planMaterialNumber}
+      </if>
+      <if test="saleAreaId != null">
+        and SALE_AREA_ID = #{saleAreaId}
+      </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="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="planDate != null">
+        and TO_CHAR(PLAN_DATE,'yyyy-MM-dd') = #{planDate}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="planMaterialNumber != null">
+        and PLAN_MATERIAL_NUMBER = #{planMaterialNumber}
+      </if>
+      <if test="saleAreaId != null">
+        and SALE_AREA_ID = #{saleAreaId}
+      </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 AMS_SALE_PLAN
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMS_SALE_PLAN
+    where 1!=1
+    <if test="planDate != null">
+      or TO_CHAR(PLAN_DATE,'yyyy-MM-dd') = '#{planDate}'
+    </if>
+    <if test="materialId != null">
+      or MATERIAL_ID = #{materialId}
+    </if>
+    <if test="planMaterialNumber != null">
+      or PLAN_MATERIAL_NUMBER = #{planMaterialNumber}
+    </if>
+    <if test="saleAreaId != null">
+      or SALE_AREA_ID = #{saleAreaId}
+    </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.AmsSalePlan">
+    insert into AMS_SALE_PLAN (PLAN_ID, PLAN_DATE, MATERIAL_ID,
+                               PLAN_MATERIAL_NUMBER, SALE_AREA_ID, INSERT_USERNAME,
+                               INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                               INSERT_UPDATE_REMARK, DELETED)
+    values (#{planId,jdbcType=DECIMAL}, #{planDate,jdbcType=TIMESTAMP}, #{materialId,jdbcType=DECIMAL},
+            #{planMaterialNumber,jdbcType=DECIMAL}, #{saleAreaId,jdbcType=DECIMAL}, #{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.AmsSalePlan">
+    insert into AMS_SALE_PLAN
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="planId != null">
+        PLAN_ID,
+      </if>
+      <if test="planDate != null">
+        PLAN_DATE,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="planMaterialNumber != null">
+        PLAN_MATERIAL_NUMBER,
+      </if>
+      <if test="saleAreaId != null">
+        SALE_AREA_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>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="planId != null">
+        #{planId,jdbcType=DECIMAL},
+      </if>
+      <if test="planDate != null">
+        #{planDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="planMaterialNumber != null">
+        #{planMaterialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="saleAreaId != null">
+        #{saleAreaId,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSalePlan">
+    update AMS_SALE_PLAN
+    set PLAN_DATE = #{planDate,jdbcType=TIMESTAMP},
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+        PLAN_MATERIAL_NUMBER = #{planMaterialNumber,jdbcType=DECIMAL},
+        SALE_AREA_ID = #{saleAreaId,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}
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSalePlan">
+    update AMS_SALE_PLAN
+    <set>
+      <if test="planDate != null">
+        PLAN_DATE = #{planDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="planMaterialNumber != null">
+        PLAN_MATERIAL_NUMBER = #{planMaterialNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="saleAreaId != null">
+        SALE_AREA_ID = #{saleAreaId,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>
+    </set>
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where PLAN_ID = #{planId,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 AMS_SALE_PLAN
+    (PLAN_ID,
+    PLAN_DATE, MATERIAL_ID, PLAN_MATERIAL_NUMBER,
+    SALE_AREA_ID, INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, DELETED)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.planId,jdbcType=DECIMAL},
+    #{item.planDate,jdbcType=TIMESTAMP}, #{item.materialId,jdbcType=DECIMAL}, #{item.planMaterialNumber,jdbcType=DECIMAL},
+    #{item.saleAreaId,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} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update AMS_SALE_PLAN
+    set
+    PLAN_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
+    </foreach>
+    ,PLAN_DATE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.planDate,jdbcType=TIMESTAMP}
+    </foreach>
+    ,MATERIAL_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+    </foreach>
+    ,PLAN_MATERIAL_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.planMaterialNumber,jdbcType=DECIMAL}
+    </foreach>
+    ,SALE_AREA_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.saleAreaId,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+      when #{item.planId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    where PLAN_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.planId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMS_SALE_PLAN
+    where PLAN_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="getSalePlanInfo" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
+    select * from(
+    select a_s_plan.PLAN_ID "planId",
+    a_s_plan.PLAN_DATE "planDate",
+    r_material.MATERIAL_SPECIFICATION "materialSpecification",
+    r_s_area.AREA_NAME "areaName",
+    a_s_plan.PLAN_MATERIAL_NUMBER "planMaterialNumber",
+    a_s_plan.INSERT_USERNAME "insertUsername",
+    a_s_plan.INSERT_TIME "insertTime",
+    a_s_plan.INSERT_UPDATE_REMARK "insertUpdateRemark"
+    from AMS_SALE_PLAN a_s_plan
+    left join RMS_MATERIAL r_material
+    on a_s_plan.MATERIAL_ID=r_material.MATERIAL_ID
+    left join RMS_SALE_AREA r_s_area
+    on a_s_plan.SALE_AREA_ID=r_s_area.AREA_ID
+    where a_s_plan.DELETED=0)
+    <where>
+      <if test="planDate != null">
+        and
+        <foreach collection="planDate" item="item" open="(" separator="or" close=")">
+          "planDate" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="materialSpecification != null">
+        and
+        <foreach collection="materialSpecification" item="item" open="(" separator="or" close=")">
+          "materialSpecification" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="areaName != null">
+        and
+        <foreach collection="areaName" item="item" open="(" separator="or" close=")">
+          "areaName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="planMaterialNumber != null">
+        and
+        <foreach collection="planMaterialNumber" item="item" open="(" separator="or" close=")">
+          "planMaterialNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUsername != null">
+        and
+        <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
+          "insertUsername" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertTime != null">
+        and
+        <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
+          "insertTime" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
+        </foreach>
+      </if>
+      <include refid="orderBy"></include>
+    </where>
+  </select>
+
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by  "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+  </sql>
+
+  <select id="selectMaxId"  resultType="java.math.BigDecimal">
+    select max(PLAN_ID) from AMS_SALE_PLAN
+  </select>
+
+  <select id="getMaterialName" resultType="java.util.LinkedHashMap">
+    select
+      MATERIAL_ID "id",
+      MATERIAL_ID "value",
+      MATERIAL_SPECIFICATION "label"
+    from RMS_MATERIAL
+  </select>
+
+  <select id="getAreaName" resultType="java.util.LinkedHashMap">
+    select
+      AREA_ID "id",
+      AREA_ID "value",
+      AREA_NAME "label"
+    from RMS_SALE_AREA
+  </select>
+
+  <select id="selectByPlanId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
+    select
+      a_s_plan.PLAN_DATE "planDate",
+      r_material.MATERIAL_SPECIFICATION "materialSpecification",
+      r_s_area.AREA_NAME "areaName",
+      a_s_plan.PLAN_MATERIAL_NUMBER "planMaterialNumber",
+      a_s_plan.INSERT_USERNAME "insertUsername",
+      a_s_plan.INSERT_TIME "insertTime",
+      a_s_plan.INSERT_UPDATE_REMARK "insertUpdateRemark"
+    from AMS_SALE_PLAN a_s_plan
+           left join RMS_MATERIAL r_material
+                     on a_s_plan.MATERIAL_ID=r_material.MATERIAL_ID
+           left join RMS_SALE_AREA r_s_area
+                     on a_s_plan.SALE_AREA_ID=r_s_area.AREA_ID
+    where a_s_plan.PLAN_ID = #{planId}
+  </select>
+</mapper>

+ 394 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardPlanMapper.xml

@@ -0,0 +1,394 @@
+<?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.AmstruckInwardPlanMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardPlan">
+    <id column="PLAN_ID" jdbcType="DECIMAL" property="planId" />
+    <result column="PLAN_NUMBER" jdbcType="VARCHAR" property="planNumber" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="PLAN_TRUCK_NUMBER" jdbcType="DECIMAL" property="planTruckNumber" />
+    <result column="PLAN_STATUS" jdbcType="DECIMAL" property="planStatus" />
+    <result column="PLAN_ISSUE_TIME" jdbcType="TIMESTAMP" property="planIssueTime" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    PLAN_ID, PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME,
+  INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.PLAN_ID, t.PLAN_NUMBER, t.CARRIER_ID, t.PLAN_TRUCK_NUMBER, t.PLAN_STATUS, t.PLAN_ISSUE_TIME,
+  t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM AMSTRUCK_INWARD_PLAN
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMSTRUCK_INWARD_PLAN t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="planNumber != null and planNumber != ''">
+        and PLAN_NUMBER = #{planNumber}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="planTruckNumber != null">
+        and PLAN_TRUCK_NUMBER = #{planTruckNumber}
+      </if>
+      <if test="planStatus != null">
+        and PLAN_STATUS = #{planStatus}
+      </if>
+      <if test="planIssueTime != null">
+        and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="planId != null">
+        and PLAN_ID = #{planId}
+      </if>
+      <if test="planNumber != null and planNumber != ''">
+        and PLAN_NUMBER LIKE '%${planNumber}%'
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="planTruckNumber != null">
+        and PLAN_TRUCK_NUMBER = #{planTruckNumber}
+      </if>
+      <if test="planStatus != null">
+        and PLAN_STATUS = #{planStatus}
+      </if>
+      <if test="planIssueTime != null">
+        and TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = #{planIssueTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMSTRUCK_INWARD_PLAN
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMSTRUCK_INWARD_PLAN
+    where 1!=1 
+      <if test="planNumber != null and planNumber != ''">
+        or PLAN_NUMBER = #{planNumber}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="planTruckNumber != null">
+        or PLAN_TRUCK_NUMBER = #{planTruckNumber}
+      </if>
+      <if test="planStatus != null">
+        or PLAN_STATUS = #{planStatus}
+      </if>
+      <if test="planIssueTime != null">
+        or TO_CHAR(PLAN_ISSUE_TIME,'yyyy-MM-dd') = '#{planIssueTime}'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
+    insert into AMSTRUCK_INWARD_PLAN (PLAN_ID, PLAN_NUMBER, CARRIER_ID, 
+      PLAN_TRUCK_NUMBER, PLAN_STATUS, PLAN_ISSUE_TIME, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK)
+    values (#{planId,jdbcType=DECIMAL}, #{planNumber,jdbcType=VARCHAR}, #{carrierId,jdbcType=DECIMAL}, 
+      #{planTruckNumber,jdbcType=DECIMAL}, #{planStatus,jdbcType=DECIMAL}, #{planIssueTime,jdbcType=TIMESTAMP}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
+    insert into AMSTRUCK_INWARD_PLAN
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="planId != null">
+        PLAN_ID,
+      </if>
+      <if test="planNumber != null">
+        PLAN_NUMBER,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="planTruckNumber != null">
+        PLAN_TRUCK_NUMBER,
+      </if>
+      <if test="planStatus != null">
+        PLAN_STATUS,
+      </if>
+      <if test="planIssueTime != null">
+        PLAN_ISSUE_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>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="planId != null">
+        #{planId,jdbcType=DECIMAL},
+      </if>
+      <if test="planNumber != null">
+        #{planNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="planTruckNumber != null">
+        #{planTruckNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="planStatus != null">
+        #{planStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="planIssueTime != null">
+        #{planIssueTime,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
+    update AMSTRUCK_INWARD_PLAN
+    set PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
+      PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
+      PLAN_ISSUE_TIME = #{planIssueTime,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}
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardPlan">
+    update AMSTRUCK_INWARD_PLAN
+    <set>
+      <if test="planNumber != null">
+        PLAN_NUMBER = #{planNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="planTruckNumber != null">
+        PLAN_TRUCK_NUMBER = #{planTruckNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="planStatus != null">
+        PLAN_STATUS = #{planStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="planIssueTime != null">
+        PLAN_ISSUE_TIME = #{planIssueTime,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>
+    </set>
+    where PLAN_ID = #{planId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where PLAN_ID = #{planId,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 AMSTRUCK_INWARD_PLAN 
+      (PLAN_ID, 
+      PLAN_NUMBER, CARRIER_ID, PLAN_TRUCK_NUMBER, 
+      PLAN_STATUS, PLAN_ISSUE_TIME, 
+      INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.planId,jdbcType=DECIMAL}, 
+      #{item.planNumber,jdbcType=VARCHAR}, #{item.carrierId,jdbcType=DECIMAL}, #{item.planTruckNumber,jdbcType=DECIMAL}, 
+      #{item.planStatus,jdbcType=DECIMAL}, #{item.planIssueTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update AMSTRUCK_INWARD_PLAN
+     set
+       PLAN_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.planId,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN_NUMBER=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.planNumber,jdbcType=VARCHAR}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN_TRUCK_NUMBER=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.planTruckNumber,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN_STATUS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.planStatus,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN_ISSUE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.planIssueTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PLAN_ID" close="end">
+          when #{item.planId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+     where PLAN_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.planId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMSTRUCK_INWARD_PLAN
+    where PLAN_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 展示运输计划 -->
+  <select id="getTruckPlanList" resultType="java.util.Map" parameterType="java.util.Map">
+    select
+      aip.plan_number as "planNumber",
+      aip.plan_truck_number as "planTruckNumber",
+      rc.carrier_name as "carrierName",
+      air.purchase_order_id as "purchaseOrderId",
+      air.requirement_number as "requirementNumber",
+      air.requirement_type as "requirementType",
+      rct.capacity_type_name as "capacityTypeName",
+      air.requirement_truck_time as "requirementTruckTime",
+      rl.line_end_node_desc as "lineEndNodeDesc",
+      air.requirement_work_type as "requirementWorkType",
+      air.requirement_work_content as "requirementWorkContent",
+      air.requirement_work_environment as "requirementWorkEnvironment",
+      air.requirement_estimated_duration as "requirementEstimatedDuration",
+      air.requirement_overlimit as "requirementOverlimit",
+      rs.shipper_name as "shipperName"
+    from amstruck_inward_plan aip
+           left join amstruck_requirement_plan arp on aip.plan_id=arp.plan_id
+           left join amstruck_inward_requirement air on arp.requirement_id=air.requirement_id
+           left join rms_capacity_type rct on air.capacity_type_id=rct.capacity_type_id
+           left join rms_shipper rs on rs.shipper_id=air.requirement_shipper_id
+           left join rms_line rl on air.line_id=rl.line_id
+           left join rms_carrier rc on aip.carrier_id=rc.carrier_id
+    where air.requirement_status=0
+  </select>
+</mapper>

+ 627 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml

@@ -0,0 +1,627 @@
+<?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.AmstruckInwardRequirementMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckInwardRequirement">
+    <id column="REQUIREMENT_ID" jdbcType="DECIMAL" property="requirementId" />
+    <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
+    <result column="REQUIREMENT_NUMBER" jdbcType="VARCHAR" property="requirementNumber" />
+    <result column="REQUIREMENT_TYPE" jdbcType="VARCHAR" property="requirementType" />
+    <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
+    <result column="REQUIREMENT_TRUCK_TIME" jdbcType="TIMESTAMP" property="requirementTruckTime" />
+    <result column="REQUIREMENT_SHIPPER_ID" jdbcType="DECIMAL" property="requirementShipperId" />
+    <result column="REQUIREMENT_WORK_TYPE" jdbcType="DECIMAL" property="requirementWorkType" />
+    <result column="REQUIREMENT_WORK_CONTENT" jdbcType="VARCHAR" property="requirementWorkContent" />
+    <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
+    <result column="REQUIREMENT_WORK_ENVIRONMENT" jdbcType="VARCHAR" property="requirementWorkEnvironment" />
+    <result column="REQUIREMENT_ESTIMATED_DURATION" jdbcType="DECIMAL" property="requirementEstimatedDuration" />
+    <result column="REQUIREMENT_OVERLIMIT" jdbcType="VARCHAR" property="requirementOverlimit" />
+    <result column="REQUIREMNT_UNIT_ID" jdbcType="DECIMAL" property="requiremntUnitId" />
+    <result column="REQUIREMENT_STATUS" jdbcType="DECIMAL" property="requirementStatus" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER, REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
+    REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
+    LINE_ID, REQUIREMENT_WORK_ENVIRONMENT, REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
+    REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.REQUIREMENT_ID, t.PURCHASE_ORDER_ID, t.REQUIREMENT_NUMBER, t.REQUIREMENT_TYPE,
+    t.CAPACITY_TYPE_ID, t.REQUIREMENT_TRUCK_TIME, t.REQUIREMENT_SHIPPER_ID, t.REQUIREMENT_WORK_TYPE,
+    t.REQUIREMENT_WORK_CONTENT, t.LINE_ID, t.REQUIREMENT_WORK_ENVIRONMENT, t.REQUIREMENT_ESTIMATED_DURATION,
+    t.REQUIREMENT_OVERLIMIT, t.REQUIREMNT_UNIT_ID, t.REQUIREMENT_STATUS, t.INSERT_USERNAME,
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM AMSTRUCK_INWARD_REQUIREMENT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMSTRUCK_INWARD_REQUIREMENT t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="requirementId != null">
+        and REQUIREMENT_ID = #{requirementId}
+      </if>
+      <if test="purchaseOrderId != null">
+        and PURCHASE_ORDER_ID = #{purchaseOrderId}
+      </if>
+      <if test="requirementNumber != null and requirementNumber != ''">
+        and REQUIREMENT_NUMBER = #{requirementNumber}
+      </if>
+      <if test="requirementType != null and requirementType != ''">
+        and REQUIREMENT_TYPE = #{requirementType}
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="requirementTruckTime != null">
+        and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
+      </if>
+      <if test="requirementShipperId != null">
+        and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
+      </if>
+      <if test="requirementWorkType != null">
+        and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
+      </if>
+      <if test="requirementWorkContent != null and requirementWorkContent != ''">
+        and REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
+      </if>
+      <if test="lineId != null">
+        and LINE_ID = #{lineId}
+      </if>
+      <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
+        and REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
+      </if>
+      <if test="requirementEstimatedDuration != null">
+        and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
+      </if>
+      <if test="requirementOverlimit != null and requirementOverlimit != ''">
+        and REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
+      </if>
+      <if test="requiremntUnitId != null">
+        and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
+      </if>
+      <if test="requirementStatus != null">
+        and REQUIREMENT_STATUS = #{requirementStatus}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="requirementId != null">
+        and REQUIREMENT_ID = #{requirementId}
+      </if>
+      <if test="purchaseOrderId != null">
+        and PURCHASE_ORDER_ID = #{purchaseOrderId}
+      </if>
+      <if test="requirementNumber != null and requirementNumber != ''">
+        and REQUIREMENT_NUMBER LIKE '%${requirementNumber}%'
+      </if>
+      <if test="requirementType != null and requirementType != ''">
+        and REQUIREMENT_TYPE LIKE '%${requirementType}%'
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="requirementTruckTime != null">
+        and TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = #{requirementTruckTime}
+      </if>
+      <if test="requirementShipperId != null">
+        and REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
+      </if>
+      <if test="requirementWorkType != null">
+        and REQUIREMENT_WORK_TYPE = #{requirementWorkType}
+      </if>
+      <if test="requirementWorkContent != null and requirementWorkContent != ''">
+        and REQUIREMENT_WORK_CONTENT LIKE '%${requirementWorkContent}%'
+      </if>
+      <if test="lineId != null">
+        and LINE_ID = #{lineId}
+      </if>
+      <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
+        and REQUIREMENT_WORK_ENVIRONMENT LIKE '%${requirementWorkEnvironment}%'
+      </if>
+      <if test="requirementEstimatedDuration != null">
+        and REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
+      </if>
+      <if test="requirementOverlimit != null and requirementOverlimit != ''">
+        and REQUIREMENT_OVERLIMIT LIKE '%${requirementOverlimit}%'
+      </if>
+      <if test="requiremntUnitId != null">
+        and REQUIREMNT_UNIT_ID = #{requiremntUnitId}
+      </if>
+      <if test="requirementStatus != null">
+        and REQUIREMENT_STATUS = #{requirementStatus}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMSTRUCK_INWARD_REQUIREMENT
+    where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMSTRUCK_INWARD_REQUIREMENT
+    where 1!=1
+    <if test="purchaseOrderId != null">
+      or PURCHASE_ORDER_ID = #{purchaseOrderId}
+    </if>
+    <if test="requirementNumber != null and requirementNumber != ''">
+      or REQUIREMENT_NUMBER = #{requirementNumber}
+    </if>
+    <if test="requirementType != null and requirementType != ''">
+      or REQUIREMENT_TYPE = #{requirementType}
+    </if>
+    <if test="capacityTypeId != null">
+      or CAPACITY_TYPE_ID = #{capacityTypeId}
+    </if>
+    <if test="requirementTruckTime != null">
+      or TO_CHAR(REQUIREMENT_TRUCK_TIME,'yyyy-MM-dd') = '#{requirementTruckTime}'
+    </if>
+    <if test="requirementShipperId != null">
+      or REQUIREMENT_SHIPPER_ID = #{requirementShipperId}
+    </if>
+    <if test="requirementWorkType != null">
+      or REQUIREMENT_WORK_TYPE = #{requirementWorkType}
+    </if>
+    <if test="requirementWorkContent != null and requirementWorkContent != ''">
+      or REQUIREMENT_WORK_CONTENT = #{requirementWorkContent}
+    </if>
+    <if test="lineId != null">
+      or LINE_ID = #{lineId}
+    </if>
+    <if test="requirementWorkEnvironment != null and requirementWorkEnvironment != ''">
+      or REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment}
+    </if>
+    <if test="requirementEstimatedDuration != null">
+      or REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration}
+    </if>
+    <if test="requirementOverlimit != null and requirementOverlimit != ''">
+      or REQUIREMENT_OVERLIMIT = #{requirementOverlimit}
+    </if>
+    <if test="requiremntUnitId != null">
+      or REQUIREMNT_UNIT_ID = #{requiremntUnitId}
+    </if>
+    <if test="requirementStatus != null">
+      or REQUIREMENT_STATUS = #{requirementStatus}
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
+    insert into AMSTRUCK_INWARD_REQUIREMENT (REQUIREMENT_ID, PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
+                                             REQUIREMENT_TYPE, CAPACITY_TYPE_ID, REQUIREMENT_TRUCK_TIME,
+                                             REQUIREMENT_SHIPPER_ID, REQUIREMENT_WORK_TYPE,
+                                             REQUIREMENT_WORK_CONTENT, LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
+                                             REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
+                                             REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS, INSERT_USERNAME,
+                                             INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                             INSERT_UPDATE_REMARK)
+    values (#{requirementId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{requirementNumber,jdbcType=VARCHAR},
+            #{requirementType,jdbcType=VARCHAR}, #{capacityTypeId,jdbcType=DECIMAL}, #{requirementTruckTime,jdbcType=TIMESTAMP},
+            #{requirementShipperId,jdbcType=DECIMAL}, #{requirementWorkType,jdbcType=DECIMAL},
+            #{requirementWorkContent,jdbcType=VARCHAR}, #{lineId,jdbcType=DECIMAL}, #{requirementWorkEnvironment,jdbcType=VARCHAR},
+            #{requirementEstimatedDuration,jdbcType=DECIMAL}, #{requirementOverlimit,jdbcType=VARCHAR},
+            #{requiremntUnitId,jdbcType=DECIMAL}, #{requirementStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
+            #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+            #{insertUpdateRemark,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
+    insert into AMSTRUCK_INWARD_REQUIREMENT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="requirementId != null">
+        REQUIREMENT_ID,
+      </if>
+      <if test="purchaseOrderId != null">
+        PURCHASE_ORDER_ID,
+      </if>
+      <if test="requirementNumber != null">
+        REQUIREMENT_NUMBER,
+      </if>
+      <if test="requirementType != null">
+        REQUIREMENT_TYPE,
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID,
+      </if>
+      <if test="requirementTruckTime != null">
+        REQUIREMENT_TRUCK_TIME,
+      </if>
+      <if test="requirementShipperId != null">
+        REQUIREMENT_SHIPPER_ID,
+      </if>
+      <if test="requirementWorkType != null">
+        REQUIREMENT_WORK_TYPE,
+      </if>
+      <if test="requirementWorkContent != null">
+        REQUIREMENT_WORK_CONTENT,
+      </if>
+      <if test="lineId != null">
+        LINE_ID,
+      </if>
+      <if test="requirementWorkEnvironment != null">
+        REQUIREMENT_WORK_ENVIRONMENT,
+      </if>
+      <if test="requirementEstimatedDuration != null">
+        REQUIREMENT_ESTIMATED_DURATION,
+      </if>
+      <if test="requirementOverlimit != null">
+        REQUIREMENT_OVERLIMIT,
+      </if>
+      <if test="requiremntUnitId != null">
+        REQUIREMNT_UNIT_ID,
+      </if>
+      <if test="requirementStatus != null">
+        REQUIREMENT_STATUS,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="requirementId != null">
+        #{requirementId,jdbcType=DECIMAL},
+      </if>
+      <if test="purchaseOrderId != null">
+        #{purchaseOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementNumber != null">
+        #{requirementNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="requirementType != null">
+        #{requirementType,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityTypeId != null">
+        #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementTruckTime != null">
+        #{requirementTruckTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="requirementShipperId != null">
+        #{requirementShipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkType != null">
+        #{requirementWorkType,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkContent != null">
+        #{requirementWorkContent,jdbcType=VARCHAR},
+      </if>
+      <if test="lineId != null">
+        #{lineId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkEnvironment != null">
+        #{requirementWorkEnvironment,jdbcType=VARCHAR},
+      </if>
+      <if test="requirementEstimatedDuration != null">
+        #{requirementEstimatedDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementOverlimit != null">
+        #{requirementOverlimit,jdbcType=VARCHAR},
+      </if>
+      <if test="requiremntUnitId != null">
+        #{requiremntUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementStatus != null">
+        #{requirementStatus,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
+    update AMSTRUCK_INWARD_REQUIREMENT
+    set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
+        REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
+        REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
+        CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+        REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
+        REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
+        REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
+        REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
+        LINE_ID = #{lineId,jdbcType=DECIMAL},
+        REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
+        REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
+        REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
+        REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
+        REQUIREMENT_STATUS = #{requirementStatus,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}
+    where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckInwardRequirement">
+    update AMSTRUCK_INWARD_REQUIREMENT
+    <set>
+      <if test="purchaseOrderId != null">
+        PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementNumber != null">
+        REQUIREMENT_NUMBER = #{requirementNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="requirementType != null">
+        REQUIREMENT_TYPE = #{requirementType,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementTruckTime != null">
+        REQUIREMENT_TRUCK_TIME = #{requirementTruckTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="requirementShipperId != null">
+        REQUIREMENT_SHIPPER_ID = #{requirementShipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkType != null">
+        REQUIREMENT_WORK_TYPE = #{requirementWorkType,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkContent != null">
+        REQUIREMENT_WORK_CONTENT = #{requirementWorkContent,jdbcType=VARCHAR},
+      </if>
+      <if test="lineId != null">
+        LINE_ID = #{lineId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementWorkEnvironment != null">
+        REQUIREMENT_WORK_ENVIRONMENT = #{requirementWorkEnvironment,jdbcType=VARCHAR},
+      </if>
+      <if test="requirementEstimatedDuration != null">
+        REQUIREMENT_ESTIMATED_DURATION = #{requirementEstimatedDuration,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementOverlimit != null">
+        REQUIREMENT_OVERLIMIT = #{requirementOverlimit,jdbcType=VARCHAR},
+      </if>
+      <if test="requiremntUnitId != null">
+        REQUIREMNT_UNIT_ID = #{requiremntUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="requirementStatus != null">
+        REQUIREMENT_STATUS = #{requirementStatus,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>
+    </set>
+    where REQUIREMENT_ID = #{requirementId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where REQUIREMENT_ID = #{requirementId,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 AMSTRUCK_INWARD_REQUIREMENT
+    (REQUIREMENT_ID,
+    PURCHASE_ORDER_ID, REQUIREMENT_NUMBER,
+    REQUIREMENT_TYPE, CAPACITY_TYPE_ID,
+    REQUIREMENT_TRUCK_TIME, REQUIREMENT_SHIPPER_ID,
+    REQUIREMENT_WORK_TYPE, REQUIREMENT_WORK_CONTENT,
+    LINE_ID, REQUIREMENT_WORK_ENVIRONMENT,
+    REQUIREMENT_ESTIMATED_DURATION, REQUIREMENT_OVERLIMIT,
+    REQUIREMNT_UNIT_ID, REQUIREMENT_STATUS,
+    INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.requirementId,jdbcType=DECIMAL},
+    #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.requirementNumber,jdbcType=VARCHAR},
+    #{item.requirementType,jdbcType=VARCHAR}, #{item.capacityTypeId,jdbcType=DECIMAL},
+    #{item.requirementTruckTime,jdbcType=TIMESTAMP}, #{item.requirementShipperId,jdbcType=DECIMAL},
+    #{item.requirementWorkType,jdbcType=DECIMAL}, #{item.requirementWorkContent,jdbcType=VARCHAR},
+    #{item.lineId,jdbcType=DECIMAL}, #{item.requirementWorkEnvironment,jdbcType=VARCHAR},
+    #{item.requirementEstimatedDuration,jdbcType=DECIMAL}, #{item.requirementOverlimit,jdbcType=VARCHAR},
+    #{item.requiremntUnitId,jdbcType=DECIMAL}, #{item.requirementStatus,jdbcType=DECIMAL},
+    #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+    #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+    #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update AMSTRUCK_INWARD_REQUIREMENT
+    set
+    REQUIREMENT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementId,jdbcType=DECIMAL}
+    </foreach>
+    ,PURCHASE_ORDER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementNumber,jdbcType=VARCHAR}
+    </foreach>
+    ,REQUIREMENT_TYPE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementType,jdbcType=VARCHAR}
+    </foreach>
+    ,CAPACITY_TYPE_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_TRUCK_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementTruckTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,REQUIREMENT_SHIPPER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementShipperId,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_WORK_TYPE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkType,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_WORK_CONTENT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkContent,jdbcType=VARCHAR}
+    </foreach>
+    ,LINE_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_WORK_ENVIRONMENT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementWorkEnvironment,jdbcType=VARCHAR}
+    </foreach>
+    ,REQUIREMENT_ESTIMATED_DURATION=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementEstimatedDuration,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_OVERLIMIT=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementOverlimit,jdbcType=VARCHAR}
+    </foreach>
+    ,REQUIREMNT_UNIT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requiremntUnitId,jdbcType=DECIMAL}
+    </foreach>
+    ,REQUIREMENT_STATUS=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.requirementStatus,jdbcType=DECIMAL}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case REQUIREMENT_ID" close="end">
+      when #{item.requirementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    where REQUIREMENT_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.requirementId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMSTRUCK_INWARD_REQUIREMENT
+    where REQUIREMENT_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 展示用车需求 -->
+  <select id="getTruckRequirementList" resultType="java.util.Map" parameterType="java.util.Map">
+    select air.purchase_order_id as "purchaseOrderId",
+           air.requirement_number as "requirementNumber",
+           air.requirement_type as "requirementType",
+           rct.capacity_type_name as "capacityTypeName",
+           air.requirement_truck_time as "requirementTruckTime",
+           rl.line_end_node_desc as "lineEndNodeDesc",
+           air.requirement_work_type as "requirementWorkType",
+           air.requirement_work_content as "requirementWorkContent",
+           air.requirement_work_environment as "requirementWorkEnvironment",
+           air.requirement_estimated_duration as "requirementEstimatedDuration",
+           air.requirement_overlimit as "requirementOverlimit",
+           rs.shipper_name as "shipperName"
+    from amstruck_inward_requirement air
+           left join rms_capacity_type rct on air.capacity_type_id=rct.capacity_type_id
+           left join rms_shipper rs on rs.shipper_id=air.requirement_shipper_id
+           left join rms_line rl on air.line_id=rl.line_id
+    where air.requirement_status=0
+  </select>
+</mapper>

+ 518 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckRailDayplanMapper.xml

@@ -0,0 +1,518 @@
+<?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.AmstruckRailDayplanMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmstruckRailDayplan">
+    <id column="DAYPLAN_ID" jdbcType="DECIMAL" property="dayplanId" />
+    <result column="DAYPLAN_NO" jdbcType="VARCHAR" property="dayplanNo" />
+    <result column="DAYPLAN_TRUCK_NUMBER" jdbcType="DECIMAL" property="dayplanTruckNumber" />
+    <result column="SHIPMENT_UNIT_ID" jdbcType="DECIMAL" property="shipmentUnitId" />
+    <result column="DAYPLAN_DELIVERY_PLACE" jdbcType="VARCHAR" property="dayplanDeliveryPlace" />
+    <result column="DAYPLAN_RECEIVE_UNIT" jdbcType="VARCHAR" property="dayplanReceiveUnit" />
+    <result column="DAYPLAN_DELIVERY_DATE" jdbcType="TIMESTAMP" property="dayplanDeliveryDate" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="DAYPLAN_MATERIAL_WEIGHT" jdbcType="DECIMAL" property="dayplanMaterialWeight" />
+    <result column="DAYPLAN_RECEIVE_STATUS" jdbcType="DECIMAL" property="dayplanReceiveStatus" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+  </resultMap>
+  <sql id="columns">
+    DAYPLAN_ID, DAYPLAN_NO, DAYPLAN_TRUCK_NUMBER, SHIPMENT_UNIT_ID, DAYPLAN_DELIVERY_PLACE, 
+    DAYPLAN_RECEIVE_UNIT, DAYPLAN_DELIVERY_DATE, MATERIAL_ID, DAYPLAN_MATERIAL_WEIGHT, 
+    DAYPLAN_RECEIVE_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+    INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="columns_alias">
+    t.DAYPLAN_ID, t.DAYPLAN_NO, t.DAYPLAN_TRUCK_NUMBER, t.SHIPMENT_UNIT_ID, t.DAYPLAN_DELIVERY_PLACE, 
+    t.DAYPLAN_RECEIVE_UNIT, t.DAYPLAN_DELIVERY_DATE, t.MATERIAL_ID, t.DAYPLAN_MATERIAL_WEIGHT, 
+    t.DAYPLAN_RECEIVE_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, 
+    t.INSERT_UPDATE_REMARK
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM AMSTRUCK_RAIL_DAYPLAN
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM AMSTRUCK_RAIL_DAYPLAN t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="dayplanId != null">
+        and DAYPLAN_ID = #{dayplanId}
+      </if>
+      <if test="dayplanNo != null and dayplanNo != ''">
+        and DAYPLAN_NO = #{dayplanNo}
+      </if>
+      <if test="dayplanTruckNumber != null">
+        and DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber}
+      </if>
+      <if test="shipmentUnitId != null">
+        and SHIPMENT_UNIT_ID = #{shipmentUnitId}
+      </if>
+      <if test="dayplanDeliveryPlace != null and dayplanDeliveryPlace != ''">
+        and DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace}
+      </if>
+      <if test="dayplanReceiveUnit != null and dayplanReceiveUnit != ''">
+        and DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit}
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        and TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = #{dayplanDeliveryDate}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        and DAYPLAN_MATERIAL_WEIGHT = #{dayplanMaterialWeight}
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        and DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="dayplanId != null">
+        and DAYPLAN_ID = #{dayplanId}
+      </if>
+      <if test="dayplanNo != null and dayplanNo != ''">
+        and DAYPLAN_NO LIKE '%${dayplanNo}%'
+      </if>
+      <if test="dayplanTruckNumber != null">
+        and DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber}
+      </if>
+      <if test="shipmentUnitId != null">
+        and SHIPMENT_UNIT_ID = #{shipmentUnitId}
+      </if>
+      <if test="dayplanDeliveryPlace != null and dayplanDeliveryPlace != ''">
+        and DAYPLAN_DELIVERY_PLACE LIKE '%${dayplanDeliveryPlace}%'
+      </if>
+      <if test="dayplanReceiveUnit != null and dayplanReceiveUnit != ''">
+        and DAYPLAN_RECEIVE_UNIT LIKE '%${dayplanReceiveUnit}%'
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        and TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = #{dayplanDeliveryDate}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        and DAYPLAN_MATERIAL_WEIGHT = #{dayplanMaterialWeight}
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        and DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from AMSTRUCK_RAIL_DAYPLAN
+    where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMSTRUCK_RAIL_DAYPLAN
+    where 1!=1 
+      <if test="dayplanNo != null and dayplanNo != ''">
+        or DAYPLAN_NO = #{dayplanNo}
+      </if>
+      <if test="dayplanTruckNumber != null">
+        or DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber}
+      </if>
+      <if test="shipmentUnitId != null">
+        or SHIPMENT_UNIT_ID = #{shipmentUnitId}
+      </if>
+      <if test="dayplanDeliveryPlace != null and dayplanDeliveryPlace != ''">
+        or DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace}
+      </if>
+      <if test="dayplanReceiveUnit != null and dayplanReceiveUnit != ''">
+        or DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit}
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        or TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = '#{dayplanDeliveryDate}'
+      </if>
+      <if test="materialId != null">
+        or MATERIAL_ID = #{materialId}
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        or DAYPLAN_MATERIAL_WEIGHT = #{dayplanMaterialWeight}
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        or DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
+    insert into AMSTRUCK_RAIL_DAYPLAN (DAYPLAN_ID, DAYPLAN_NO, DAYPLAN_TRUCK_NUMBER, 
+      SHIPMENT_UNIT_ID, DAYPLAN_DELIVERY_PLACE, DAYPLAN_RECEIVE_UNIT, 
+      DAYPLAN_DELIVERY_DATE, MATERIAL_ID, DAYPLAN_MATERIAL_WEIGHT, 
+      DAYPLAN_RECEIVE_STATUS, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+      )
+    values (#{dayplanId,jdbcType=DECIMAL}, #{dayplanNo,jdbcType=VARCHAR}, #{dayplanTruckNumber,jdbcType=DECIMAL}, 
+      #{shipmentUnitId,jdbcType=DECIMAL}, #{dayplanDeliveryPlace,jdbcType=VARCHAR}, #{dayplanReceiveUnit,jdbcType=VARCHAR}, 
+      #{dayplanDeliveryDate,jdbcType=TIMESTAMP}, #{materialId,jdbcType=DECIMAL}, #{dayplanMaterialWeight,jdbcType=DECIMAL}, 
+      #{dayplanReceiveStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
+      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
+    insert into AMSTRUCK_RAIL_DAYPLAN
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="dayplanId != null">
+        DAYPLAN_ID,
+      </if>
+      <if test="dayplanNo != null">
+        DAYPLAN_NO,
+      </if>
+      <if test="dayplanTruckNumber != null">
+        DAYPLAN_TRUCK_NUMBER,
+      </if>
+      <if test="shipmentUnitId != null">
+        SHIPMENT_UNIT_ID,
+      </if>
+      <if test="dayplanDeliveryPlace != null">
+        DAYPLAN_DELIVERY_PLACE,
+      </if>
+      <if test="dayplanReceiveUnit != null">
+        DAYPLAN_RECEIVE_UNIT,
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        DAYPLAN_DELIVERY_DATE,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        DAYPLAN_MATERIAL_WEIGHT,
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        DAYPLAN_RECEIVE_STATUS,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="dayplanId != null">
+        #{dayplanId,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanNo != null">
+        #{dayplanNo,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanTruckNumber != null">
+        #{dayplanTruckNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="shipmentUnitId != null">
+        #{shipmentUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanDeliveryPlace != null">
+        #{dayplanDeliveryPlace,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanReceiveUnit != null">
+        #{dayplanReceiveUnit,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        #{dayplanMaterialWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        #{dayplanReceiveStatus,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
+    update AMSTRUCK_RAIL_DAYPLAN
+    set DAYPLAN_NO = #{dayplanNo,jdbcType=VARCHAR},
+      DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber,jdbcType=DECIMAL},
+      SHIPMENT_UNIT_ID = #{shipmentUnitId,jdbcType=DECIMAL},
+      DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace,jdbcType=VARCHAR},
+      DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit,jdbcType=VARCHAR},
+      DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
+      MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      DAYPLAN_MATERIAL_WEIGHT = #{dayplanMaterialWeight,jdbcType=DECIMAL},
+      DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus,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}
+    where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
+    update AMSTRUCK_RAIL_DAYPLAN
+    <set>
+      <if test="dayplanNo != null">
+        DAYPLAN_NO = #{dayplanNo,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanTruckNumber != null">
+        DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="shipmentUnitId != null">
+        SHIPMENT_UNIT_ID = #{shipmentUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanDeliveryPlace != null">
+        DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanReceiveUnit != null">
+        DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit,jdbcType=VARCHAR},
+      </if>
+      <if test="dayplanDeliveryDate != null">
+        DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanMaterialWeight != null">
+        DAYPLAN_MATERIAL_WEIGHT = #{dayplanMaterialWeight,jdbcType=DECIMAL},
+      </if>
+      <if test="dayplanReceiveStatus != null">
+        DAYPLAN_RECEIVE_STATUS = #{dayplanReceiveStatus,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>
+    </set>
+    where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where DAYPLAN_ID = #{dayplanId,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 AMSTRUCK_RAIL_DAYPLAN 
+      (DAYPLAN_ID, 
+      DAYPLAN_NO, DAYPLAN_TRUCK_NUMBER, 
+      SHIPMENT_UNIT_ID, DAYPLAN_DELIVERY_PLACE, 
+      DAYPLAN_RECEIVE_UNIT, DAYPLAN_DELIVERY_DATE, 
+      MATERIAL_ID, DAYPLAN_MATERIAL_WEIGHT, 
+      DAYPLAN_RECEIVE_STATUS, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.dayplanId,jdbcType=DECIMAL}, 
+      #{item.dayplanNo,jdbcType=VARCHAR}, #{item.dayplanTruckNumber,jdbcType=DECIMAL}, 
+      #{item.shipmentUnitId,jdbcType=DECIMAL}, #{item.dayplanDeliveryPlace,jdbcType=VARCHAR}, 
+      #{item.dayplanReceiveUnit,jdbcType=VARCHAR}, #{item.dayplanDeliveryDate,jdbcType=TIMESTAMP}, 
+      #{item.materialId,jdbcType=DECIMAL}, #{item.dayplanMaterialWeight,jdbcType=DECIMAL}, 
+      #{item.dayplanReceiveStatus,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update AMSTRUCK_RAIL_DAYPLAN
+     set
+       DAYPLAN_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanId,jdbcType=DECIMAL}
+       </foreach>
+       ,DAYPLAN_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanNo,jdbcType=VARCHAR}
+       </foreach>
+       ,DAYPLAN_TRUCK_NUMBER=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanTruckNumber,jdbcType=DECIMAL}
+       </foreach>
+       ,SHIPMENT_UNIT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.shipmentUnitId,jdbcType=DECIMAL}
+       </foreach>
+       ,DAYPLAN_DELIVERY_PLACE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanDeliveryPlace,jdbcType=VARCHAR}
+       </foreach>
+       ,DAYPLAN_RECEIVE_UNIT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanReceiveUnit,jdbcType=VARCHAR}
+       </foreach>
+       ,DAYPLAN_DELIVERY_DATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanDeliveryDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,MATERIAL_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+       </foreach>
+       ,DAYPLAN_MATERIAL_WEIGHT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanMaterialWeight,jdbcType=DECIMAL}
+       </foreach>
+       ,DAYPLAN_RECEIVE_STATUS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.dayplanReceiveStatus,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+          when #{item.dayplanId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+     where DAYPLAN_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.dayplanId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from AMSTRUCK_RAIL_DAYPLAN
+    where DAYPLAN_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 展示汽车发运焦炭/水渣日计划 -->
+  <select id="getTruckRailDayPlan" parameterType="java.util.Map" resultType="java.util.Map">
+       select
+              t.DAYPLAN_ID "dayPlanId",
+              t.dayplan_no as "dayplanNo",
+       t.dayplan_truck_number as "dayplanTruckNumber",
+       t.shipment_unit_id as "shipmentUnitId",
+       t.dayplan_delivery_place as "dayplanDeliveryPlace",
+       t.dayplan_receive_unit as "dayplanReceiveUnit",
+       t.dayplan_delivery_date as "dayplanDeliveryDate",
+       rm.material_name as "materialName",
+       t.dayplan_material_weight as "dayplanMaterialWeight"
+from amstruck_rail_dayplan t
+left join rms_material rm on t.material_id=rm.material_id
+where t.dayplan_receive_status=0 and  t.material_id=495
+    </select>
+  <!-- 展示汽车发运焦炭/水渣日计划 -->
+  <select id="getSzTruckRailDayPlan" parameterType="java.util.Map" resultType="java.util.Map">
+       select
+         t.DAYPLAN_ID "dayPlanId",t.dayplan_no as "dayplanNo",
+       t.dayplan_truck_number as "dayplanTruckNumber",
+       t.shipment_unit_id as "shipmentUnitId",
+       t.dayplan_delivery_place as "dayplanDeliveryPlace",
+       t.dayplan_receive_unit as "dayplanReceiveUnit",
+       t.dayplan_delivery_date as "dayplanDeliveryDate",
+       rm.material_name as "materialName",
+       t.dayplan_material_weight as "dayplanMaterialWeight"
+from amstruck_rail_dayplan t
+left join rms_material rm on t.material_id=rm.material_id
+where t.dayplan_receive_status=0 and  t.material_id=496
+    </select>
+
+  <!-- 得到最大id -->
+  <select id="selectMaxId" resultType="DECIMAL">
+        SELECT MAX(DAYPLAN_ID)
+        FROM amstruck_rail_dayplan
+    </select>
+<!--通过主键id查询所有数据-->
+  <select id="selectByDayPlanId" parameterType="java.lang.Integer" resultType="com.steerinfo.dil.model.AmstruckRailDayplan">
+        select * from amstruck_rail_dayplan t where t.DAYPLAN_ID=#{id}
+    </select>
+</mapper>

+ 292 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckRequirementPlanMapper.xml

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