Переглянути джерело

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/DAL-DAZHOU-AMS-API

luobang 2 роки тому
батько
коміт
e98db9d43d

+ 1 - 6
pom.xml

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

+ 3 - 1
src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java

@@ -656,7 +656,6 @@ public class AmsSaleOrderController extends BaseRESTfulController {
         BigDecimal carrierId=  new BigDecimal(mapValue.get("carrierId").toString());
         //销售订单授权承运商中间表
         int i= amsSaleOrderCarrierService.addAmsSaleOrderCarrier(carrierId,saleOrderIds);
-
         return success(i);
     }
 
@@ -722,6 +721,9 @@ public class AmsSaleOrderController extends BaseRESTfulController {
         if (result == 0) {
             return failed("匹配不到车牌号!");
         }
+        if (result==6){
+            return success("操作成功");
+        }
         else {
             for (Map<String, Object> map : mapList) {
                 // 调用EAS接口将车牌号传给金蝶

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

@@ -247,6 +247,24 @@ public class AmsSaleOrderMaterialController extends BaseRESTfulController {
         }
     }
 
+    @ApiOperation(value="内转钢材派发订单")
+    @PostMapping("dispatchInwardTruckOrderBySale")
+    public RESTfulResult dispatchInwardTruckOrderBySale(@RequestBody Map<String,Object> mapValue){
+        int result = amsSaleOrderMaterialService.dispatchInwardTruckOrderBySale(mapValue);
+        if (result == -1) {
+            return failed("该销售订单的净重已达到97%");
+        }
+        else {
+            return success(result);
+        }
+    }
+
+    @ApiOperation(value = "更新内转钢材收货客户")
+    @PostMapping("/updateInwardConsignee")
+    public RESTfulResult updateInwardConsignee(@RequestBody(required = false)Map<String,Object>map){
+        return success(amsSaleOrderMaterialService.updateInwardConsignee(map));
+    }
+
     @ApiOperation(value="承运商直接选择车牌号派发运输订单")
     @PostMapping("dispatchTruckOrderByCarrier")
     public RESTfulResult dispatchTruckOrderByCarrier(@RequestBody Map<String,Object> mapValue){

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

@@ -58,4 +58,9 @@ public interface AmsSaleOrderMaterialMapper extends IBaseMapper<AmsSaleOrderMate
     List<Map<String, Object>> getPriceList(BigDecimal carrierId);
     // 查询车序号中的物资
     List<Map<String, Object>> getMaterial(BigDecimal saleOrderMaterialId);
+    //更新发站
+    int updateSendStation(Map<String, Object> mapValue);
+
+    //更新收货客户
+    int updateInwardConsignee(Map<String, Object> mapValue);
 }

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

@@ -0,0 +1,14 @@
+package com.steerinfo.dil.mapper;
+
+import java.math.*;
+
+import com.steerinfo.dil.model.TmstrainPleaseApproveResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface TmstrainPleaseApproveResultMapper extends IBaseMapper<TmstrainPleaseApproveResult, BigDecimal> {
+    @Select("select  seq_TMSTRAIN_PLEASE_APPROVE_RESULT.nextval from dual")
+    BigDecimal getMaxId();
+}

+ 13 - 0
src/main/java/com/steerinfo/dil/mapper/TmstrainTruckTotalResultMapper.java

@@ -0,0 +1,13 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstrainTruckTotalResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface TmstrainTruckTotalResultMapper  extends IBaseMapper<TmstrainTruckTotalResult, BigDecimal>{
+    @Select(" select seq_TMSTRAIN_TRUCK_TOTAL_RESULT.nextval from dual")
+    BigDecimal selectMaxId();
+}

+ 349 - 0
src/main/java/com/steerinfo/dil/model/TmstrainPleaseApproveResult.java

@@ -0,0 +1,349 @@
+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 TmstrainPleaseApproveResult implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 发运计划ID(RAIL_PLAN_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="发运计划ID",required=false)
+    private BigDecimal railPlanId;
+
+    /**
+     * 请车计划号(RESULT_PLEASE_PLAN_NO,VARCHAR,50)
+     */
+    @ApiModelProperty(value="请车计划号",required=false)
+    private String resultPleasePlanNo;
+
+    /**
+     * 计划日期(RESULT_PLAN_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="计划日期",required=false)
+    private Date resultPlanDate;
+
+    /**
+     * 品类(默认铁矿石)(RESULT_CATEGORY,VARCHAR,20)
+     */
+    @ApiModelProperty(value="品类(默认铁矿石)",required=false)
+    private String resultCategory;
+
+    /**
+     * 发货单位ID(原料供应商)(SUPPLIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="发货单位ID(原料供应商)",required=false)
+    private BigDecimal supplierId;
+
+    /**
+     * 发站ID(SEND_STATION_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="发站ID",required=false)
+    private BigDecimal sendStationId;
+
+    /**
+     * 到站ID(TO_THE_STATION_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="到站ID",required=false)
+    private BigDecimal toTheStationId;
+
+    /**
+     * 请车数(RESULT_PLEASE_NUMBER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="请车数",required=false)
+    private BigDecimal resultPleaseNumber;
+
+    /**
+     * 请车日期(RESULT_PLEASE_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="请车日期",required=false)
+    private Date resultPleaseDate;
+
+    /**
+     * 批车数(RESULT_APPROVE_NUMBER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="批车数",required=false)
+    private BigDecimal resultApproveNumber;
+
+    /**
+     * 批车日期(RESULT_APPROVE_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="批车日期",required=false)
+    private Date resultApproveDate;
+
+    /**
+     * 记录创建人(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已下发 2已批车 3逻辑删除(STATUS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="状态:0未下发 1已下发 2已批车 3逻辑删除",required=false)
+    private BigDecimal status;
+
+    /**
+     * 请车批车类型:1:采购进口矿(万州港-达州站/万州港-老区轨道衡)3:采购国产矿  4:内转钢材到异地库(RESULT_TYPE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="请车批车类型:1:采购进口矿(万州港-达州站/万州港-老区轨道衡)3:采购国产矿  4:内转钢材到异地库",required=false)
+    private BigDecimal resultType;
+
+    /**
+     * 物流承运商id(CARRIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物流承运商id",required=false)
+    private BigDecimal carrierId;
+
+    /**
+     * 专用线id(SPECIAL_LINE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="专用线id",required=false)
+    private BigDecimal specialLineId;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getRailPlanId() {
+        return railPlanId;
+    }
+
+    public void setRailPlanId(BigDecimal railPlanId) {
+        this.railPlanId = railPlanId;
+    }
+
+    public String getResultPleasePlanNo() {
+        return resultPleasePlanNo;
+    }
+
+    public void setResultPleasePlanNo(String resultPleasePlanNo) {
+        this.resultPleasePlanNo = resultPleasePlanNo == null ? null : resultPleasePlanNo.trim();
+    }
+
+    public Date getResultPlanDate() {
+        return resultPlanDate;
+    }
+
+    public void setResultPlanDate(Date resultPlanDate) {
+        this.resultPlanDate = resultPlanDate;
+    }
+
+    public String getResultCategory() {
+        return resultCategory;
+    }
+
+    public void setResultCategory(String resultCategory) {
+        this.resultCategory = resultCategory == null ? null : resultCategory.trim();
+    }
+
+    public BigDecimal getSupplierId() {
+        return supplierId;
+    }
+
+    public void setSupplierId(BigDecimal supplierId) {
+        this.supplierId = supplierId;
+    }
+
+    public BigDecimal getSendStationId() {
+        return sendStationId;
+    }
+
+    public void setSendStationId(BigDecimal sendStationId) {
+        this.sendStationId = sendStationId;
+    }
+
+    public BigDecimal getToTheStationId() {
+        return toTheStationId;
+    }
+
+    public void setToTheStationId(BigDecimal toTheStationId) {
+        this.toTheStationId = toTheStationId;
+    }
+
+    public BigDecimal getResultPleaseNumber() {
+        return resultPleaseNumber;
+    }
+
+    public void setResultPleaseNumber(BigDecimal resultPleaseNumber) {
+        this.resultPleaseNumber = resultPleaseNumber;
+    }
+
+    public Date getResultPleaseDate() {
+        return resultPleaseDate;
+    }
+
+    public void setResultPleaseDate(Date resultPleaseDate) {
+        this.resultPleaseDate = resultPleaseDate;
+    }
+
+    public BigDecimal getResultApproveNumber() {
+        return resultApproveNumber;
+    }
+
+    public void setResultApproveNumber(BigDecimal resultApproveNumber) {
+        this.resultApproveNumber = resultApproveNumber;
+    }
+
+    public Date getResultApproveDate() {
+        return resultApproveDate;
+    }
+
+    public void setResultApproveDate(Date resultApproveDate) {
+        this.resultApproveDate = resultApproveDate;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getStatus() {
+        return status;
+    }
+
+    public void setStatus(BigDecimal status) {
+        this.status = status;
+    }
+
+    public BigDecimal getResultType() {
+        return resultType;
+    }
+
+    public void setResultType(BigDecimal resultType) {
+        this.resultType = resultType;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
+    public BigDecimal getSpecialLineId() {
+        return specialLineId;
+    }
+
+    public void setSpecialLineId(BigDecimal specialLineId) {
+        this.specialLineId = specialLineId;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", railPlanId=").append(railPlanId);
+        sb.append(", resultPleasePlanNo=").append(resultPleasePlanNo);
+        sb.append(", resultPlanDate=").append(resultPlanDate);
+        sb.append(", resultCategory=").append(resultCategory);
+        sb.append(", supplierId=").append(supplierId);
+        sb.append(", sendStationId=").append(sendStationId);
+        sb.append(", toTheStationId=").append(toTheStationId);
+        sb.append(", resultPleaseNumber=").append(resultPleaseNumber);
+        sb.append(", resultPleaseDate=").append(resultPleaseDate);
+        sb.append(", resultApproveNumber=").append(resultApproveNumber);
+        sb.append(", resultApproveDate=").append(resultApproveDate);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", status=").append(status);
+        sb.append(", resultType=").append(resultType);
+        sb.append(", carrierId=").append(carrierId);
+        sb.append(", specialLineId=").append(specialLineId);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 182 - 0
src/main/java/com/steerinfo/dil/model/TmstrainTruckTotalResult.java

@@ -0,0 +1,182 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value="火运总实绩与总实绩中间表")
+public class TmstrainTruckTotalResult implements IBasePO<Short> {
+    /**
+     * 主键ID(RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private Short resultId;
+
+    /**
+     * 火运总实绩ID(TMSTRAIN_TOTAL_RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="火运总实绩ID",required=false)
+    private Short tmstrainTotalResultId;
+
+    /**
+     * 汽运总实绩ID(TMSTRUCK_TOTAL_RESULT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="汽运总实绩ID",required=false)
+    private Short tmstruckTotalResultId;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private Short materialId;
+
+    /**
+     * 记录创建人(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:已卸车(LOAD_STATUS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="0:已装车 1:已卸车",required=false)
+    private Short loadStatus;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public Short getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(Short resultId) {
+        this.resultId = resultId;
+    }
+
+    public Short getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(Short resultId) {
+        this.resultId = resultId;
+    }
+
+    public Short getTmstrainTotalResultId() {
+        return tmstrainTotalResultId;
+    }
+
+    public void setTmstrainTotalResultId(Short tmstrainTotalResultId) {
+        this.tmstrainTotalResultId = tmstrainTotalResultId;
+    }
+
+    public Short getTmstruckTotalResultId() {
+        return tmstruckTotalResultId;
+    }
+
+    public void setTmstruckTotalResultId(Short tmstruckTotalResultId) {
+        this.tmstruckTotalResultId = tmstruckTotalResultId;
+    }
+
+    public Short getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(Short materialId) {
+        this.materialId = materialId;
+    }
+
+    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 Short getLoadStatus() {
+        return loadStatus;
+    }
+
+    public void setLoadStatus(Short loadStatus) {
+        this.loadStatus = loadStatus;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", tmstrainTotalResultId=").append(tmstrainTotalResultId);
+        sb.append(", tmstruckTotalResultId=").append(tmstruckTotalResultId);
+        sb.append(", materialId=").append(materialId);
+        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(", loadStatus=").append(loadStatus);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -58,6 +58,10 @@ public interface IAmsSaleOrderMaterialService{
     // 销售直接派发销售订单
     int dispatchTruckOrderBySale(Map<String, Object> mapValue);
 
+    //内转钢材派发订单
+    int dispatchInwardTruckOrderBySale(Map<String, Object> mapValue);
+
+    int updateInwardConsignee(Map<String, Object> mapValue);
     // 承运商直接派发销售订单
     int dispatchTruckOrderByCarrier(Map<String, Object> mapValue);
 

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

@@ -518,6 +518,168 @@ public class AmsSaleOrderMaterialServiceImpl implements IAmsSaleOrderMaterialSer
         return result;
     }
 
+    @Override
+    public int updateInwardConsignee(Map<String, Object> mapValue) {
+        return amsSaleOrderMaterialMapper.updateInwardConsignee(mapValue);
+    }
+
+    /**
+     * 内转钢材派发订单
+     * @param mapValue
+     * @return
+     */
+    @Override
+    public int dispatchInwardTruckOrderBySale(Map<String, Object> mapValue) {
+        int result = 0;
+        // 得到列内容
+        List<Map<String,Object>> mapList = (List<Map<String, Object>>) mapValue.get("mapList");
+        // 销售订单主键
+        BigDecimal saleOrderId = DataChange.dataToBigDecimal(mapValue.get("saleOrderId"));
+        // 车序号计数
+        int count = 1;
+        /*
+        车序号表,只生成一次,对应多个子表(物资)
+        */
+        AmsSaleOrderMaterial amsSaleOrderMaterial = new AmsSaleOrderMaterial();
+        // 主键
+        BigDecimal saleOrderMaterialId = amsSaleOrderMaterialMapper.selectMaxId();
+        amsSaleOrderMaterial.setSaleOrderMaterialId(saleOrderMaterialId);
+        // 销售订单主键
+        amsSaleOrderMaterial.setSaleOrderId(saleOrderId);
+        // 车序号
+        amsSaleOrderMaterial.setSaleOrderMaterialTruckNo(new BigDecimal(count));
+        // 下发状态
+        amsSaleOrderMaterial.setIssueStatus(new BigDecimal(2));
+        // 遍历每一个列
+        for (Map<String, Object> map : mapList) {
+            //更新发站
+            amsSaleOrderMaterialMapper.updateSendStation(map);
+            // 销售订单-物资中间表id
+            BigDecimal saleMaterialId = DataChange.dataToBigDecimal(map.get("saleMaterialId"));
+            // 物资id
+            BigDecimal materialId = DataChange.dataToBigDecimal(map.get("materialId"));
+            // 承运商id
+            BigDecimal carrierId = DataChange.dataToBigDecimal(map.get("carrierId"));
+            // 运输线路id
+            BigDecimal lineId = DataChange.dataToBigDecimal(map.get("lineId"));
+            // 通过线路id判断是否是钢材
+            BigDecimal isSteel = amsSaleOrderMaterialMapper.getIsSteel(lineId);
+            // 物资重量
+            BigDecimal materialNumber = DataChange.dataToBigDecimal(map.get("materialWeight"));
+            // 车牌号
+            String capacityNumber = (String) map.get("capacityNumber");
+            // 得到运力id
+            BigDecimal capacityId = amsSaleOrderMaterialMapper.getCapacityId(capacityNumber);
+            // 收货方姓名
+            String consigneeName = String.valueOf(map.get("consigneeName"));
+            // 收货方电话
+            //String consigneeTel = String.valueOf(map.get("saleOrderConsigneeTel"));
+            // 截止日期
+            String dateOfReceiptStr = String.valueOf(map.get("saleDateOfReceipt"));
+            Date dateOfReceipt = null;
+            if (!"null".equals(dateOfReceiptStr) && !"undefined".equals(dateOfReceiptStr)) {
+                dateOfReceipt = new Date(Long.valueOf(dateOfReceiptStr));
+            }
+
+            /*
+             车序号与物资子表
+             */
+            AmsSaleTrucknoMaterial amsSaleTrucknoMaterial = new AmsSaleTrucknoMaterial();
+            // 主键
+            BigDecimal truckNoMaterialId = amsSaleTrucknoMaterialMapper.selectMaxId();
+            amsSaleTrucknoMaterial.setTrucknoMaterialId(truckNoMaterialId);
+            // 销售订单-物资中间表id
+            amsSaleTrucknoMaterial.setMaterialId(saleMaterialId);
+            // 车序号主键
+            amsSaleTrucknoMaterial.setSaleOrderMaterialId(saleOrderMaterialId);
+            // 物资重量
+            amsSaleTrucknoMaterial.setSaleOrderMaterialNumber(materialNumber);
+            /*
+             定向派单表
+             */
+            AmsDispatchSaleOrder amsDispatchSaleOrder = new AmsDispatchSaleOrder();
+            // 主键
+            BigDecimal dispatchId = amsDispatchSaleOrderMapper.selectOtherId();
+            amsDispatchSaleOrder.setDispatchId(dispatchId);
+            // 车序号表id
+            amsDispatchSaleOrder.setSaleOrderMaterialId(saleOrderMaterialId);
+            // 承运商id
+            amsDispatchSaleOrder.setCarrierId(carrierId);
+            // 派单时间和成交时间
+            amsDispatchSaleOrder.setDispatchTime(new Date());
+            amsDispatchSaleOrder.setDispatchDealTime(new Date());
+            // 成交类型
+            amsDispatchSaleOrder.setDispatchType(new BigDecimal(0));
+            // 车序号状态
+            amsDispatchSaleOrder.setDispatchStatus(new BigDecimal(2));
+            /*
+             运输订单
+             */
+            OmstruckOrder omstruckOrder = new OmstruckOrder();
+            // 运输订单主键
+            BigDecimal orderId = omstruckOrderMapper.selectMaxId();
+            omstruckOrder.setOrderId(orderId);
+            // 车序号主键
+            omstruckOrder.setOrderPlanId(saleOrderMaterialId);
+            //添加承运商ID 和 运价ID
+//            Object priceId = map.get("priceId");
+            Object priceId = map.get("priceId");
+            if (priceId != null) {
+                omstruckOrder.setPriceId(DataChange.dataToBigDecimal(priceId));
+            }
+            omstruckOrder.setCarrierId(carrierId);
+            // 运输订单号
+            omstruckOrder.setOrderNumber(DataChange.generateEightDigitsNumber("WYSDD",orderId.intValue()));
+            // 运力id
+            omstruckOrder.setCapacityId(capacityId);
+            // 承运商
+            omstruckOrder.setCarrierId(carrierId);
+            // 下发时间
+            omstruckOrder.setOrderIssueTime(new Date());
+            // 运单状态
+            omstruckOrder.setOrderStatus(new BigDecimal(4));
+            // 订单类型
+            omstruckOrder.setOrderType(new BigDecimal(4));
+            // 运输线路id
+            omstruckOrder.setLineId(lineId);
+            omstruckOrder.setInsertTime(new Date());
+            /*
+             运输订单子表
+             */
+            OmstruckOrderMaterial omstruckOrderMaterial = new OmstruckOrderMaterial();
+            // 主键
+            BigDecimal orderMaterialId = omstruckOrderMaterialMapper.selectMaxId();
+            omstruckOrderMaterial.setOrderMaterialId(orderMaterialId);
+            // 运输订单id
+            omstruckOrderMaterial.setOrderId(orderId);
+            // 物资id
+            omstruckOrderMaterial.setMaterialId(materialId);
+            // 物资重量
+            omstruckOrderMaterial.setOrderMaterialWeight(materialNumber);
+            omstruckOrderMaterial.setInsertTime(new Date());
+            // 新增车序号表
+            result += amsSaleOrderMaterialMapper.insertSelective(amsSaleOrderMaterial);
+            // 新增车序号-物资中间表
+            result += amsSaleTrucknoMaterialMapper.insertSelective(amsSaleTrucknoMaterial);
+            // 新增定向派单表
+            result += amsDispatchSaleOrderMapper.insertSelective(amsDispatchSaleOrder);
+            // 新增运输订单
+            result += omstruckOrderMapper.insertSelective(omstruckOrder);
+            // 新增运输订单子表
+            result += omstruckOrderMaterialMapper.insertSelective(omstruckOrderMaterial);
+            // 调用websocket
+            Map<String,Object> orderIdMap = new HashMap<>();
+            orderIdMap.put("orderId",orderId);
+            pushMesToWebsocket(orderIdMap);
+            // 生成运输执行总实绩
+            result += tmsTruckFeign.addTotalResult(orderIdMap);
+            // 车序号累加
+            count++;
+        }
+
+        return result;
+    }
+
     /**
      * 承运商直接派发销售订单
      * @param mapValue

+ 33 - 3
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -76,10 +76,12 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     @Autowired
     RmsMaterialMapper rmsMaterialMapper;
     @Autowired
-    WmspOutboundResultMaterial wmspOutboundResultMaterial;
+    TmstrainPleaseApproveResultMapper tmstrainPleaseApproveResultMapper;
+
     @Autowired
     WmspOutboundResultMaterialMapper wmspOutboundResultMaterialMapper;
 
+
     @Override
     public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
         return amsSaleOrderMapper.getSaleOrderInfo(map);
@@ -788,6 +790,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             throw new Exception("订单未审核,无法派车!");
         }
         int result = 0;
+        BigDecimal isSteel=null;
         // 遍历每一行
         for (Map<String,Object> map : mapList) {
             // 得到车牌号
@@ -822,7 +825,11 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             BigDecimal lineId = DataChange.dataToBigDecimal(map.get("lineId"));
             // 司机电话号码
             String driverTel = (String) map.get("driverTel");
-            BigDecimal isSteel = new BigDecimal(1);
+            //判断是否为内转异地库到钢材
+            BigDecimal isIwardSteel =DataChange.dataToBigDecimal(map.get("isIwardSteel"));
+            if (isIwardSteel==null&&isIwardSteel.intValue()==0) {
+                 isSteel = new BigDecimal(1);
+            }
             // 得到运力id
             BigDecimal capacityId = amsSaleOrderMaterialMapper.getCapacityId(capacityNumber);
             if (capacityId == null) {
@@ -873,7 +880,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                 // 车序号主键
                 omstruckOrder.setOrderPlanId(saleOrderMaterialId);
                 //添加承运商ID 和 运价ID
-//            Object priceId = map.get("priceId");
+                //Object priceId = map.get("priceId");
                 if (priceId != null) {
                     omstruckOrder.setPriceId(priceId);
                 }
@@ -902,6 +909,10 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                 if (isSteel != null && isSteel.intValue() == 1) {
                     status = new BigDecimal(1);
                 }
+                //内转钢材到异地库设置为4
+                 else if (isIwardSteel!=null&&isIwardSteel.intValue()==4){
+                    status = new BigDecimal(4);
+                }
                 // 非钢材(危化品,焦炭,副产品)
                 else {
                     status = new BigDecimal(2);
@@ -913,6 +924,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                 omstruckOrder.setInsertTime(new Date());
                 omstruckOrder.setInsertUsername("");
                 result += omstruckOrderMapper.insertSelective(omstruckOrder);
+
             }
             else {
                 omstruckOrder = omstruckOrders.get(0);
@@ -945,6 +957,24 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             amsSaleOrderMaterialService.pushMesToWebsocket(orderIdMap);
             // 生成运输执行总实绩
             result += tmsTruckFeign.addTotalResult(orderIdMap);
+            //根据返回的总实绩id新增
+            if (map.get("sendStationId")!=null){
+                BigDecimal maxId = tmstrainPleaseApproveResultMapper.getMaxId();
+                BigDecimal saleOrderId =DataChange.dataToBigDecimal(map.get("saleOrderId"));
+                TmstrainPleaseApproveResult tmstrainPleaseApproveResult=new TmstrainPleaseApproveResult();
+                tmstrainPleaseApproveResult.setResultId(maxId);
+                tmstrainPleaseApproveResult.setRailPlanId(saleOrderId);
+                tmstrainPleaseApproveResult.setSendStationId(DataChange.dataToBigDecimal(map.get("sendStationId")));
+                tmstrainPleaseApproveResult.setResultPleasePlanNo(DataChange.generateEightDigitsNumber("WPCJH",maxId.intValue()));
+                tmstrainPleaseApproveResult.setResultPlanDate(new Date());
+                tmstrainPleaseApproveResult.setResultCategory("钢材");
+                tmstrainPleaseApproveResult.setResultType(new BigDecimal(4));
+                tmstrainPleaseApproveResult.setInsertTime(new Date());
+                tmstrainPleaseApproveResult.setInsertUpdateRemark("内转钢材到异地库");
+                tmstrainPleaseApproveResultMapper.insertSelective(tmstrainPleaseApproveResult);
+
+            }
+            return 6;
         }
         return result;
     }

+ 77 - 30
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -7,6 +7,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 /**
  * @ author    :TXF
@@ -14,25 +15,48 @@ import java.util.Map;
  */
 
 public class DataChange {
+
+
     /**
-     * 解析前端传来的日期字符串
+     * 时间转换类
+     * 处理了三种类型 yyyy-MM-dd HH:mm:ss  yyyy/MM/dd HH:mm:ss  时间戳类型(带毫秒数时间戳13位)
      * @param vueDate
      * @return
      */
     public static Date dataToDate(Object vueDate){
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        Date parseDate = null;
-        if (vueDate != null){
+        if(vueDate instanceof Date){
+            return (Date) vueDate;
+        } else {
             try {
-                String date = (String) vueDate;
-                parseDate = sdf.parse(date);
-            } catch (ParseException e) {
-                e.printStackTrace();
+                String str = String.valueOf(vueDate);
+                if(judgeNumber(str) && str.length() == 13){
+                    return new Date(Long.parseLong(str));
+                }else if(str.contains("-")){
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    return sdf.parse(str);
+                }else if(str.contains("/")){
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                    return sdf.parse(str);
+                }
+            }catch (Exception e){
+                System.out.println("时间解析错误!返回null");
+                return null;
             }
         }
-        return parseDate;
+        return null;
     }
 
+    /**
+     * 判断是否纯数字(不带小数点)仅供上面方法使用
+     * @param str
+     * @return
+     */
+    public static boolean judgeNumber(String str){
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
+        return pattern.matcher(str).matches();
+    }
+
+
     /**
      * 数据转换成BigDecimal
      * @param data
@@ -104,19 +128,18 @@ public class DataChange {
      * @param key
      */
     public static void dataTo2Number(List<Map<String, Object>> list, String ...key){
+        DecimalFormat df =  new DecimalFormat("0.00");
         //遍历List
         for (Map<String, Object> map : list) {
             for (String s : key) {
                 //修改数据为带两位小数
                 try {
-                    BigDecimal oldDate = (BigDecimal) map.get(s);
-                    DecimalFormat df =  new DecimalFormat("0.00");
+                    BigDecimal oldDate = dataToBigDecimal(map.get(s));
                     String resultDeduction = df.format(oldDate.doubleValue());
                     map.put(s, resultDeduction);
                 } catch (Exception e) {
                     System.out.println("原料扣减量数据有误");
                 }
-
             }
         }
     }
@@ -164,6 +187,22 @@ public class DataChange {
         return sb.toString();
     }
 
+    public static String generateEightDigitsNumber(String start, Integer id,String pot){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        StringBuilder sb = new StringBuilder(start + pot + sdf.format(new Date()) + pot);
+        sb.append(
+                id < 10
+                        ? "0000000" + id : id < 100
+                        ? "000000" + id : id < 1000
+                        ? "00000" + id : id < 10000
+                        ? "0000" + id : id < 100000
+                        ? "000" + id : id < 1000000
+                        ? "00" + id : id < 10000000
+                        ? "0" + id : id.toString()
+        );
+        return sb.toString();
+    }
+
     /**
      * 根据时间段查询数据 支持只选择单个时间
      * @Author TXF
@@ -236,24 +275,32 @@ public class DataChange {
     }
 
     /**
-     * 生成带时间的八位数顺序号
-     * @param start 前缀
-     * @param id 顺序号  主键Id
+     * 只支持两个时间查询
+     * @Author TXF
+     * @Date 2022/1/15 9:08
+     * @param startTime
+     * @param endTime
+     * @param sdf
      * @return
-     */
-    public static String generateEightDigitsNumber(String start, Integer id,String pot){
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-        StringBuilder sb = new StringBuilder(start + pot + sdf.format(new Date()) + pot);
-        sb.append(
-                id < 10
-                        ? "0000000" + id : id < 100
-                        ? "000000" + id : id < 1000
-                        ? "00000" + id : id < 10000
-                        ? "0000" + id : id < 100000
-                        ? "000" + id : id < 1000000
-                        ? "00" + id : id < 10000000
-                        ? "0" + id : id.toString()
-        );
-        return sb.toString();
+     **/
+    public static void queryDataByDateTimeYestDay(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime))));
+        }
+        //如果开始时间和结束时间有且只有一个为空 则只查那天的数据
+        else if((startTime != null && !"null".equals(startTime)) || (endTime != null && !"null".equals(endTime))){
+            if(startTime != null && !"null".equals(startTime)){
+                queryDataByTwoDateSon(map, startTime, sdfDate);
+            }
+            if(endTime != null && !"null".equals(endTime)){
+                queryDataByTwoDateSon(map, endTime, sdfDate);
+            }
+        }else {
+            //如果两者时间都为空,则查询当天和昨天数据
+            String yesDate = sdfDate.format(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24));
+            map.put("oneDate", yesDate + " 08:00:00");
+        }
     }
 }

