zx 2 سال پیش
والد
کامیت
26e9f2fe47

+ 1 - 1
pom.xml

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

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

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

+ 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();
+    }
+}

+ 32 - 2
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -67,6 +67,8 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     EASDeleteTestUtil easDeleteTestUtil;
     @Autowired
     RmsMaterialMapper rmsMaterialMapper;
+    @Autowired
+    TmstrainPleaseApproveResultMapper tmstrainPleaseApproveResultMapper;
 
     @Override
     public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
@@ -720,6 +722,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
     @Override
     public int dispatchSteelOrder(List<Map<String, Object>> mapList) {
         int result = 0;
+        BigDecimal isSteel=null;
         // 遍历每一行
         for (Map<String,Object> map : mapList) {
             // 得到车牌号
@@ -734,7 +737,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) {
@@ -785,7 +792,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);
                 }
@@ -814,6 +821,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);
@@ -825,6 +836,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                 omstruckOrder.setInsertTime(new Date());
                 omstruckOrder.setInsertUsername("");
                 result += omstruckOrderMapper.insertSelective(omstruckOrder);
+
             }
             else {
                 omstruckOrder = omstruckOrders.get(0);
@@ -857,6 +869,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");
+        }
     }
 }

+ 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>