ソースを参照

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-TMS-TRAIN-API

zx 2 年 前
コミット
2affb45bd2

+ 2 - 0
src/main/java/com/steerinfo/dil/controller/TmstrainLoadingResultController.java

@@ -241,6 +241,8 @@ public class TmstrainLoadingResultController extends BaseRESTfulController {
         int result = tmstrainLoadingResultService.addWarehouseOutResult(map);
         if (result==-1){
             return failed("港存库实时库存不够");
+        } else if (result==-2) {
+             return failed("不存在港存库实时库存");
         }
         return success();
     }

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

@@ -7,4 +7,5 @@ import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface TmstrainLoadingTempMapper extends IBaseMapper<TmstrainLoadingTemp, BigDecimal> {
+     BigDecimal selectMaxId();
 }

+ 10 - 0
src/main/java/com/steerinfo/dil/mapper/TmstrainOutboundResultMapper.java

@@ -0,0 +1,10 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.TmstrainOutboundResult;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface TmstrainOutboundResultMapper extends IBaseMapper<TmstrainOutboundResult, BigDecimal> {
+}

+ 19 - 3
src/main/java/com/steerinfo/dil/model/TmstrainLoadingTemp.java

@@ -3,12 +3,13 @@ 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;
 
-@ApiModel(value="这张表是用来保存导入装车excel的临时数据国产矿和进口矿的excel不一致")
+@ApiModel(value="null")
 public class TmstrainLoadingTemp implements IBasePO<BigDecimal> {
     /**
-     * 主键ID(RESULT_ID,DECIMAL,38)
+     * 主键ID(RESULT_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="主键ID",required=true)
     private BigDecimal resultId;
@@ -20,7 +21,7 @@ public class TmstrainLoadingTemp implements IBasePO<BigDecimal> {
     private String resultWagonNo;
 
     /**
-     * 车皮标重(RESULT_BILLABLE_TONNAGE,DECIMAL,38)
+     * 车皮标重(RESULT_BILLABLE_TONNAGE,DECIMAL,0)
      */
     @ApiModelProperty(value="车皮标重",required=false)
     private BigDecimal resultBillableTonnage;
@@ -67,6 +68,12 @@ public class TmstrainLoadingTemp implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="矿种",required=false)
     private String mineral;
 
+    /**
+     * 采购订单号(PURCHASE_ORDER_NO,VARCHAR,100)
+     */
+    @ApiModelProperty(value="采购订单号",required=false)
+    private String purchaseOrderNo;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -159,6 +166,14 @@ public class TmstrainLoadingTemp implements IBasePO<BigDecimal> {
         this.mineral = mineral == null ? null : mineral.trim();
     }
 