+ 2 - 2
src/main/resources/application-dev.yml

@@ -15,7 +15,7 @@ openfeign:
   ColumnDataFeign:
     url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
   TmsTruckFeign:
-    url: ${TMSTRUCKFEIGN_URL:172.16.33.162:8008}
+    url: ${TMSTRUCKFEIGN_URL:localhost:8088}
   ImFeign:
     url: ${IMFEIGN_URL:172.16.33.166:8055}
   JoinFeign:
@@ -24,4 +24,4 @@ openfeign:
 
   #测试环境端口
 server:
-    port: 8015
+    port: 8079

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

@@ -541,6 +541,7 @@
       #{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
@@ -827,4 +828,17 @@
                      ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
     WHERE ASTM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
   </select>
+
+  <update id="updateSendStation">
+    update
+      TMSTRAIN_PLEASE_APPROVE_RESULT
+    set SEND_STATION_ID=#{sendStationId}
+    WHERE RAIL_PLAN_ID=#{saleOrderId}
+  </update>
+  <update id="updateInwardConsignee">
+    update
+      AMS_SALE_ORDER
+    set RECEIVE_ID=#{consigneeId}
+    WHERE SALE_ORDER_ID=#{saleOrderId}
+  </update>
 </mapper>

+ 631 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainPleaseApproveResultMapper.xml

@@ -0,0 +1,631 @@
+<?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.TmstrainPleaseApproveResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="RAIL_PLAN_ID" jdbcType="DECIMAL" property="railPlanId" />
+    <result column="RESULT_PLEASE_PLAN_NO" jdbcType="VARCHAR" property="resultPleasePlanNo" />
+    <result column="RESULT_PLAN_DATE" jdbcType="TIMESTAMP" property="resultPlanDate" />
+    <result column="RESULT_CATEGORY" jdbcType="VARCHAR" property="resultCategory" />
+    <result column="SUPPLIER_ID" jdbcType="DECIMAL" property="supplierId" />
+    <result column="SEND_STATION_ID" jdbcType="DECIMAL" property="sendStationId" />
+    <result column="TO_THE_STATION_ID" jdbcType="DECIMAL" property="toTheStationId" />
+    <result column="RESULT_PLEASE_NUMBER" jdbcType="DECIMAL" property="resultPleaseNumber" />
+    <result column="RESULT_PLEASE_DATE" jdbcType="TIMESTAMP" property="resultPleaseDate" />
+    <result column="RESULT_APPROVE_NUMBER" jdbcType="DECIMAL" property="resultApproveNumber" />
+    <result column="RESULT_APPROVE_DATE" jdbcType="TIMESTAMP" property="resultApproveDate" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="STATUS" jdbcType="DECIMAL" property="status" />
+    <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="SPECIAL_LINE_ID" jdbcType="DECIMAL" property="specialLineId" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO, RESULT_PLAN_DATE, RESULT_CATEGORY, 
+    SUPPLIER_ID, SEND_STATION_ID, TO_THE_STATION_ID, RESULT_PLEASE_NUMBER, RESULT_PLEASE_DATE, 
+    RESULT_APPROVE_NUMBER, RESULT_APPROVE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_TYPE, CARRIER_ID, SPECIAL_LINE_ID
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.RAIL_PLAN_ID, t.RESULT_PLEASE_PLAN_NO, t.RESULT_PLAN_DATE, t.RESULT_CATEGORY, 
+    t.SUPPLIER_ID, t.SEND_STATION_ID, t.TO_THE_STATION_ID, t.RESULT_PLEASE_NUMBER, t.RESULT_PLEASE_DATE, 
+    t.RESULT_APPROVE_NUMBER, t.RESULT_APPROVE_DATE, t.INSERT_USERNAME, t.INSERT_TIME, 
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_TYPE, 
+    t.CARRIER_ID, t.SPECIAL_LINE_ID
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRAIN_PLEASE_APPROVE_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRAIN_PLEASE_APPROVE_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="railPlanId != null">
+        and RAIL_PLAN_ID = #{railPlanId}
+      </if>
+      <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
+        and RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo}
+      </if>
+      <if test="resultPlanDate != null">
+        and TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = #{resultPlanDate}
+      </if>
+      <if test="resultCategory != null and resultCategory != ''">
+        and RESULT_CATEGORY = #{resultCategory}
+      </if>
+      <if test="supplierId != null">
+        and SUPPLIER_ID = #{supplierId}
+      </if>
+      <if test="sendStationId != null">
+        and SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="toTheStationId != null">
+        and TO_THE_STATION_ID = #{toTheStationId}
+      </if>
+      <if test="resultPleaseNumber != null">
+        and RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
+      </if>
+      <if test="resultPleaseDate != null">
+        and TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = #{resultPleaseDate}
+      </if>
+      <if test="resultApproveNumber != null">
+        and RESULT_APPROVE_NUMBER = #{resultApproveNumber}
+      </if>
+      <if test="resultApproveDate != null">
+        and TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = #{resultApproveDate}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultType != null">
+        and RESULT_TYPE = #{resultType}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="specialLineId != null">
+        and SPECIAL_LINE_ID = #{specialLineId}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="railPlanId != null">
+        and RAIL_PLAN_ID = #{railPlanId}
+      </if>
+      <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
+        and RESULT_PLEASE_PLAN_NO LIKE '%${resultPleasePlanNo}%'
+      </if>
+      <if test="resultPlanDate != null">
+        and TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = #{resultPlanDate}
+      </if>
+      <if test="resultCategory != null and resultCategory != ''">
+        and RESULT_CATEGORY LIKE '%${resultCategory}%'
+      </if>
+      <if test="supplierId != null">
+        and SUPPLIER_ID = #{supplierId}
+      </if>
+      <if test="sendStationId != null">
+        and SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="toTheStationId != null">
+        and TO_THE_STATION_ID = #{toTheStationId}
+      </if>
+      <if test="resultPleaseNumber != null">
+        and RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
+      </if>
+      <if test="resultPleaseDate != null">
+        and TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = #{resultPleaseDate}
+      </if>
+      <if test="resultApproveNumber != null">
+        and RESULT_APPROVE_NUMBER = #{resultApproveNumber}
+      </if>
+      <if test="resultApproveDate != null">
+        and TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = #{resultApproveDate}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="status != null">
+        and STATUS = #{status}
+      </if>
+      <if test="resultType != null">
+        and RESULT_TYPE = #{resultType}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="specialLineId != null">
+        and SPECIAL_LINE_ID = #{specialLineId}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from TMSTRAIN_PLEASE_APPROVE_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRAIN_PLEASE_APPROVE_RESULT
+    where 1!=1 
+      <if test="railPlanId != null">
+        or RAIL_PLAN_ID = #{railPlanId}
+      </if>
+      <if test="resultPleasePlanNo != null and resultPleasePlanNo != ''">
+        or RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo}
+      </if>
+      <if test="resultPlanDate != null">
+        or TO_CHAR(RESULT_PLAN_DATE,'yyyy-MM-dd') = '#{resultPlanDate}'
+      </if>
+      <if test="resultCategory != null and resultCategory != ''">
+        or RESULT_CATEGORY = #{resultCategory}
+      </if>
+      <if test="supplierId != null">
+        or SUPPLIER_ID = #{supplierId}
+      </if>
+      <if test="sendStationId != null">
+        or SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="toTheStationId != null">
+        or TO_THE_STATION_ID = #{toTheStationId}
+      </if>
+      <if test="resultPleaseNumber != null">
+        or RESULT_PLEASE_NUMBER = #{resultPleaseNumber}
+      </if>
+      <if test="resultPleaseDate != null">
+        or TO_CHAR(RESULT_PLEASE_DATE,'yyyy-MM-dd') = '#{resultPleaseDate}'
+      </if>
+      <if test="resultApproveNumber != null">
+        or RESULT_APPROVE_NUMBER = #{resultApproveNumber}
+      </if>
+      <if test="resultApproveDate != null">
+        or TO_CHAR(RESULT_APPROVE_DATE,'yyyy-MM-dd') = '#{resultApproveDate}'
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="status != null">
+        or STATUS = #{status}
+      </if>
+      <if test="resultType != null">
+        or RESULT_TYPE = #{resultType}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="specialLineId != null">
+        or SPECIAL_LINE_ID = #{specialLineId}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
+    insert into TMSTRAIN_PLEASE_APPROVE_RESULT (RESULT_ID, RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO, 
+      RESULT_PLAN_DATE, RESULT_CATEGORY, SUPPLIER_ID, 
+      SEND_STATION_ID, TO_THE_STATION_ID, RESULT_PLEASE_NUMBER, 
+      RESULT_PLEASE_DATE, RESULT_APPROVE_NUMBER, 
+      RESULT_APPROVE_DATE, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      STATUS, RESULT_TYPE, CARRIER_ID, 
+      SPECIAL_LINE_ID)
+    values (#{resultId,jdbcType=DECIMAL}, #{railPlanId,jdbcType=DECIMAL}, #{resultPleasePlanNo,jdbcType=VARCHAR}, 
+      #{resultPlanDate,jdbcType=TIMESTAMP}, #{resultCategory,jdbcType=VARCHAR}, #{supplierId,jdbcType=DECIMAL}, 
+      #{sendStationId,jdbcType=DECIMAL}, #{toTheStationId,jdbcType=DECIMAL}, #{resultPleaseNumber,jdbcType=DECIMAL}, 
+      #{resultPleaseDate,jdbcType=TIMESTAMP}, #{resultApproveNumber,jdbcType=DECIMAL}, 
+      #{resultApproveDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
+      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{status,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
+      #{specialLineId,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
+    insert into TMSTRAIN_PLEASE_APPROVE_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="railPlanId != null">
+        RAIL_PLAN_ID,
+      </if>
+      <if test="resultPleasePlanNo != null">
+        RESULT_PLEASE_PLAN_NO,
+      </if>
+      <if test="resultPlanDate != null">
+        RESULT_PLAN_DATE,
+      </if>
+      <if test="resultCategory != null">
+        RESULT_CATEGORY,
+      </if>
+      <if test="supplierId != null">
+        SUPPLIER_ID,
+      </if>
+      <if test="sendStationId != null">
+        SEND_STATION_ID,
+      </if>
+      <if test="toTheStationId != null">
+        TO_THE_STATION_ID,
+      </if>
+      <if test="resultPleaseNumber != null">
+        RESULT_PLEASE_NUMBER,
+      </if>
+      <if test="resultPleaseDate != null">
+        RESULT_PLEASE_DATE,
+      </if>
+      <if test="resultApproveNumber != null">
+        RESULT_APPROVE_NUMBER,
+      </if>
+      <if test="resultApproveDate != null">
+        RESULT_APPROVE_DATE,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="status != null">
+        STATUS,
+      </if>
+      <if test="resultType != null">
+        RESULT_TYPE,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="specialLineId != null">
+        SPECIAL_LINE_ID,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="railPlanId != null">
+        #{railPlanId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleasePlanNo != null">
+        #{resultPleasePlanNo,jdbcType=VARCHAR},
+      </if>
+      <if test="resultPlanDate != null">
+        #{resultPlanDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultCategory != null">
+        #{resultCategory,jdbcType=VARCHAR},
+      </if>
+      <if test="supplierId != null">
+        #{supplierId,jdbcType=DECIMAL},
+      </if>
+      <if test="sendStationId != null">
+        #{sendStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="toTheStationId != null">
+        #{toTheStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleaseNumber != null">
+        #{resultPleaseNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleaseDate != null">
+        #{resultPleaseDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultApproveNumber != null">
+        #{resultApproveNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="resultApproveDate != null">
+        #{resultApproveDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultType != null">
+        #{resultType,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="specialLineId != null">
+        #{specialLineId,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
+    update TMSTRAIN_PLEASE_APPROVE_RESULT
+    set RAIL_PLAN_ID = #{railPlanId,jdbcType=DECIMAL},
+      RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo,jdbcType=VARCHAR},
+      RESULT_PLAN_DATE = #{resultPlanDate,jdbcType=TIMESTAMP},
+      RESULT_CATEGORY = #{resultCategory,jdbcType=VARCHAR},
+      SUPPLIER_ID = #{supplierId,jdbcType=DECIMAL},
+      SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
+      TO_THE_STATION_ID = #{toTheStationId,jdbcType=DECIMAL},
+      RESULT_PLEASE_NUMBER = #{resultPleaseNumber,jdbcType=DECIMAL},
+      RESULT_PLEASE_DATE = #{resultPleaseDate,jdbcType=TIMESTAMP},
+      RESULT_APPROVE_NUMBER = #{resultApproveNumber,jdbcType=DECIMAL},
+      RESULT_APPROVE_DATE = #{resultApproveDate,jdbcType=TIMESTAMP},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      STATUS = #{status,jdbcType=DECIMAL},
+      RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      SPECIAL_LINE_ID = #{specialLineId,jdbcType=DECIMAL}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainPleaseApproveResult">
+    update TMSTRAIN_PLEASE_APPROVE_RESULT
+    <set>
+      <if test="railPlanId != null">
+        RAIL_PLAN_ID = #{railPlanId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleasePlanNo != null">
+        RESULT_PLEASE_PLAN_NO = #{resultPleasePlanNo,jdbcType=VARCHAR},
+      </if>
+      <if test="resultPlanDate != null">
+        RESULT_PLAN_DATE = #{resultPlanDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultCategory != null">
+        RESULT_CATEGORY = #{resultCategory,jdbcType=VARCHAR},
+      </if>
+      <if test="supplierId != null">
+        SUPPLIER_ID = #{supplierId,jdbcType=DECIMAL},
+      </if>
+      <if test="sendStationId != null">
+        SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="toTheStationId != null">
+        TO_THE_STATION_ID = #{toTheStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleaseNumber != null">
+        RESULT_PLEASE_NUMBER = #{resultPleaseNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="resultPleaseDate != null">
+        RESULT_PLEASE_DATE = #{resultPleaseDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="resultApproveNumber != null">
+        RESULT_APPROVE_NUMBER = #{resultApproveNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="resultApproveDate != null">
+        RESULT_APPROVE_DATE = #{resultApproveDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        STATUS = #{status,jdbcType=DECIMAL},
+      </if>
+      <if test="resultType != null">
+        RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="specialLineId != null">
+        SPECIAL_LINE_ID = #{specialLineId,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRAIN_PLEASE_APPROVE_RESULT 
+      (RESULT_ID, 
+      RAIL_PLAN_ID, RESULT_PLEASE_PLAN_NO, 
+      RESULT_PLAN_DATE, RESULT_CATEGORY, 
+      SUPPLIER_ID, SEND_STATION_ID, TO_THE_STATION_ID, 
+      RESULT_PLEASE_NUMBER, RESULT_PLEASE_DATE, 
+      RESULT_APPROVE_NUMBER, RESULT_APPROVE_DATE, 
+      INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, STATUS, RESULT_TYPE, 
+      CARRIER_ID, SPECIAL_LINE_ID)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultId,jdbcType=DECIMAL}, 
+      #{item.railPlanId,jdbcType=DECIMAL}, #{item.resultPleasePlanNo,jdbcType=VARCHAR}, 
+      #{item.resultPlanDate,jdbcType=TIMESTAMP}, #{item.resultCategory,jdbcType=VARCHAR}, 
+      #{item.supplierId,jdbcType=DECIMAL}, #{item.sendStationId,jdbcType=DECIMAL}, #{item.toTheStationId,jdbcType=DECIMAL}, 
+      #{item.resultPleaseNumber,jdbcType=DECIMAL}, #{item.resultPleaseDate,jdbcType=TIMESTAMP}, 
+      #{item.resultApproveNumber,jdbcType=DECIMAL}, #{item.resultApproveDate,jdbcType=TIMESTAMP}, 
+      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.resultType,jdbcType=DECIMAL}, 
+      #{item.carrierId,jdbcType=DECIMAL}, #{item.specialLineId,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRAIN_PLEASE_APPROVE_RESULT
+     set
+       RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+       </foreach>
+       ,RAIL_PLAN_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.railPlanId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_PLEASE_PLAN_NO=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleasePlanNo,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_PLAN_DATE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPlanDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,RESULT_CATEGORY=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCategory,jdbcType=VARCHAR}
+       </foreach>
+       ,SUPPLIER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.supplierId,jdbcType=DECIMAL}
+       </foreach>
+       ,SEND_STATION_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStationId,jdbcType=DECIMAL}
+       </foreach>
+       ,TO_THE_STATION_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.toTheStationId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_PLEASE_NUMBER=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleaseNumber,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_PLEASE_DATE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultPleaseDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,RESULT_APPROVE_NUMBER=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApproveNumber,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_APPROVE_DATE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApproveDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_TYPE=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultType,jdbcType=DECIMAL}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,SPECIAL_LINE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.specialLineId,jdbcType=DECIMAL}
+       </foreach>
+     where RESULT_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.resultId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRAIN_PLEASE_APPROVE_RESULT
+    where RESULT_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+
+  
+</mapper>

