Quellcode durchsuchen

编写发运计划到异地库后端

txf vor 3 Jahren
Ursprung
Commit
b8e590e16d

+ 2 - 2
pom.xml

@@ -111,8 +111,8 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>AMS_DISPATCH_SALE_ORDER</param><!--销售计划-->
-<!--                        <param>AMS_SALE_PLAN_MATERIAL</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
+                        <param>AMS_RAIL_OFFSET_MATERIAL</param><!--销售计划-->
+<!--                        <param>AMSTRUCK_RAIL_DAYPLAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
 <!--                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;-->
 <!--                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->
 <!--                        <param>AMS_SALE_TRUCKNO_MATERIAL</param>&lt;!&ndash;车序号物资中间表&ndash;&gt;-->

+ 26 - 14
src/main/java/com/steerinfo/dil/controller/AmsRailOffsetDayplanController.java

@@ -1,5 +1,6 @@
 package com.steerinfo.dil.controller;
 
+import com.steerinfo.dil.mapper.AmsRailOffsetDayplanMapper;
 import com.steerinfo.dil.model.AmsRailOffsetDayplan;
 import com.steerinfo.dil.service.impl.AmsRailOffsetDayplanServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
@@ -24,28 +25,39 @@ public class AmsRailOffsetDayplanController extends BaseRESTfulController {
     AmsRailOffsetDayplanServiceImpl amsRailOffsetDayplanService;
     @Autowired
     ColumnDataUtil columnDataUtil;
-    /**
-     *新增钢材发往异地库计划
-     */
+    @Autowired
+    AmsRailOffsetDayplanMapper amsRailOffsetDayplanMapper;
+
+
+    @ApiModelProperty(value = "新增钢材发往异地库计划")
     @PostMapping("/addRailOffsetDayplan")
     public RESTfulResult addRailOffsetDayplan(@RequestBody AmsRailOffsetDayplan amsRailOffsetDayplan) {
-        if(amsRailOffsetDayplan==null){
-            return failed();
-        }
-        amsRailOffsetDayplanService.insert(amsRailOffsetDayplan);
-        return success();
+        int i = amsRailOffsetDayplanService.insert(amsRailOffsetDayplan);
+        return success(i);
     }
-    /**
-     * 删除钢材发往异地库计划
-     */
+
+    @ApiModelProperty(value = "通过主键Id查询发运异地库数据")
+    @PostMapping("/getRailOffseDayMes")
+    public RESTfulResult getRailOffseDayMes(Integer dayplanId) {
+        List<Map<String, Object>> mes = amsRailOffsetDayplanMapper.getRailOffseDayMes(dayplanId);
+        return success(mes);
+    }
+
+    @ApiModelProperty(value = "通过发运计划主键查询关联所有物资信息")
+    @PostMapping("/getMaterialMesByDayPlanId")
+    public RESTfulResult getMaterialMesByDayPlanId(Integer dayplanId) {
+        List<Map<String, Object>> mes = amsRailOffsetDayplanMapper.getMaterialMesByDayPlanId(dayplanId);
+        return success(mes);
+    }
+
+    @ApiModelProperty(value = "删除钢材发往异地库计划")
     @PostMapping("/deleteRailOffsetDayplan/{dayPlanId}")
     public RESTfulResult deleteTruckRailDayPlan(@PathVariable("dayPlanId") BigDecimal dayPlanId) {
         amsRailOffsetDayplanService.delete(dayPlanId);
         return success("删除成功");
     }
-    /**
-     * 修改钢材发往异地库计划
-     */
+
+    @ApiModelProperty(value = "修改钢材发往异地库计划")
     @PostMapping("/updateRailOffsetDayplan")
     public RESTfulResult updateRailOffsetDayplan(@RequestBody AmsRailOffsetDayplan amsRailOffsetDayplan) {
         if(amsRailOffsetDayplan.getDayplanId()==null){

+ 34 - 2
src/main/java/com/steerinfo/dil/controller/AmstruckRailDayplanController.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.controller;
 
 
+import com.steerinfo.dil.mapper.AmstruckRailDayplanMapper;
 import com.steerinfo.dil.model.AmstruckRailDayplan;
 import com.steerinfo.dil.service.IAmstruckRailDayplanService;
 import com.steerinfo.dil.util.BaseRESTfulController;
@@ -41,6 +42,8 @@ public class AmstruckRailDayplanController extends BaseRESTfulController {
     IAmstruckRailDayplanService amstruckRailDayplanService;
     @Autowired
     ColumnDataUtil columnDataUtil;
+    @Autowired
+    AmstruckRailDayplanMapper amstruckRailDayplanMapper;
 
     @ApiOperation(value="查询所有到站信息")
     @ApiImplicitParams({
@@ -52,7 +55,32 @@ public class AmstruckRailDayplanController extends BaseRESTfulController {
         return success(arriveName);
     }
 
+    /**
+     *通过发运计划Id查询信息
+     */
+    @PostMapping("/getDayPlanByDayPlanId/{dayplanId}")
+    public RESTfulResult getDayPlanByDayPlanId(@PathVariable("dayplanId") Integer dayplanId) {
+        List<Map<String, Object>> mes = amstruckRailDayplanService.getDayPlanByDayPlanId(dayplanId);
+        return success(mes);
+    }
+
+    /**
+     * 查询所有的承运商
+     */
+    @GetMapping("/getCarrierMes")
+    public RESTfulResult getCarrierMes() {
+        List<Map<String, Object>> carrierMes = amstruckRailDayplanMapper.getCarrierMes();
+        return success(carrierMes);
+    }
 
+    /**
+     * 修改日计划
+     */
+    @PostMapping("/updateDayPlan")
+    public RESTfulResult updateDayPlan(@RequestBody(required = false) AmstruckRailDayplan amstruckRailDayplan) {
+        int i = amstruckRailDayplanMapper.updateByPrimaryKeySelective(amstruckRailDayplan);
+        return success(i);
+    }
 
     /**
      *新增日计划
@@ -96,7 +124,9 @@ public class AmstruckRailDayplanController extends BaseRESTfulController {
     public RESTfulResult getTruckRailDayPlan(@RequestBody(required = false) Map<String,Object> mapValue,
                                              Integer pageNum,
                                              Integer pageSize,
-                                             Integer apiId) {
+                                             Integer apiId,
+                                             Integer status) {
+        mapValue.put("status", status);
         List<Map<String, Object>> list = amstruckRailDayplanService.getTruckRailDayPlan(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
@@ -117,7 +147,9 @@ public class AmstruckRailDayplanController extends BaseRESTfulController {
     public RESTfulResult getSzTruckRailDayPlan(@RequestBody(required = false) Map<String,Object> mapValue,
                                                Integer pageNum,
                                                Integer pageSize,
-                                               Integer apiId) {
+                                               Integer apiId,
+                                               Integer status) {
+        mapValue.put("status", status);
         List<Map<String, Object>> list = amstruckRailDayplanService.getSzTruckRailDayPlan(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据

+ 7 - 6
src/main/java/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.java

@@ -12,15 +12,16 @@ 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();
+    Integer selectMaxId();
+
     //展示钢材发往异地库日计划
     List<Map<String, Object>> getRailOffsetDayplan(Map<String, Object> mapValue);
 
+    //通过主键查询发运钢材到异地库计划
+    List<Map<String, Object>> getRailOffseDayMes(Integer dayplanId);
 
+    //通过发运计划主键查询关联所有物资信息
+    List<Map<String, Object>> getMaterialMesByDayPlanId(Integer dayplanId);
 }

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

@@ -0,0 +1,16 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsRailOffsetMaterial;
+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 AmsRailOffsetMaterialMapper extends IBaseMapper<AmsRailOffsetMaterial, BigDecimal> {
+
+    //获取序列号主键
+    @Select("select seq_rail_offset_material.nextval from dual")
+    BigDecimal selectMaxId();
+}

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

@@ -34,5 +34,9 @@ public interface AmstruckRailDayplanMapper extends IBaseMapper<AmstruckRailDaypl
     //查询所有到站信息
     List<Map<String, Object>> getArriveName();
 
+    //通过发运计划Id查询修改信息
+    List<Map<String, Object>> getDayPlanByDayPlanId(Integer dayplanId);
 
+    //查询所有承运商
+    List<Map<String, Object>> getCarrierMes();
 }

+ 48 - 30
src/main/java/com/steerinfo/dil/model/AmsRailOffsetDayplan.java

@@ -1,19 +1,22 @@
 package com.steerinfo.dil.model;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 @ApiModel(value="发运钢材到异地库日计划")
-public class AmsRailOffsetDayplan implements IBasePO<Integer> {
+public class AmsRailOffsetDayplan implements IBasePO<BigDecimal> {
     /**
      * 发运计划ID(DAYPLAN_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="发运计划ID",required=true)
-    private Integer dayplanId;
+    private BigDecimal dayplanId;
 
     /**
      * 计划号(DAYPLAN_NO,VARCHAR,20)
@@ -31,7 +34,7 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
      * 发货单位ID(SHIPPER_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="发货单位ID",required=false)
-    private Integer shipperId;
+    private BigDecimal shipperId;
 
     /**
      * 发货日期(DAYPLAN_DELIVERY_DATE,TIMESTAMP,7)
@@ -55,37 +58,37 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
      * 自有汽车数(DAYPLAN_OWN_CARS_AMOUT,DECIMAL,38)
      */
     @ApiModelProperty(value="自有汽车数",required=false)
-    private Integer dayplanOwnCarsAmout;
+    private BigDecimal dayplanOwnCarsAmout;
 
     /**
      * 专用线ID(DAYPLAN_DEDICATED_LINE_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="专用线ID",required=false)
-    private Integer dayplanDedicatedLineId;
+    private BigDecimal dayplanDedicatedLineId;
 
     /**
      * 到站ID(DAYPLAN_TO_THE_STATION_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="到站ID",required=false)
-    private Integer dayplanToTheStationId;
+    private BigDecimal dayplanToTheStationId;
 
     /**
      * 移库单位ID(TRANSFER_UNIT_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="移库单位ID",required=false)
-    private Integer transferUnitId;
+    private BigDecimal transferUnitId;
 
     /**
      * 车皮数(DAYPLAN_WAGON_NUMBER,DECIMAL,38)
      */
     @ApiModelProperty(value="车皮数",required=false)
-    private Integer dayplanWagonNumber;
+    private BigDecimal dayplanWagonNumber;
 
     /**
      * 收货单位(RECEIVING_UNIT_ID,DECIMAL,38)
      */
     @ApiModelProperty(value="收货单位",required=false)
-    private Integer receivingUnitId;
+    private BigDecimal receivingUnitId;
 
     /**
      * 收货人(DAYPLAN_CONSIGNEE_NAME,VARCHAR,20)
@@ -103,7 +106,7 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
      * 接收状态(0;未接收,1:已接收)(DAYPLAN_RECEIVE_STATUS,DECIMAL,38)
      */
     @ApiModelProperty(value="接收状态(0;未接收,1:已接收)",required=false)
-    private Integer dayplanReceiveStatus;
+    private BigDecimal dayplanReceiveStatus;
 
     /**
      * 记录创建人(INSERT_USERNAME,VARCHAR,20)
@@ -135,23 +138,38 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
     @ApiModelProperty(value="记录创建或修改备注",required=false)
     private String insertUpdateRemark;
 
+    
+    public List<Map<String, Object>> getMapList() {
+        return mapList;
+    }
+
+    public void setMapList(List<Map<String, Object>> mapList) {
+        this.mapList = mapList;
+    }
+
+    /**
+     * 物资信息列表
+     */
+    @TableField(exist = false)
+    private List<Map<String, Object>> mapList;
+    
     private static final long serialVersionUID = 1L;
 
     @Override
-    public Integer getId() {
+    public BigDecimal getId() {
         return this.dayplanId;
     }
 
     @Override
-    public void setId(Integer dayplanId) {
+    public void setId(BigDecimal dayplanId) {
         this.dayplanId = dayplanId;
     }
 
-    public Integer getDayplanId() {
+    public BigDecimal getDayplanId() {
         return dayplanId;
     }
 
-    public void setDayplanId(Integer dayplanId) {
+    public void setDayplanId(BigDecimal dayplanId) {
         this.dayplanId = dayplanId;
     }
 
@@ -171,11 +189,11 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
         this.dayplanDate = dayplanDate;
     }
 
-    public Integer getShipperId() {
+    public BigDecimal getShipperId() {
         return shipperId;
     }
 
-    public void setShipperId(Integer shipperId) {
+    public void setShipperId(BigDecimal shipperId) {
         this.shipperId = shipperId;
     }
 
@@ -187,51 +205,51 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
         this.dayplanDeliveryDate = dayplanDeliveryDate;
     }
 
-    public Integer getDayplanOwnCarsAmout() {
+    public BigDecimal getDayplanOwnCarsAmout() {
         return dayplanOwnCarsAmout;
     }
 
-    public void setDayplanOwnCarsAmout(Integer dayplanOwnCarsAmout) {
+    public void setDayplanOwnCarsAmout(BigDecimal dayplanOwnCarsAmout) {
         this.dayplanOwnCarsAmout = dayplanOwnCarsAmout;
     }
 
-    public Integer getDayplanDedicatedLineId() {
+    public BigDecimal getDayplanDedicatedLineId() {
         return dayplanDedicatedLineId;
     }
 
-    public void setDayplanDedicatedLineId(Integer dayplanDedicatedLineId) {
+    public void setDayplanDedicatedLineId(BigDecimal dayplanDedicatedLineId) {
         this.dayplanDedicatedLineId = dayplanDedicatedLineId;
     }
 
-    public Integer getDayplanToTheStationId() {
+    public BigDecimal getDayplanToTheStationId() {
         return dayplanToTheStationId;
     }
 
-    public void setDayplanToTheStationId(Integer dayplanToTheStationId) {
+    public void setDayplanToTheStationId(BigDecimal dayplanToTheStationId) {
         this.dayplanToTheStationId = dayplanToTheStationId;
     }
 
-    public Integer getTransferUnitId() {
+    public BigDecimal getTransferUnitId() {
         return transferUnitId;
     }
 
-    public void setTransferUnitId(Integer transferUnitId) {
+    public void setTransferUnitId(BigDecimal transferUnitId) {
         this.transferUnitId = transferUnitId;
     }
 
-    public Integer getDayplanWagonNumber() {
+    public BigDecimal getDayplanWagonNumber() {
         return dayplanWagonNumber;
     }
 
-    public void setDayplanWagonNumber(Integer dayplanWagonNumber) {
+    public void setDayplanWagonNumber(BigDecimal dayplanWagonNumber) {
         this.dayplanWagonNumber = dayplanWagonNumber;
     }
 
-    public Integer getReceivingUnitId() {
+    public BigDecimal getReceivingUnitId() {
         return receivingUnitId;
     }
 
-    public void setReceivingUnitId(Integer receivingUnitId) {
+    public void setReceivingUnitId(BigDecimal receivingUnitId) {
         this.receivingUnitId = receivingUnitId;
     }
 
@@ -251,11 +269,11 @@ public class AmsRailOffsetDayplan implements IBasePO<Integer> {
         this.dayplanConsigneeTel = dayplanConsigneeTel == null ? null : dayplanConsigneeTel.trim();
     }
 
-    public Integer getDayplanReceiveStatus() {
+    public BigDecimal getDayplanReceiveStatus() {
         return dayplanReceiveStatus;
     }
 
-    public void setDayplanReceiveStatus(Integer dayplanReceiveStatus) {
+    public void setDayplanReceiveStatus(BigDecimal dayplanReceiveStatus) {
         this.dayplanReceiveStatus = dayplanReceiveStatus;
     }
 

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

@@ -0,0 +1,184 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="发运钢材到异地库物资中间表")
+public class AmsRailOffsetMaterial implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(OFFSET_MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal offsetMaterialId;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 物资件数(OFFSET_MATERIAL_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资件数",required=false)
+    private BigDecimal offsetMaterialNumber;
+
+    /**
+     * 物资理重(OFFSET_MATERIAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资理重",required=false)
+    private BigDecimal offsetMaterialWeight;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 发运计划id(DAYPLAN_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="发运计划id",required=false)
+    private BigDecimal dayplanId;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.offsetMaterialId;
+    }
+
+    @Override
+    public void setId(BigDecimal offsetMaterialId) {
+        this.offsetMaterialId = offsetMaterialId;
+    }
+
+    public BigDecimal getOffsetMaterialId() {
+        return offsetMaterialId;
+    }
+
+    public void setOffsetMaterialId(BigDecimal offsetMaterialId) {
+        this.offsetMaterialId = offsetMaterialId;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getOffsetMaterialNumber() {
+        return offsetMaterialNumber;
+    }
+
+    public void setOffsetMaterialNumber(BigDecimal offsetMaterialNumber) {
+        this.offsetMaterialNumber = offsetMaterialNumber;
+    }
+
+    public BigDecimal getOffsetMaterialWeight() {
+        return offsetMaterialWeight;
+    }
+
+    public void setOffsetMaterialWeight(BigDecimal offsetMaterialWeight) {
+        this.offsetMaterialWeight = offsetMaterialWeight;
+    }
+
+    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 getDayplanId() {
+        return dayplanId;
+    }
+
+    public void setDayplanId(BigDecimal dayplanId) {
+        this.dayplanId = dayplanId;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", offsetMaterialId=").append(offsetMaterialId);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", offsetMaterialNumber=").append(offsetMaterialNumber);
+        sb.append(", offsetMaterialWeight=").append(offsetMaterialWeight);
+        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(", dayplanId=").append(dayplanId);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -40,9 +40,9 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
     private String dayplanDeliveryPlace;
 
     /**
-     * 收货单位(DAYPLAN_RECEIVE_UNIT,VARCHAR,20)
+     * 收货单位ID(DAYPLAN_RECEIVE_UNIT,DECIMAL,20)
      */
-    @ApiModelProperty(value="收货单位",required=false)
+    @ApiModelProperty(value="收货单位ID",required=false)
     private BigDecimal dayplanReceiveUnit;
 
     /**
@@ -61,25 +61,12 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
      * 物资重量(DAYPLAN_MATERIAL_WEIGHT,DECIMAL,0)
      */
     @ApiModelProperty(value="物资重量",required=false)
-    private Short dayplanMaterialWeight;
+    private BigDecimal dayplanMaterialWeight;
 
     /**
-     * 承运商ID(DAYPLAN_MATERIAL_WEIGHT,DECIMAL,0)
+     * 接收状态(0:未接收/已下发;1:接收)2为未下发  3为逻辑删除(DAYPLAN_RECEIVE_STATUS,DECIMAL,38)
      */
-    @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)
+    @ApiModelProperty(value="接收状态(0:未接收/已下发;1:接收)2为未下发  3为逻辑删除",required=false)
     private BigDecimal dayplanReceiveStatus;
 
     /**
@@ -112,6 +99,12 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="记录创建或修改备注",required=false)
     private String insertUpdateRemark;
 
+    /**
+     * 承运商ID(CARRIER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -188,11 +181,11 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
         this.materialId = materialId;
     }
 
-    public Short getDayplanMaterialWeight() {
+    public BigDecimal getDayplanMaterialWeight() {
         return dayplanMaterialWeight;
     }
 
-    public void setDayplanMaterialWeight(Short dayplanMaterialWeight) {
+    public void setDayplanMaterialWeight(BigDecimal dayplanMaterialWeight) {
         this.dayplanMaterialWeight = dayplanMaterialWeight;
     }
 
@@ -244,7 +237,13 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
         this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
     }
 
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
 
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
 
     @Override
     public String toString() {
@@ -267,6 +266,7 @@ public class AmstruckRailDayplan implements IBasePO<BigDecimal> {
         sb.append(", updateUsername=").append(updateUsername);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", carrierId=").append(carrierId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -38,4 +38,7 @@ public interface IAmstruckRailDayplanService extends IBaseService<AmstruckRailDa
 
     //查询所有到站信息
     List<Map<String, Object>> getArriveName();
+
+    //通过发运计划Id查询修改信息
+    List<Map<String, Object>> getDayPlanByDayPlanId(Integer dayplanId);
 }

+ 31 - 5
src/main/java/com/steerinfo/dil/service/impl/AmsRailOffsetDayplanServiceImpl.java

@@ -2,8 +2,11 @@ package com.steerinfo.dil.service.impl;
 
 
 import com.steerinfo.dil.mapper.AmsRailOffsetDayplanMapper;
+import com.steerinfo.dil.mapper.AmsRailOffsetMaterialMapper;
 import com.steerinfo.dil.model.AmsRailOffsetDayplan;
+import com.steerinfo.dil.model.AmsRailOffsetMaterial;
 import com.steerinfo.dil.service.IAmsRailOffsetDayplanService;
+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;
@@ -33,6 +36,9 @@ public class AmsRailOffsetDayplanServiceImpl extends BaseServiceImpl<AmsRailOffs
     @Autowired
     private AmsRailOffsetDayplanMapper amsRailOffsetDayplanMapper;
 
+    @Autowired
+    private AmsRailOffsetMaterialMapper amsRailOffsetMaterialMapper;
+
     @Override
     protected IBaseMapper<AmsRailOffsetDayplan, BigDecimal> getMapper() {
         return amsRailOffsetDayplanMapper;
@@ -44,23 +50,43 @@ public class AmsRailOffsetDayplanServiceImpl extends BaseServiceImpl<AmsRailOffs
      */
     @Override
     public Integer selectMaxId() {
-
-        return amsRailOffsetDayplanMapper.selectOtherId();
+        return amsRailOffsetDayplanMapper.selectMaxId();
     }
 
     public List<Map<String, Object>> getRailOffsetDayplan(Map<String, Object> mapValue) {
         return amsRailOffsetDayplanMapper.getRailOffsetDayplan(mapValue);
     }
+
+    /**
+     * 新增发运钢材到异地库计划
+     * @param amsRailOffsetDayplan
+     * @return
+     */
     @Override
     public int insert(AmsRailOffsetDayplan amsRailOffsetDayplan) {
-        amsRailOffsetDayplan.setDayplanId(selectMaxId());
+        Integer id = selectMaxId();
+        amsRailOffsetDayplan.setDayplanId(new BigDecimal(id));
+        //遍历物资列表添加所有发运计划物资中间表
+        List<Map<String, Object>> mapList = amsRailOffsetDayplan.getMapList();
+        for (Map<String, Object> map : mapList) {
+            AmsRailOffsetMaterial amsRailOffsetMaterial = new AmsRailOffsetMaterial();
+            amsRailOffsetMaterial.setId(amsRailOffsetMaterialMapper.selectMaxId());
+            //设置发运计划ID
+            amsRailOffsetMaterial.setDayplanId(new BigDecimal(id));
+            amsRailOffsetMaterial.setMaterialId(DataChange.dataToBigDecimal(map.get("materialId")));
+            amsRailOffsetMaterial.setOffsetMaterialWeight(DataChange.dataToBigDecimal(map.get("offsetMaterialWeight")));
+            amsRailOffsetMaterial.setOffsetMaterialNumber(DataChange.dataToBigDecimal(map.get("offsetMaterialNumber")));
+            amsRailOffsetMaterial.setInsertTime(new Date());
+            amsRailOffsetMaterial.setInsertUsername("admin");
+            amsRailOffsetMaterialMapper.updateByPrimaryKeySelective(amsRailOffsetMaterial);
+        }
         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);
     }

+ 18 - 1
src/main/java/com/steerinfo/dil/service/impl/AmstruckRailDayplanServiceImpl.java

@@ -4,6 +4,7 @@ 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.dil.util.DataChange;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,7 +55,13 @@ public class AmstruckRailDayplanServiceImpl extends BaseServiceImpl<AmstruckRail
     }
     @Override
     public int insert(AmstruckRailDayplan amstruckRailDayplan) {
-        amstruckRailDayplan.setDayplanId(selectMaxId());
+        BigDecimal maxId = selectMaxId();
+        amstruckRailDayplan.setDayplanId(maxId);
+        //生成发运计划号
+        String dayPlanNo = DataChange.generateEightDigitsNumber("FYJH", maxId.intValue());
+        amstruckRailDayplan.setDayplanNo(dayPlanNo);
+        //2为未下发
+        amstruckRailDayplan.setDayplanReceiveStatus(new BigDecimal(2));
         amstruckRailDayplan.setInsertTime(new Date());
         amstruckRailDayplan.setUpdateTime(new Date());
         amstruckRailDayplan.setInsertUsername("admin");
@@ -80,4 +87,14 @@ public class AmstruckRailDayplanServiceImpl extends BaseServiceImpl<AmstruckRail
     public List<Map<String, Object>> getArriveName() {
         return amstruckRailDayplanMapper.getArriveName();
     }
+
+    /**
+     * 通过发运计划Id查询信息
+     * @param dayplanId
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getDayPlanByDayPlanId(Integer dayplanId) {
+        return amstruckRailDayplanMapper.getDayPlanByDayPlanId(dayplanId);
+    }
 }

+ 27 - 5
src/main/resources/com/steerinfo/dil/mapper/AmsRailOffsetDayplanMapper.xml

@@ -150,11 +150,6 @@
   </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">
@@ -178,4 +173,31 @@ left join rmstrain_arrival_send ras on t.dayplan_to_the_station_id=ras.arrival_i
 left join rms_consignee rc on t.receiving_unit_id =rc.consignee_id
 where t.dayplan_receive_status=0
     </select>
+
+<!--  通过主键Id查询发运钢材到异地库计划数据用于修改  -->
+    <select id="getRailOffseDayMes" parameterType="int" resultType="java.util.Map">
+        select
+               AROD.DAYPLAN_NO "dayplanNo",
+               AROD.CARRIER_ID "carrierId",
+               AROD.SHIPPER_ID "shipperId",
+               AROD.DAYPLAN_DATE "dayplanDate",
+               AROD.DAYPLAN_DELIVERY_DATE "dayplanDeliveryDate",
+               AROD.DAYPLAN_OWN_CARS_AMOUT "dayplanOwnCarsAmout",
+               AROD.DAYPLAN_TO_THE_STATION_ID "dayplanToTheStationId",
+               AROD.DAYPLAN_WAGON_NUMBER "dayplanWagonNumber",
+               AROD.RECEIVING_UNIT_ID "receivingUnitId",
+               AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
+               AROD.DAYPLAN_CONSIGNEE_TEL "dayplanConsigneeTel"
+        from AMS_RAIL_OFFSET_DAYPLAN AROD
+        where AROD.DAYPLAN_ID = #{dayplanId}
+    </select>
+
+<!--   通过发运计划主键查询关联所有物资信息 -->
+    <select id="getMaterialMesByDayPlanId"  parameterType="int" resultType="java.util.Map">
+        select OFFSET_MATERIAL_ID "offsetMaterialId",
+               OFFSET_MATERIAL_NUMBER "offsetMaterialNumber",
+               OFFSET_MATERIAL_WEIGHT "offsetMaterialWeight"
+        from AMS_RAIL_OFFSET_MATERIAL AROM
+        where DAYPLAN_ID = #{dayplanId}
+    </select>
 </mapper>

+ 346 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsRailOffsetMaterialMapper.xml

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

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

@@ -980,6 +980,7 @@
       CONSIGNEE_ID "value",
       CONSIGNEE_COMPANY_NAME "label"
     from RMS_CONSIGNEE
+    where rownum &lt; 20
   </select>
 
   <select id="selectMaxId"  resultType="java.math.BigDecimal">

+ 393 - 192
src/main/resources/com/steerinfo/dil/mapper/AmstruckRailDayplanMapper.xml

@@ -7,7 +7,7 @@
     <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_RECEIVE_UNIT" jdbcType="DECIMAL" 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" />
@@ -17,18 +17,19 @@
     <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="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
   </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
+    INSERT_UPDATE_REMARK, CARRIER_ID
   </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
+    t.INSERT_UPDATE_REMARK, t.CARRIER_ID
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM AMSTRUCK_RAIL_DAYPLAN
@@ -37,7 +38,7 @@
     SELECT <include refid="columns_alias"/> FROM AMSTRUCK_RAIL_DAYPLAN t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="dayplanId != null">
         and DAYPLAN_ID = #{dayplanId}
       </if>
@@ -53,7 +54,7 @@
       <if test="dayplanDeliveryPlace != null and dayplanDeliveryPlace != ''">
         and DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace}
       </if>
-      <if test="dayplanReceiveUnit != null and dayplanReceiveUnit != ''">
+      <if test="dayplanReceiveUnit != null">
         and DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit}
       </if>
       <if test="dayplanDeliveryDate != null">
@@ -83,10 +84,13 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="dayplanId != null">
         and DAYPLAN_ID = #{dayplanId}
       </if>
@@ -102,8 +106,8 @@
       <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 test="dayplanReceiveUnit != null">
+        and DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit}
       </if>
       <if test="dayplanDeliveryDate != null">
         and TO_CHAR(DAYPLAN_DELIVERY_DATE,'yyyy-MM-dd') = #{dayplanDeliveryDate}
@@ -132,6 +136,9 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
       </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
@@ -140,63 +147,66 @@
   </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>
+    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">
+      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>
+    <if test="carrierId != null">
+      or CARRIER_ID = #{carrierId}
+    </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 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,
+                                       CARRIER_ID)
+    values (#{dayplanId,jdbcType=DECIMAL}, #{dayplanNo,jdbcType=VARCHAR}, #{dayplanTruckNumber,jdbcType=DECIMAL},
+            #{shipmentUnitId,jdbcType=DECIMAL}, #{dayplanDeliveryPlace,jdbcType=VARCHAR}, #{dayplanReceiveUnit,jdbcType=DECIMAL},
+            #{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},
+            #{carrierId,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
     insert into AMSTRUCK_RAIL_DAYPLAN
@@ -246,6 +256,9 @@
       <if test="insertUpdateRemark != null">
         INSERT_UPDATE_REMARK,
       </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="dayplanId != null">
@@ -264,7 +277,7 @@
         #{dayplanDeliveryPlace,jdbcType=VARCHAR},
       </if>
       <if test="dayplanReceiveUnit != null">
-        #{dayplanReceiveUnit,jdbcType=VARCHAR},
+        #{dayplanReceiveUnit,jdbcType=DECIMAL},
       </if>
       <if test="dayplanDeliveryDate != null">
         #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
@@ -293,24 +306,28 @@
       <if test="insertUpdateRemark != null">
         #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </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}
+        DAYPLAN_TRUCK_NUMBER = #{dayplanTruckNumber,jdbcType=DECIMAL},
+        SHIPMENT_UNIT_ID = #{shipmentUnitId,jdbcType=DECIMAL},
+        DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace,jdbcType=VARCHAR},
+        DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit,jdbcType=DECIMAL},
+        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},
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL}
     where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmstruckRailDayplan">
@@ -329,7 +346,7 @@
         DAYPLAN_DELIVERY_PLACE = #{dayplanDeliveryPlace,jdbcType=VARCHAR},
       </if>
       <if test="dayplanReceiveUnit != null">
-        DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit,jdbcType=VARCHAR},
+        DAYPLAN_RECEIVE_UNIT = #{dayplanReceiveUnit,jdbcType=DECIMAL},
       </if>
       <if test="dayplanDeliveryDate != null">
         DAYPLAN_DELIVERY_DATE = #{dayplanDeliveryDate,jdbcType=TIMESTAMP},
@@ -358,6 +375,9 @@
       <if test="insertUpdateRemark != null">
         INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
     </set>
     where DAYPLAN_ID = #{dayplanId,jdbcType=DECIMAL}
   </update>
@@ -374,100 +394,104 @@
     <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 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,
+    CARRIER_ID)
+    ( <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=DECIMAL}, #{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},
+    #{item.carrierId,jdbcType=DECIMAL} 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 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=DECIMAL}
+    </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>
+    ,CARRIER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case DAYPLAN_ID" close="end">
+      when #{item.dayplanId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+    </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 
+    where DAYPLAN_ID in
     <foreach collection="list" item="id" open="(" close=")" separator=",">
       #{id}
     </foreach>
@@ -476,34 +500,189 @@
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <!-- 展示汽车发运焦炭/水渣日计划 -->
   <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 *
+    from (
+    select t.DAYPLAN_ID "dayPlanId",
+    t.dayplan_no as "dayplanNo",
+    t.dayplan_truck_number as "dayplanTruckNumber",
+    rs.SHIPPER_NAME "shipperName",
+    rc.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    t.dayplan_delivery_date as "dayplanDeliveryDate",
+    rm.material_name as "materialName",
+    t.dayplan_material_weight as "dayplanMaterialWeight",
+    t.INSERT_UPDATE_REMARK "insertUpdateRemark",
+    RC2.CARRIER_NAME "carrierName",
+           t.INSERT_TIME "insertTime"
+    from amstruck_rail_dayplan t
+    left join rms_material rm on t.material_id = rm.material_id
+    left join RMS_SHIPPER rs on rs.SHIPPER_ID = t.SHIPMENT_UNIT_ID
+    left join RMS_CONSIGNEE RC on RC.CONSIGNEE_ID = t.DAYPLAN_RECEIVE_UNIT
+    left join RMS_CARRIER RC2 on RC2.CARRIER_ID = t.CARRIER_ID
+
+    <where>
+      t.material_id = 1
+      <if test="status != null">
+        and  t.dayplan_receive_status  = #{status}
+      </if>
+    </where>
+    )
+    <where>
+      <if test="dayplanNo != null">
+        <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
+          "dayplanNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanTruckNumber != null">
+        and
+        <foreach collection="dayplanTruckNumber" item="item" open="(" separator="or" close=")">
+          "dayplanTruckNumber" 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="dayplanDeliveryDate != null">
+        and
+        <foreach collection="dayplanDeliveryDate" item="item" open="(" separator="or" close=")">
+          "dayplanDeliveryDate" 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="dayplanMaterialWeight != null">
+        and
+        <foreach collection="dayplanMaterialWeight" item="item" open="(" separator="or" close=")">
+          "dayplanMaterialWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="carrierName != null">
+        and
+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+          "carrierName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+      <include refid="orderBy"></include>
+
+
     </select>
+
+  <sql id="orderBy">
+    <if test="orderField != null and orderField != ''">
+      order by "${orderField}"
+      <if test="orderType != null and orderType != ''">
+        ${orderType}
+      </if>
+    </if>
+    <if test="orderField == null  ">
+      order by "insertTime" desc
+    </if>
+  </sql>
+
   <!-- 展示汽车发运焦炭/水渣日计划 -->
   <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
+    *
+    from(
+    select t.DAYPLAN_ID "dayPlanId",
+    t.dayplan_no as "dayplanNo",
+    t.dayplan_truck_number as "dayplanTruckNumber",
+    rs.SHIPPER_NAME "shipperName",
+    rc.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
+    t.dayplan_delivery_date as "dayplanDeliveryDate",
+    rm.material_name as "materialName",
+    t.dayplan_material_weight as "dayplanMaterialWeight",
+    t.INSERT_UPDATE_REMARK "insertUpdateRemark",
+    RC2.CARRIER_NAME "carrierName",
+    t.INSERT_TIME "insertTime"
+    from amstruck_rail_dayplan t
+    left join rms_material rm on t.material_id = rm.material_id
+    left join RMS_SHIPPER rs on rs.SHIPPER_ID = t.SHIPMENT_UNIT_ID
+    left join RMS_CONSIGNEE RC on RC.CONSIGNEE_ID = t.DAYPLAN_RECEIVE_UNIT
+    left join RMS_CARRIER RC2 on RC2.CARRIER_ID = t.CARRIER_ID
+    <where>
+      t.material_id = 3650
+      <if test="status != null">
+        and t.dayplan_receive_status = #{status}
+      </if>
+    </where>
+    )
+    <where>
+      <if test="dayplanNo != null">
+        <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
+          "dayplanNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanTruckNumber != null">
+        and
+        <foreach collection="dayplanTruckNumber" item="item" open="(" separator="or" close=")">
+          "dayplanTruckNumber" 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="dayplanDeliveryDate != null">
+        and
+        <foreach collection="dayplanDeliveryDate" item="item" open="(" separator="or" close=")">
+          "dayplanDeliveryDate" 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="dayplanMaterialWeight != null">
+        and
+        <foreach collection="dayplanMaterialWeight" item="item" open="(" separator="or" close=")">
+          "dayplanMaterialWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="carrierName != null">
+        and
+        <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+          "carrierName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+      <include refid="orderBy"></include>
+
     </select>
 
   <!-- 得到最大id -->
@@ -523,4 +702,26 @@ where t.dayplan_receive_status=0 and  t.material_id=496
       ARRIVAL_NAME "label"
     from RMSTRAIN_ARRIVAL_SEND
   </select>
+
+<!-- 通过发运计划ID查询修改信息 -->
+  <select id="getDayPlanByDayPlanId" parameterType="int" resultType="java.util.Map">
+    select ARD.DAYPLAN_NO "dayplanNo",
+           ARD.DAYPLAN_TRUCK_NUMBER "dayplanTruckNumber",
+           ARD.SHIPMENT_UNIT_ID "shipperId",
+           ARD.DAYPLAN_RECEIVE_UNIT "dayplanReceiveUnit",
+           ARD.DAYPLAN_DELIVERY_DATE "dayplanDeliveryDate",
+           ARD.MATERIAL_ID "materialId",
+           ARD.DAYPLAN_MATERIAL_WEIGHT "dayplanMaterialWeight",
+           ARD.INSERT_UPDATE_REMARK "insertUpdateRemark"
+    from AMSTRUCK_RAIL_DAYPLAN ARD
+    where ARD.DAYPLAN_ID = #{dayplanId}
+  </select>
+
+<!-- 查询所有承运商 -->
+  <select id="getCarrierMes" resultType="java.util.Map">
+    select RC.CARRIER_ID "id",
+           RC.CARRIER_ID "value",
+           RC.CARRIER_NAME "label"
+    from RMS_CARRIER RC
+  </select>
 </mapper>