+    public String getPurchaseOrderNo() {
+        return purchaseOrderNo;
+    }
+
+    public void setPurchaseOrderNo(String purchaseOrderNo) {
+        this.purchaseOrderNo = purchaseOrderNo == null ? null : purchaseOrderNo.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -175,6 +190,7 @@ public class TmstrainLoadingTemp implements IBasePO<BigDecimal> {
         sb.append(", sendDate=").append(sendDate);
         sb.append(", makeDate=").append(makeDate);
         sb.append(", mineral=").append(mineral);
+        sb.append(", purchaseOrderNo=").append(purchaseOrderNo);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 393 - 0
src/main/java/com/steerinfo/dil/model/TmstrainOutboundResult.java

@@ -0,0 +1,393 @@
+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="null")
+public class TmstrainOutboundResult implements IBasePO<BigDecimal> {
+    /**
+     * 火运出库实绩ID(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="火运出库实绩ID",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * WMSH出库实绩ID(OUTBOUND_RESULT_ID,VARCHAR,255)
+     */
+    @ApiModelProperty(value="WMSH出库实绩ID",required=false)
+    private String outboundResultId;
+
+    /**
+     * 车皮号(RESULT_WAGON_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="车皮号",required=false)
+    private String resultWagonNo;
+
+    /**
+     * 车皮标重(RESULT_BILLABLE_TONNAGE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="车皮标重",required=false)
+    private BigDecimal resultBillableTonnage;
+
+    /**
+     * 装车实绩ID(LOAD_RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="装车实绩ID",required=false)
+    private BigDecimal loadResultId;
+
+    /**
+     * 物资ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资ID",required=false)
+    private BigDecimal materialId;
+
+    /**
+     * 备注(RESULT_REMARKS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String resultRemarks;
+
+    /**
+     * 批次ID(BATCH_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="批次ID",required=false)
+    private BigDecimal batchId;
+
+    /**
+     * 班别(0:白班,1:夜班)(RESULT_CLASS,VARCHAR,20)
+     */
+    @ApiModelProperty(value="班别(0:白班,1:夜班)",required=false)
+    private String resultClass;
+
+    /**
+     * 是否清场(0:未清场;1:清场)(RESULT_ISCLEAR,VARCHAR,20)
+     */
+    @ApiModelProperty(value="是否清场(0:未清场;1:清场)",required=false)
+    private String resultIsclear;
+
+    /**
+     * 发货日期(SEND_DATE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="发货日期",required=false)
+    private String sendDate;
+
+    /**
+     * 装车日期(RESULT_LOADING_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="装车日期",required=false)
+    private Date resultLoadingDate;
+
+    /**
+     * 发站ID(SEND_STATION_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="发站ID",required=false)
+    private BigDecimal sendStationId;
+
+    /**
+     * 到站ID(ARRIVAL_STATION_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="到站ID",required=false)
+    private BigDecimal arrivalStationId;
+
+    /**
+     * 装车类型:1:采购进口矿(万州港-达州站/万州港-老区轨道衡)2:采购进口矿(海港-老区轨道衡)3:采购国产矿 4:内转(RESULT_TYPE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="装车类型:1:采购进口矿(万州港-达州站/万州港-老区轨道衡)2:采购进口矿(海港-老区轨道衡)3:采购国产矿 4:内转",required=false)
+    private BigDecimal resultType;
+
+    /**
+     * 轨道衡ID(在汽车衡表中)(TRAIN_CALCULATE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="轨道衡ID(在汽车衡表中)",required=false)
+    private BigDecimal trainCalculateId;
+
+    /**
+     * 卸货点ID(UNLOADING_POINT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="卸货点ID",required=false)
+    private BigDecimal unloadingPointId;
+
+    /**
+     * 发货单位ID(SEND_UNIT_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="发货单位ID",required=false)
+    private BigDecimal sendUnitId;
+
+    /**
+     * 记录创建人(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:已卸车)(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除(0:是, 1:已装车  2:已卸车)",required=false)
+    private BigDecimal deleted;
+
+    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 String getOutboundResultId() {
+        return outboundResultId;
+    }
+
+    public void setOutboundResultId(String outboundResultId) {
+        this.outboundResultId = outboundResultId == null ? null : outboundResultId.trim();
+    }
+
+    public String getResultWagonNo() {
+        return resultWagonNo;
+    }
+
+    public void setResultWagonNo(String resultWagonNo) {
+        this.resultWagonNo = resultWagonNo == null ? null : resultWagonNo.trim();
+    }
+
+    public BigDecimal getResultBillableTonnage() {
+        return resultBillableTonnage;
+    }
+
+    public void setResultBillableTonnage(BigDecimal resultBillableTonnage) {
+        this.resultBillableTonnage = resultBillableTonnage;
+    }
+
+    public BigDecimal getLoadResultId() {
+        return loadResultId;
+    }
+
+    public void setLoadResultId(BigDecimal loadResultId) {
+        this.loadResultId = loadResultId;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public String getResultRemarks() {
+        return resultRemarks;
+    }
+
+    public void setResultRemarks(String resultRemarks) {
+        this.resultRemarks = resultRemarks == null ? null : resultRemarks.trim();
+    }
+
+    public BigDecimal getBatchId() {
+        return batchId;
+    }
+
+    public void setBatchId(BigDecimal batchId) {
+        this.batchId = batchId;
+    }
+
+    public String getResultClass() {
+        return resultClass;
+    }
+
+    public void setResultClass(String resultClass) {
+        this.resultClass = resultClass == null ? null : resultClass.trim();
+    }
+
+    public String getResultIsclear() {
+        return resultIsclear;
+    }
+
+    public void setResultIsclear(String resultIsclear) {
+        this.resultIsclear = resultIsclear == null ? null : resultIsclear.trim();
+    }
+
+    public String getSendDate() {
+        return sendDate;
+    }
+
+    public void setSendDate(String sendDate) {
+        this.sendDate = sendDate == null ? null : sendDate.trim();
+    }
+
+    public Date getResultLoadingDate() {
+        return resultLoadingDate;
+    }
+
+    public void setResultLoadingDate(Date resultLoadingDate) {
+        this.resultLoadingDate = resultLoadingDate;
+    }
+
+    public BigDecimal getSendStationId() {
+        return sendStationId;
+    }
+
+    public void setSendStationId(BigDecimal sendStationId) {
+        this.sendStationId = sendStationId;
+    }
+
+    public BigDecimal getArrivalStationId() {
+        return arrivalStationId;
+    }
+
+    public void setArrivalStationId(BigDecimal arrivalStationId) {
+        this.arrivalStationId = arrivalStationId;
+    }
+
+    public BigDecimal getResultType() {
+        return resultType;
+    }
+
+    public void setResultType(BigDecimal resultType) {
+        this.resultType = resultType;
+    }
+
+    public BigDecimal getTrainCalculateId() {
+        return trainCalculateId;
+    }
+
+    public void setTrainCalculateId(BigDecimal trainCalculateId) {
+        this.trainCalculateId = trainCalculateId;
+    }
+
+    public BigDecimal getUnloadingPointId() {
+        return unloadingPointId;
+    }
+
+    public void setUnloadingPointId(BigDecimal unloadingPointId) {
+        this.unloadingPointId = unloadingPointId;
+    }
+
+    public BigDecimal getSendUnitId() {
+        return sendUnitId;
+    }
+
+    public void setSendUnitId(BigDecimal sendUnitId) {
+        this.sendUnitId = sendUnitId;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", outboundResultId=").append(outboundResultId);
+        sb.append(", resultWagonNo=").append(resultWagonNo);
+        sb.append(", resultBillableTonnage=").append(resultBillableTonnage);
+        sb.append(", loadResultId=").append(loadResultId);
+        sb.append(", materialId=").append(materialId);
+        sb.append(", resultRemarks=").append(resultRemarks);
+        sb.append(", batchId=").append(batchId);
+        sb.append(", resultClass=").append(resultClass);
+        sb.append(", resultIsclear=").append(resultIsclear);
+        sb.append(", sendDate=").append(sendDate);
+        sb.append(", resultLoadingDate=").append(resultLoadingDate);
+        sb.append(", sendStationId=").append(sendStationId);
+        sb.append(", arrivalStationId=").append(arrivalStationId);
+        sb.append(", resultType=").append(resultType);
+        sb.append(", trainCalculateId=").append(trainCalculateId);
+        sb.append(", unloadingPointId=").append(unloadingPointId);
+        sb.append(", sendUnitId=").append(sendUnitId);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 20 - 9
src/main/java/com/steerinfo/dil/service/impl/TmstrainLoadingResultServiceImpl.java

@@ -389,13 +389,13 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
     /**
      * 添加港存库出库实绩
      * @param map2
-     * @param batchId
+     * @param map2
      */
-    public int addOutWarehouse(Map<String,Object> map2, BigDecimal batchId){
+    public int addOutWarehouse(Map<String,Object> map2){
         Map<String, Object> map = new HashMap<>();
         map.put("isClean",map2.get("isClean"));
         map.put("resultMaterialNumber",map2.get("resultTonnage"));
-        map.put("batchId", batchId);
+        map.put("batchId", map2.get("batchId"));
         //通过港口名称查找港口id
         BigDecimal portId = tmstrainLoadingResultMapper.getPortIdByPortName((String) map2.get("portName"));
         map.put("portId", portId);
@@ -668,7 +668,9 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
     @Override
     @Transactional
     public int addWarehouseOutResult(Map<String, Object> map) {
+        int i=0;
         //根据车皮号计算标重
+        int wagonWeight=0;
         BigDecimal resultType =DataChange.dataToBigDecimal(map.get("resultType"));
         List<Map<String,Object>> wagonList =(List<Map<String, Object>>) map.get("wagonList");
         for (Map<String,Object> wagon:wagonList){
@@ -681,15 +683,24 @@ public class TmstrainLoadingResultServiceImpl implements ITmstrainLoadingResultS
             if (batchInfocatoryByNo.size() >= 1){
                 Map<String, Object> map1 = batchInfocatoryByNo.get(0);
                  batchId =DataChange.dataToBigDecimal(map1.get("batchId"));
+                 map.put("batchId",batchId);
+            }else {
+                return  -2;
             }
-            int wagonWeight = calculateWagonWeight(wagonNo);
+            wagonWeight += calculateWagonWeight(wagonNo);
             map.put("resultTonnage",wagonWeight);
+            // insert TrainLoadingTemp
+            TmstrainLoadingTemp temp=new TmstrainLoadingTemp();
+            temp.setResultId(tmstrainLoadingTempMapper.selectMaxId());
+            temp.setResultWagonNo(wagonNo);
+            temp.setPurchaseOrderNo(purchaseNo);
+            temp.setResultBillableTonnage(DataChange.dataToBigDecimal(calculateWagonWeight(wagonNo)));
+            tmstrainLoadingTempMapper.insertSelective(temp);
             //如果订单类型为采购进口矿火运(万州港---达州 || 万州港--老区轨道衡) 添加总车皮标重传输给港存库
-            if(resultType.intValue() == 1){
-                int i = addOutWarehouse(map, batchId);
-                return i;
-            }
         }
-        return 0;
+        if(resultType.intValue() == 1){
+            i = addOutWarehouse(map);
+        }
+        return i;
     }
 }

+ 13 - 12
src/main/resources/com/steerinfo/dil/mapper/TmstrainLoadingResultMapper.xml

@@ -1214,17 +1214,14 @@
 
 
   <select id="getBatchInfocatoryByNo" parameterType="java.util.Map" resultType="java.util.Map">
-     select  DBI.BATCH_INFACOTRY_ID "batchId"
-     from AMS_PURCHASE_ORDER APO
-     LEFT JOIN DIL_BATCH DB
-     ON APO.BATCH_ID=DB.BATCH_ID
-     LEFT JOIN DIL_BATCH_INFACOTRY DBI
-     ON DB.BATCH_ID=DBI.BATCH_ID
-     left join WMSH_GRID_MATERIAL WGM
-     ON WGM.BATCH_ID = DBI.BATCH_INFACOTRY_ID
-     LEFT JOIN RMS_PORT RP
-     ON RP.PORT_ID=WGM.PORT_ID
-     WHERE  APO.PURCHASE_ORDER_NO = #{purchaseNo} AND RP.PORT_NAME = #{portName}
+    SELECT
+      DB.BATCH_ID "batchId"
+    FROM
+      AMS_PURCHASE_ORDER APO
+        LEFT JOIN DIL_BATCH DB ON APO.BATCH_ID = DB.BATCH_ID
+        LEFT JOIN WMSH_GRID_MATERIAL WGM ON WGM.BATCH_ID = DB.BATCH_ID
+        LEFT JOIN RMS_PORT RP ON RP.PORT_ID = WGM.PORT_ID
+    WHERE  APO.PURCHASE_ORDER_NO = #{purchaseNo} AND RP.PORT_NAME = #{portName}
   </select>
 
   <!-- 通过订单No查询订单Id -->
@@ -1391,7 +1388,11 @@
     <if test="unloadPoint!=null and unloadPoint!=''.toString()">
       and  INSTR(db.RESULT_FOREIGN_SHIP_NAME, #{unloadPoint}) > 0
     </if>
-    ORDER BY apo.PURCHASE_ORDER_DATE DESC
+    ORDER BY
+    <if test="productName!=null and productName!=''.toString()">
+      nvl(length(trim(rm.MATERIAL_NAME)),0) DESC,--品名匹配物资名,按物资长度降序,匹配得多的在前
+    </if>
+    apo.PURCHASE_ORDER_DATE DESC
     )
   </select>
 

+ 149 - 122
src/main/resources/com/steerinfo/dil/mapper/TmstrainLoadingTempMapper.xml

@@ -12,23 +12,24 @@
     <result column="SEND_DATE" jdbcType="VARCHAR" property="sendDate" />
     <result column="MAKE_DATE" jdbcType="VARCHAR" property="makeDate" />
     <result column="MINERAL" jdbcType="VARCHAR" property="mineral" />
+    <result column="PURCHASE_ORDER_NO" jdbcType="VARCHAR" property="purchaseOrderNo" />
   </resultMap>
   <sql id="columns">
-    RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, MATERIAL_NAME, SEND_STATION, 
-    ARRIVAL_STATION, SUPPLIER_NAME, SEND_DATE, MAKE_DATE, MINERAL
+    RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, MATERIAL_NAME, SEND_STATION,
+    ARRIVAL_STATION, SUPPLIER_NAME, SEND_DATE, MAKE_DATE, MINERAL, PURCHASE_ORDER_NO
   </sql>
   <sql id="columns_alias">
-    t.RESULT_ID, t.RESULT_WAGON_NO, t.RESULT_BILLABLE_TONNAGE, t.MATERIAL_NAME, t.SEND_STATION, 
-    t.ARRIVAL_STATION, t.SUPPLIER_NAME, t.SEND_DATE, t.MAKE_DATE, t.MINERAL
+    t.RESULT_ID, t.RESULT_WAGON_NO, t.RESULT_BILLABLE_TONNAGE, t.MATERIAL_NAME, t.SEND_STATION,
+    t.ARRIVAL_STATION, t.SUPPLIER_NAME, t.SEND_DATE, t.MAKE_DATE, t.MINERAL, t.PURCHASE_ORDER_NO
   </sql>
   <sql id="select">
-    SELECT <include refid="columns"/> FROM TMSTRAIN_LOADING_TEMP
+    SELECT <include refid="columns" /> FROM TMSTRAIN_LOADING_TEMP
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM TMSTRAIN_LOADING_TEMP t
+    SELECT <include refid="columns_alias" /> FROM TMSTRAIN_LOADING_TEMP t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="resultId != null">
         and RESULT_ID = #{resultId}
       </if>
@@ -59,10 +60,13 @@
       <if test="mineral != null and mineral != ''">
         and MINERAL = #{mineral}
       </if>
+      <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
+        and PURCHASE_ORDER_NO = #{purchaseOrderNo}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="resultId != null">
         and RESULT_ID = #{resultId}
       </if>
@@ -93,52 +97,58 @@
       <if test="mineral != null and mineral != ''">
         and MINERAL LIKE '%${mineral}%'
       </if>
+      <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
+        and PURCHASE_ORDER_NO LIKE '%${purchaseOrderNo}%'
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from TMSTRAIN_LOADING_TEMP
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from TMSTRAIN_LOADING_TEMP
-    where 1!=1 
-      <if test="resultWagonNo != null and resultWagonNo != ''">
-        or RESULT_WAGON_NO = #{resultWagonNo}
-      </if>
-      <if test="resultBillableTonnage != null">
-        or RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
-      </if>
-      <if test="materialName != null and materialName != ''">
-        or MATERIAL_NAME = #{materialName}
-      </if>
-      <if test="sendStation != null and sendStation != ''">
-        or SEND_STATION = #{sendStation}
-      </if>
-      <if test="arrivalStation != null and arrivalStation != ''">
-        or ARRIVAL_STATION = #{arrivalStation}
-      </if>
-      <if test="supplierName != null and supplierName != ''">
-        or SUPPLIER_NAME = #{supplierName}
-      </if>
-      <if test="sendDate != null and sendDate != ''">
-        or SEND_DATE = #{sendDate}
-      </if>
-      <if test="makeDate != null and makeDate != ''">
-        or MAKE_DATE = #{makeDate}
-      </if>
-      <if test="mineral != null and mineral != ''">
-        or MINERAL = #{mineral}
-      </if>
+    where 1!=1
+    <if test="resultWagonNo != null and resultWagonNo != ''">
+      or RESULT_WAGON_NO = #{resultWagonNo}
+    </if>
+    <if test="resultBillableTonnage != null">
+      or RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
+    </if>
+    <if test="materialName != null and materialName != ''">
+      or MATERIAL_NAME = #{materialName}
+    </if>
+    <if test="sendStation != null and sendStation != ''">
+      or SEND_STATION = #{sendStation}
+    </if>
+    <if test="arrivalStation != null and arrivalStation != ''">
+      or ARRIVAL_STATION = #{arrivalStation}
+    </if>
+    <if test="supplierName != null and supplierName != ''">
+      or SUPPLIER_NAME = #{supplierName}
+    </if>
+    <if test="sendDate != null and sendDate != ''">
+      or SEND_DATE = #{sendDate}
+    </if>
+    <if test="makeDate != null and makeDate != ''">
+      or MAKE_DATE = #{makeDate}
+    </if>
+    <if test="mineral != null and mineral != ''">
+      or MINERAL = #{mineral}
+    </if>
+    <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
+      or PURCHASE_ORDER_NO = #{purchaseOrderNo}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
-    insert into TMSTRAIN_LOADING_TEMP (RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, 
-      MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION, 
-      SUPPLIER_NAME, SEND_DATE, MAKE_DATE, 
-      MINERAL)
-    values (#{resultId,jdbcType=DECIMAL}, #{resultWagonNo,jdbcType=VARCHAR}, #{resultBillableTonnage,jdbcType=DECIMAL}, 
-      #{materialName,jdbcType=VARCHAR}, #{sendStation,jdbcType=VARCHAR}, #{arrivalStation,jdbcType=VARCHAR}, 
-      #{supplierName,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, #{makeDate,jdbcType=VARCHAR}, 
-      #{mineral,jdbcType=VARCHAR})
+    insert into TMSTRAIN_LOADING_TEMP (RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
+                                       MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
+                                       SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
+                                       MINERAL, PURCHASE_ORDER_NO)
+    values (#{resultId,jdbcType=DECIMAL}, #{resultWagonNo,jdbcType=VARCHAR}, #{resultBillableTonnage,jdbcType=DECIMAL},
+            #{materialName,jdbcType=VARCHAR}, #{sendStation,jdbcType=VARCHAR}, #{arrivalStation,jdbcType=VARCHAR},
+            #{supplierName,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, #{makeDate,jdbcType=VARCHAR},
+            #{mineral,jdbcType=VARCHAR}, #{purchaseOrderNo,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
     insert into TMSTRAIN_LOADING_TEMP
@@ -173,6 +183,9 @@
       <if test="mineral != null">
         MINERAL,
       </if>
+      <if test="purchaseOrderNo != null">
+        PURCHASE_ORDER_NO,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="resultId != null">
@@ -205,19 +218,23 @@
       <if test="mineral != null">
         #{mineral,jdbcType=VARCHAR},
       </if>
+      <if test="purchaseOrderNo != null">
+        #{purchaseOrderNo,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
     update TMSTRAIN_LOADING_TEMP
     set RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
-      RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
-      MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
-      SEND_STATION = #{sendStation,jdbcType=VARCHAR},
-      ARRIVAL_STATION = #{arrivalStation,jdbcType=VARCHAR},
-      SUPPLIER_NAME = #{supplierName,jdbcType=VARCHAR},
-      SEND_DATE = #{sendDate,jdbcType=VARCHAR},
-      MAKE_DATE = #{makeDate,jdbcType=VARCHAR},
-      MINERAL = #{mineral,jdbcType=VARCHAR}
+        RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
+        MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
+        SEND_STATION = #{sendStation,jdbcType=VARCHAR},
+        ARRIVAL_STATION = #{arrivalStation,jdbcType=VARCHAR},
+        SUPPLIER_NAME = #{supplierName,jdbcType=VARCHAR},
+        SEND_DATE = #{sendDate,jdbcType=VARCHAR},
+        MAKE_DATE = #{makeDate,jdbcType=VARCHAR},
+        MINERAL = #{mineral,jdbcType=VARCHAR},
+        PURCHASE_ORDER_NO = #{purchaseOrderNo,jdbcType=VARCHAR}
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
@@ -250,93 +267,103 @@
       <if test="mineral != null">
         MINERAL = #{mineral,jdbcType=VARCHAR},
       </if>
+      <if test="purchaseOrderNo != null">
+        PURCHASE_ORDER_NO = #{purchaseOrderNo,jdbcType=VARCHAR},
+      </if>
     </set>
     where RESULT_ID = #{resultId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
+  <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"/>
+    <include refid="select" />
+    <include refid="where" />
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <include refid="whereLike"/>
+    <include refid="select" />
+    <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into TMSTRAIN_LOADING_TEMP 
-      (RESULT_ID, 
-      RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, 
-      MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION, 
-      SUPPLIER_NAME, SEND_DATE, MAKE_DATE, 
-      MINERAL)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.resultId,jdbcType=DECIMAL}, 
-      #{item.resultWagonNo,jdbcType=VARCHAR}, #{item.resultBillableTonnage,jdbcType=DECIMAL}, 
-      #{item.materialName,jdbcType=VARCHAR}, #{item.sendStation,jdbcType=VARCHAR}, #{item.arrivalStation,jdbcType=VARCHAR}, 
-      #{item.supplierName,jdbcType=VARCHAR}, #{item.sendDate,jdbcType=VARCHAR}, #{item.makeDate,jdbcType=VARCHAR}, 
-      #{item.mineral,jdbcType=VARCHAR} from dual  
-   </foreach> )
+    insert into TMSTRAIN_LOADING_TEMP
+    (RESULT_ID,
+    RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
+    MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
+    SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
+    MINERAL, PURCHASE_ORDER_NO)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.resultWagonNo,jdbcType=VARCHAR}, #{item.resultBillableTonnage,jdbcType=DECIMAL},
+    #{item.materialName,jdbcType=VARCHAR}, #{item.sendStation,jdbcType=VARCHAR}, #{item.arrivalStation,jdbcType=VARCHAR},
+    #{item.supplierName,jdbcType=VARCHAR}, #{item.sendDate,jdbcType=VARCHAR}, #{item.makeDate,jdbcType=VARCHAR},
+    #{item.mineral,jdbcType=VARCHAR}, #{item.purchaseOrderNo,jdbcType=VARCHAR} from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update TMSTRAIN_LOADING_TEMP
-     set
-       RESULT_ID=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
-       </foreach>
-       ,RESULT_WAGON_NO=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
-       </foreach>
-       ,RESULT_BILLABLE_TONNAGE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultBillableTonnage,jdbcType=DECIMAL}
-       </foreach>
-       ,MATERIAL_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.materialName,jdbcType=VARCHAR}
-       </foreach>
-       ,SEND_STATION=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStation,jdbcType=VARCHAR}
-       </foreach>
-       ,ARRIVAL_STATION=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.arrivalStation,jdbcType=VARCHAR}
-       </foreach>
-       ,SUPPLIER_NAME=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.supplierName,jdbcType=VARCHAR}
-       </foreach>
-       ,SEND_DATE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=VARCHAR}
-       </foreach>
-       ,MAKE_DATE=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.makeDate,jdbcType=VARCHAR}
-       </foreach>
-       ,MINERAL=
-       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
-          when #{item.resultId,jdbcType=DECIMAL} then #{item.mineral,jdbcType=VARCHAR}
-       </foreach>
-     where RESULT_ID in 
-     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.resultId,jdbcType=DECIMAL}
-     </foreach> 
+    update TMSTRAIN_LOADING_TEMP
+    set
+    RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_WAGON_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
+    </foreach>
+    ,RESULT_BILLABLE_TONNAGE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultBillableTonnage,jdbcType=DECIMAL}
+    </foreach>
+    ,MATERIAL_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.materialName,jdbcType=VARCHAR}
+    </foreach>
+    ,SEND_STATION=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStation,jdbcType=VARCHAR}
+    </foreach>
+    ,ARRIVAL_STATION=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.arrivalStation,jdbcType=VARCHAR}
+    </foreach>
+    ,SUPPLIER_NAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.supplierName,jdbcType=VARCHAR}
+    </foreach>
+    ,SEND_DATE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=VARCHAR}
+    </foreach>
+    ,MAKE_DATE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.makeDate,jdbcType=VARCHAR}
+    </foreach>
+    ,MINERAL=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.mineral,jdbcType=VARCHAR}
+    </foreach>
+    ,PURCHASE_ORDER_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.purchaseOrderNo,jdbcType=VARCHAR}
+    </foreach>
+    where RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from TMSTRAIN_LOADING_TEMP
-    where RESULT_ID in 
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  
+
+  <select id="selectMaxId" resultType="java.math.BigDecimal">
+    select seq_tmstrain_loading_temp.nextval from dual
+  </select>
 </mapper>