+ 346 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainTruckTotalResultMapper.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.TmstrainTruckTotalResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainTruckTotalResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="TMSTRAIN_TOTAL_RESULT_ID" jdbcType="DECIMAL" property="tmstrainTotalResultId" />
+    <result column="TMSTRUCK_TOTAL_RESULT_ID" jdbcType="DECIMAL" property="tmstruckTotalResultId" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <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="LOAD_STATUS" jdbcType="DECIMAL" property="loadStatus" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, TMSTRAIN_TOTAL_RESULT_ID, TMSTRUCK_TOTAL_RESULT_ID, MATERIAL_ID, INSERT_USERNAME, 
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, LOAD_STATUS
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.TMSTRAIN_TOTAL_RESULT_ID, t.TMSTRUCK_TOTAL_RESULT_ID, t.MATERIAL_ID, 
+    t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
+    t.LOAD_STATUS
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM TMSTRAIN_TRUCK_TOTAL_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM TMSTRAIN_TRUCK_TOTAL_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="tmstrainTotalResultId != null">
+        and TMSTRAIN_TOTAL_RESULT_ID = #{tmstrainTotalResultId}
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        and TMSTRUCK_TOTAL_RESULT_ID = #{tmstruckTotalResultId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </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="loadStatus != null">
+        and LOAD_STATUS = #{loadStatus}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="tmstrainTotalResultId != null">
+        and TMSTRAIN_TOTAL_RESULT_ID = #{tmstrainTotalResultId}
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        and TMSTRUCK_TOTAL_RESULT_ID = #{tmstruckTotalResultId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </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="loadStatus != null">
+        and LOAD_STATUS = #{loadStatus}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from TMSTRAIN_TRUCK_TOTAL_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRAIN_TRUCK_TOTAL_RESULT
+    where 1!=1 
+      <if test="tmstrainTotalResultId != null">
+        or TMSTRAIN_TOTAL_RESULT_ID = #{tmstrainTotalResultId}
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        or TMSTRUCK_TOTAL_RESULT_ID = #{tmstruckTotalResultId}
+      </if>
+      <if test="materialId != null">
+        or MATERIAL_ID = #{materialId}
+      </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="loadStatus != null">
+        or LOAD_STATUS = #{loadStatus}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainTruckTotalResult">
+    insert into TMSTRAIN_TRUCK_TOTAL_RESULT (RESULT_ID, TMSTRAIN_TOTAL_RESULT_ID, 
+      TMSTRUCK_TOTAL_RESULT_ID, MATERIAL_ID, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, LOAD_STATUS)
+    values (#{resultId,jdbcType=DECIMAL}, #{tmstrainTotalResultId,jdbcType=DECIMAL}, 
+      #{tmstruckTotalResultId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, 
+      #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{insertUpdateRemark,jdbcType=VARCHAR}, #{loadStatus,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainTruckTotalResult">
+    insert into TMSTRAIN_TRUCK_TOTAL_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="tmstrainTotalResultId != null">
+        TMSTRAIN_TOTAL_RESULT_ID,
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        TMSTRUCK_TOTAL_RESULT_ID,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_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="loadStatus != null">
+        LOAD_STATUS,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="tmstrainTotalResultId != null">
+        #{tmstrainTotalResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        #{tmstruckTotalResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        #{materialId,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="loadStatus != null">
+        #{loadStatus,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainTruckTotalResult">
+    update TMSTRAIN_TRUCK_TOTAL_RESULT
+    set TMSTRAIN_TOTAL_RESULT_ID = #{tmstrainTotalResultId,jdbcType=DECIMAL},
+      TMSTRUCK_TOTAL_RESULT_ID = #{tmstruckTotalResultId,jdbcType=DECIMAL},
+      MATERIAL_ID = #{materialId,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},
+      LOAD_STATUS = #{loadStatus,jdbcType=DECIMAL}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainTruckTotalResult">
+    update TMSTRAIN_TRUCK_TOTAL_RESULT
+    <set>
+      <if test="tmstrainTotalResultId != null">
+        TMSTRAIN_TOTAL_RESULT_ID = #{tmstrainTotalResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="tmstruckTotalResultId != null">
+        TMSTRUCK_TOTAL_RESULT_ID = #{tmstruckTotalResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,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="loadStatus != null">
+        LOAD_STATUS = #{loadStatus,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into TMSTRAIN_TRUCK_TOTAL_RESULT 
+      (RESULT_ID, 
+      TMSTRAIN_TOTAL_RESULT_ID, TMSTRUCK_TOTAL_RESULT_ID, 
+      MATERIAL_ID, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, LOAD_STATUS
+      )
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultId,jdbcType=DECIMAL}, 
+      #{item.tmstrainTotalResultId,jdbcType=DECIMAL}, #{item.tmstruckTotalResultId,jdbcType=DECIMAL}, 
+      #{item.materialId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.loadStatus,jdbcType=DECIMAL}
+       from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRAIN_TRUCK_TOTAL_RESULT
+     set
+       RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+       </foreach>
+       ,TMSTRAIN_TOTAL_RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.tmstrainTotalResultId,jdbcType=DECIMAL}
+       </foreach>
+       ,TMSTRUCK_TOTAL_RESULT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.tmstruckTotalResultId,jdbcType=DECIMAL}
+       </foreach>
+       ,MATERIAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,LOAD_STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStatus,jdbcType=DECIMAL}
+       </foreach>
+     where RESULT_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.resultId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRAIN_TRUCK_TOTAL_RESULT
+    where RESULT_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  
+</mapper>