+ 706 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainOutboundResultMapper.xml

@@ -0,0 +1,706 @@
+<?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.TmstrainOutboundResultMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainOutboundResult">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="OUTBOUND_RESULT_ID" jdbcType="VARCHAR" property="outboundResultId" />
+    <result column="RESULT_WAGON_NO" jdbcType="VARCHAR" property="resultWagonNo" />
+    <result column="RESULT_BILLABLE_TONNAGE" jdbcType="DECIMAL" property="resultBillableTonnage" />
+    <result column="LOAD_RESULT_ID" jdbcType="DECIMAL" property="loadResultId" />
+    <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+    <result column="RESULT_REMARKS" jdbcType="VARCHAR" property="resultRemarks" />
+    <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
+    <result column="RESULT_CLASS" jdbcType="VARCHAR" property="resultClass" />
+    <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear" />
+    <result column="SEND_DATE" jdbcType="VARCHAR" property="sendDate" />
+    <result column="RESULT_LOADING_DATE" jdbcType="TIMESTAMP" property="resultLoadingDate" />
+    <result column="SEND_STATION_ID" jdbcType="DECIMAL" property="sendStationId" />
+    <result column="ARRIVAL_STATION_ID" jdbcType="DECIMAL" property="arrivalStationId" />
+    <result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
+    <result column="TRAIN_CALCULATE_ID" jdbcType="DECIMAL" property="trainCalculateId" />
+    <result column="UNLOADING_POINT_ID" jdbcType="DECIMAL" property="unloadingPointId" />
+    <result column="SEND_UNIT_ID" jdbcType="DECIMAL" property="sendUnitId" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, OUTBOUND_RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, LOAD_RESULT_ID, 
+    MATERIAL_ID, RESULT_REMARKS, BATCH_ID, RESULT_CLASS, RESULT_ISCLEAR, SEND_DATE, RESULT_LOADING_DATE, 
+    SEND_STATION_ID, ARRIVAL_STATION_ID, RESULT_TYPE, TRAIN_CALCULATE_ID, UNLOADING_POINT_ID, 
+    SEND_UNIT_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+    DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.OUTBOUND_RESULT_ID, t.RESULT_WAGON_NO, t.RESULT_BILLABLE_TONNAGE, 
+    t.LOAD_RESULT_ID, t.MATERIAL_ID, t.RESULT_REMARKS, t.BATCH_ID, t.RESULT_CLASS, t.RESULT_ISCLEAR, 
+    t.SEND_DATE, t.RESULT_LOADING_DATE, t.SEND_STATION_ID, t.ARRIVAL_STATION_ID, t.RESULT_TYPE, 
+    t.TRAIN_CALCULATE_ID, t.UNLOADING_POINT_ID, t.SEND_UNIT_ID, t.INSERT_USERNAME, t.INSERT_TIME, 
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM TMSTRAIN_OUTBOUND_RESULT
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM TMSTRAIN_OUTBOUND_RESULT t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="outboundResultId != null and outboundResultId != ''">
+        and OUTBOUND_RESULT_ID = #{outboundResultId}
+      </if>
+      <if test="resultWagonNo != null and resultWagonNo != ''">
+        and RESULT_WAGON_NO = #{resultWagonNo}
+      </if>
+      <if test="resultBillableTonnage != null">
+        and RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
+      </if>
+      <if test="loadResultId != null">
+        and LOAD_RESULT_ID = #{loadResultId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="resultRemarks != null and resultRemarks != ''">
+        and RESULT_REMARKS = #{resultRemarks}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="resultClass != null and resultClass != ''">
+        and RESULT_CLASS = #{resultClass}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR = #{resultIsclear}
+      </if>
+      <if test="sendDate != null and sendDate != ''">
+        and SEND_DATE = #{sendDate}
+      </if>
+      <if test="resultLoadingDate != null">
+        and TO_CHAR(RESULT_LOADING_DATE,'yyyy-MM-dd') = #{resultLoadingDate}
+      </if>
+      <if test="sendStationId != null">
+        and SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="arrivalStationId != null">
+        and ARRIVAL_STATION_ID = #{arrivalStationId}
+      </if>
+      <if test="resultType != null">
+        and RESULT_TYPE = #{resultType}
+      </if>
+      <if test="trainCalculateId != null">
+        and TRAIN_CALCULATE_ID = #{trainCalculateId}
+      </if>
+      <if test="unloadingPointId != null">
+        and UNLOADING_POINT_ID = #{unloadingPointId}
+      </if>
+      <if test="sendUnitId != null">
+        and SEND_UNIT_ID = #{sendUnitId}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="outboundResultId != null and outboundResultId != ''">
+        and OUTBOUND_RESULT_ID LIKE '%${outboundResultId}%'
+      </if>
+      <if test="resultWagonNo != null and resultWagonNo != ''">
+        and RESULT_WAGON_NO LIKE '%${resultWagonNo}%'
+      </if>
+      <if test="resultBillableTonnage != null">
+        and RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
+      </if>
+      <if test="loadResultId != null">
+        and LOAD_RESULT_ID = #{loadResultId}
+      </if>
+      <if test="materialId != null">
+        and MATERIAL_ID = #{materialId}
+      </if>
+      <if test="resultRemarks != null and resultRemarks != ''">
+        and RESULT_REMARKS LIKE '%${resultRemarks}%'
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="resultClass != null and resultClass != ''">
+        and RESULT_CLASS LIKE '%${resultClass}%'
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
+      </if>
+      <if test="sendDate != null and sendDate != ''">
+        and SEND_DATE LIKE '%${sendDate}%'
+      </if>
+      <if test="resultLoadingDate != null">
+        and TO_CHAR(RESULT_LOADING_DATE,'yyyy-MM-dd') = #{resultLoadingDate}
+      </if>
+      <if test="sendStationId != null">
+        and SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="arrivalStationId != null">
+        and ARRIVAL_STATION_ID = #{arrivalStationId}
+      </if>
+      <if test="resultType != null">
+        and RESULT_TYPE = #{resultType}
+      </if>
+      <if test="trainCalculateId != null">
+        and TRAIN_CALCULATE_ID = #{trainCalculateId}
+      </if>
+      <if test="unloadingPointId != null">
+        and UNLOADING_POINT_ID = #{unloadingPointId}
+      </if>
+      <if test="sendUnitId != null">
+        and SEND_UNIT_ID = #{sendUnitId}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from TMSTRAIN_OUTBOUND_RESULT
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from TMSTRAIN_OUTBOUND_RESULT
+    where 1!=1 
+      <if test="outboundResultId != null and outboundResultId != ''">
+        or OUTBOUND_RESULT_ID = #{outboundResultId}
+      </if>
+      <if test="resultWagonNo != null and resultWagonNo != ''">
+        or RESULT_WAGON_NO = #{resultWagonNo}
+      </if>
+      <if test="resultBillableTonnage != null">
+        or RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
+      </if>
+      <if test="loadResultId != null">
+        or LOAD_RESULT_ID = #{loadResultId}
+      </if>
+      <if test="materialId != null">
+        or MATERIAL_ID = #{materialId}
+      </if>
+      <if test="resultRemarks != null and resultRemarks != ''">
+        or RESULT_REMARKS = #{resultRemarks}
+      </if>
+      <if test="batchId != null">
+        or BATCH_ID = #{batchId}
+      </if>
+      <if test="resultClass != null and resultClass != ''">
+        or RESULT_CLASS = #{resultClass}
+      </if>
+      <if test="resultIsclear != null and resultIsclear != ''">
+        or RESULT_ISCLEAR = #{resultIsclear}
+      </if>
+      <if test="sendDate != null and sendDate != ''">
+        or SEND_DATE = #{sendDate}
+      </if>
+      <if test="resultLoadingDate != null">
+        or TO_CHAR(RESULT_LOADING_DATE,'yyyy-MM-dd') = '#{resultLoadingDate}'
+      </if>
+      <if test="sendStationId != null">
+        or SEND_STATION_ID = #{sendStationId}
+      </if>
+      <if test="arrivalStationId != null">
+        or ARRIVAL_STATION_ID = #{arrivalStationId}
+      </if>
+      <if test="resultType != null">
+        or RESULT_TYPE = #{resultType}
+      </if>
+      <if test="trainCalculateId != null">
+        or TRAIN_CALCULATE_ID = #{trainCalculateId}
+      </if>
+      <if test="unloadingPointId != null">
+        or UNLOADING_POINT_ID = #{unloadingPointId}
+      </if>
+      <if test="sendUnitId != null">
+        or SEND_UNIT_ID = #{sendUnitId}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        or INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        or UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainOutboundResult">
+    insert into TMSTRAIN_OUTBOUND_RESULT (RESULT_ID, OUTBOUND_RESULT_ID, RESULT_WAGON_NO, 
+      RESULT_BILLABLE_TONNAGE, LOAD_RESULT_ID, MATERIAL_ID, 
+      RESULT_REMARKS, BATCH_ID, RESULT_CLASS, 
+      RESULT_ISCLEAR, SEND_DATE, RESULT_LOADING_DATE, 
+      SEND_STATION_ID, ARRIVAL_STATION_ID, RESULT_TYPE, 
+      TRAIN_CALCULATE_ID, UNLOADING_POINT_ID, SEND_UNIT_ID, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+      )
+    values (#{resultId,jdbcType=DECIMAL}, #{outboundResultId,jdbcType=VARCHAR}, #{resultWagonNo,jdbcType=VARCHAR}, 
+      #{resultBillableTonnage,jdbcType=DECIMAL}, #{loadResultId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, 
+      #{resultRemarks,jdbcType=VARCHAR}, #{batchId,jdbcType=DECIMAL}, #{resultClass,jdbcType=VARCHAR}, 
+      #{resultIsclear,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, #{resultLoadingDate,jdbcType=TIMESTAMP}, 
+      #{sendStationId,jdbcType=DECIMAL}, #{arrivalStationId,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, 
+      #{trainCalculateId,jdbcType=DECIMAL}, #{unloadingPointId,jdbcType=DECIMAL}, #{sendUnitId,jdbcType=DECIMAL}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainOutboundResult">
+    insert into TMSTRAIN_OUTBOUND_RESULT
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="outboundResultId != null">
+        OUTBOUND_RESULT_ID,
+      </if>
+      <if test="resultWagonNo != null">
+        RESULT_WAGON_NO,
+      </if>
+      <if test="resultBillableTonnage != null">
+        RESULT_BILLABLE_TONNAGE,
+      </if>
+      <if test="loadResultId != null">
+        LOAD_RESULT_ID,
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID,
+      </if>
+      <if test="resultRemarks != null">
+        RESULT_REMARKS,
+      </if>
+      <if test="batchId != null">
+        BATCH_ID,
+      </if>
+      <if test="resultClass != null">
+        RESULT_CLASS,
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR,
+      </if>
+      <if test="sendDate != null">
+        SEND_DATE,
+      </if>
+      <if test="resultLoadingDate != null">
+        RESULT_LOADING_DATE,
+      </if>
+      <if test="sendStationId != null">
+        SEND_STATION_ID,
+      </if>
+      <if test="arrivalStationId != null">
+        ARRIVAL_STATION_ID,
+      </if>
+      <if test="resultType != null">
+        RESULT_TYPE,
+      </if>
+      <if test="trainCalculateId != null">
+        TRAIN_CALCULATE_ID,
+      </if>
+      <if test="unloadingPointId != null">
+        UNLOADING_POINT_ID,
+      </if>
+      <if test="sendUnitId != null">
+        SEND_UNIT_ID,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="outboundResultId != null">
+        #{outboundResultId,jdbcType=VARCHAR},
+      </if>
+      <if test="resultWagonNo != null">
+        #{resultWagonNo,jdbcType=VARCHAR},
+      </if>
+      <if test="resultBillableTonnage != null">
+        #{resultBillableTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadResultId != null">
+        #{loadResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultRemarks != null">
+        #{resultRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="batchId != null">
+        #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultClass != null">
+        #{resultClass,jdbcType=VARCHAR},
+      </if>
+      <if test="resultIsclear != null">
+        #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="sendDate != null">
+        #{sendDate,jdbcType=VARCHAR},
+      </if>
+      <if test="resultLoadingDate != null">
+        #{resultLoadingDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sendStationId != null">
+        #{sendStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="arrivalStationId != null">
+        #{arrivalStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultType != null">
+        #{resultType,jdbcType=DECIMAL},
+      </if>
+      <if test="trainCalculateId != null">
+        #{trainCalculateId,jdbcType=DECIMAL},
+      </if>
+      <if test="unloadingPointId != null">
+        #{unloadingPointId,jdbcType=DECIMAL},
+      </if>
+      <if test="sendUnitId != null">
+        #{sendUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainOutboundResult">
+    update TMSTRAIN_OUTBOUND_RESULT
+    set OUTBOUND_RESULT_ID = #{outboundResultId,jdbcType=VARCHAR},
+      RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
+      RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
+      LOAD_RESULT_ID = #{loadResultId,jdbcType=DECIMAL},
+      MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      RESULT_REMARKS = #{resultRemarks,jdbcType=VARCHAR},
+      BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      RESULT_CLASS = #{resultClass,jdbcType=VARCHAR},
+      RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+      SEND_DATE = #{sendDate,jdbcType=VARCHAR},
+      RESULT_LOADING_DATE = #{resultLoadingDate,jdbcType=TIMESTAMP},
+      SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
+      ARRIVAL_STATION_ID = #{arrivalStationId,jdbcType=DECIMAL},
+      RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
+      TRAIN_CALCULATE_ID = #{trainCalculateId,jdbcType=DECIMAL},
+      UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
+      SEND_UNIT_ID = #{sendUnitId,jdbcType=DECIMAL},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      DELETED = #{deleted,jdbcType=DECIMAL}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainOutboundResult">
+    update TMSTRAIN_OUTBOUND_RESULT
+    <set>
+      <if test="outboundResultId != null">
+        OUTBOUND_RESULT_ID = #{outboundResultId,jdbcType=VARCHAR},
+      </if>
+      <if test="resultWagonNo != null">
+        RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
+      </if>
+      <if test="resultBillableTonnage != null">
+        RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="loadResultId != null">
+        LOAD_RESULT_ID = #{loadResultId,jdbcType=DECIMAL},
+      </if>
+      <if test="materialId != null">
+        MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultRemarks != null">
+        RESULT_REMARKS = #{resultRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="batchId != null">
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultClass != null">
+        RESULT_CLASS = #{resultClass,jdbcType=VARCHAR},
+      </if>
+      <if test="resultIsclear != null">
+        RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
+      </if>
+      <if test="sendDate != null">
+        SEND_DATE = #{sendDate,jdbcType=VARCHAR},
+      </if>
+      <if test="resultLoadingDate != null">
+        RESULT_LOADING_DATE = #{resultLoadingDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sendStationId != null">
+        SEND_STATION_ID = #{sendStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="arrivalStationId != null">
+        ARRIVAL_STATION_ID = #{arrivalStationId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultType != null">
+        RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
+      </if>
+      <if test="trainCalculateId != null">
+        TRAIN_CALCULATE_ID = #{trainCalculateId,jdbcType=DECIMAL},
+      </if>
+      <if test="unloadingPointId != null">
+        UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
+      </if>
+      <if test="sendUnitId != null">
+        SEND_UNIT_ID = #{sendUnitId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" 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_OUTBOUND_RESULT 
+      (RESULT_ID, 
+      OUTBOUND_RESULT_ID, RESULT_WAGON_NO, 
+      RESULT_BILLABLE_TONNAGE, LOAD_RESULT_ID, 
+      MATERIAL_ID, RESULT_REMARKS, BATCH_ID, 
+      RESULT_CLASS, RESULT_ISCLEAR, SEND_DATE, 
+      RESULT_LOADING_DATE, SEND_STATION_ID, 
+      ARRIVAL_STATION_ID, RESULT_TYPE, 
+      TRAIN_CALCULATE_ID, UNLOADING_POINT_ID, 
+      SEND_UNIT_ID, INSERT_USERNAME, INSERT_TIME, 
+      UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, DELETED)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.resultId,jdbcType=DECIMAL}, 
+      #{item.outboundResultId,jdbcType=VARCHAR}, #{item.resultWagonNo,jdbcType=VARCHAR}, 
+      #{item.resultBillableTonnage,jdbcType=DECIMAL}, #{item.loadResultId,jdbcType=DECIMAL}, 
+      #{item.materialId,jdbcType=DECIMAL}, #{item.resultRemarks,jdbcType=VARCHAR}, #{item.batchId,jdbcType=DECIMAL}, 
+      #{item.resultClass,jdbcType=VARCHAR}, #{item.resultIsclear,jdbcType=VARCHAR}, #{item.sendDate,jdbcType=VARCHAR}, 
+      #{item.resultLoadingDate,jdbcType=TIMESTAMP}, #{item.sendStationId,jdbcType=DECIMAL}, 
+      #{item.arrivalStationId,jdbcType=DECIMAL}, #{item.resultType,jdbcType=DECIMAL}, 
+      #{item.trainCalculateId,jdbcType=DECIMAL}, #{item.unloadingPointId,jdbcType=DECIMAL}, 
+      #{item.sendUnitId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
+      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
+      #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update TMSTRAIN_OUTBOUND_RESULT
+     set
+       RESULT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+       </foreach>
+       ,OUTBOUND_RESULT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.outboundResultId,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_WAGON_NO=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_BILLABLE_TONNAGE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultBillableTonnage,jdbcType=DECIMAL}
+       </foreach>
+       ,LOAD_RESULT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.loadResultId,jdbcType=DECIMAL}
+       </foreach>
+       ,MATERIAL_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_REMARKS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultRemarks,jdbcType=VARCHAR}
+       </foreach>
+       ,BATCH_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_CLASS=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultClass,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_ISCLEAR=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
+       </foreach>
+       ,SEND_DATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=VARCHAR}
+       </foreach>
+       ,RESULT_LOADING_DATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadingDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,SEND_STATION_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStationId,jdbcType=DECIMAL}
+       </foreach>
+       ,ARRIVAL_STATION_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.arrivalStationId,jdbcType=DECIMAL}
+       </foreach>
+       ,RESULT_TYPE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.resultType,jdbcType=DECIMAL}
+       </foreach>
+       ,TRAIN_CALCULATE_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.trainCalculateId,jdbcType=DECIMAL}
+       </foreach>
+       ,UNLOADING_POINT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.unloadingPointId,jdbcType=DECIMAL}
+       </foreach>
+       ,SEND_UNIT_ID=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.sendUnitId,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+          when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+     where RESULT_ID in 
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+    #{item.resultId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from TMSTRAIN_OUTBOUND_RESULT
+    where RESULT_ID in 
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>