luobang 2 lat temu
rodzic
commit
22ab633159

+ 6 - 1
src/main/java/com/steerinfo/dil/controller/TmstruckLoadResultController.java

@@ -413,6 +413,11 @@ public class TmstruckLoadResultController extends BaseRESTfulController {
     @ApiOperation(value = "根据运输订单号修改装/卸点、卸货物资、装机备注等:后台管理")
     @PostMapping("/updateLoadingIdRemark")
     public RESTfulResult updateLoadingIdRemark(@RequestBody(required=false) Map<String, Object> map){
-        return success(tmstruckLoadResultService.updateLoadingIdRemark(map));
+        int i = tmstruckLoadResultService.updateLoadingIdRemark(map);
+
+        if ( i == -1) {
+            return failed("找不到对应的单据");
+        }
+        return success("修改成功");
     }
 }

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

@@ -0,0 +1,20 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsMaterial;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface RmsMaterialMapper extends IBaseMapper<RmsMaterial, BigDecimal> {
+
+
+    //递增序列号
+    @Select("SELECT seq_RMS_MATERIAL.nextval FROM dual")
+    BigDecimal getMaterialId();
+
+}

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

@@ -0,0 +1,20 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsWarehouse;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface RmsWarehouseMapper extends IBaseMapper<RmsWarehouse, BigDecimal> {
+
+    //id自增
+    @Select("select seq_RMS_WAREHOUSE.nextval from dual")
+    BigDecimal selectWarehouseId();
+
+
+}

+ 7 - 0
src/main/java/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.java

@@ -59,4 +59,11 @@ public interface TmstruckUnloadResultMapper extends IBaseMapper<TmstruckUnloadRe
 
     //查询这个物资是否已经卸过了
     Integer checkMaterialIdUnload(@Param("resultTotalId") BigDecimal resultTotalId,@Param("materialId") BigDecimal materialId);
+
+    Map<String,Object> getOrderType(String orderNumber);
+
+    BigDecimal selectMaterialId(String materialName);
+
+    BigDecimal selectWarehouseId(String warehouseName);
+
 }

+ 286 - 0
src/main/java/com/steerinfo/dil/model/RmsMaterial.java

@@ -0,0 +1,286 @@
+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 RmsMaterial implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(MATERIAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal materialId;
+
+    /**
+     * 物资类型ID(MATERIAL_TYPE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="物资类型ID",required=false)
+    private BigDecimal materialTypeId;
+
+    /**
+     * 计量单位ID(UNIT_OF_MEASURE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="计量单位ID",required=false)
+    private BigDecimal unitOfMeasureId;
+
+    /**
+     * 物资编码(物资名称+规格型号+物资长度)(MATERIAL_CODE,VARCHAR,200)
+     */
+    @ApiModelProperty(value="物资编码(物资名称+规格型号+物资长度)",required=false)
+    private String materialCode;
+
+    /**
+     * 物资名称(MATERIAL_NAME,VARCHAR,100)
+     */
+    @ApiModelProperty(value="物资名称",required=false)
+    private String materialName;
+
+    /**
+     * 规格(MATERIAL_SPECIFICATION,VARCHAR,100)
+     */
+    @ApiModelProperty(value="规格",required=false)
+    private String materialSpecification;
+
+    /**
+     * 型号(MATERIAL_MODEL,VARCHAR,100)
+     */
+    @ApiModelProperty(value="型号",required=false)
+    private String materialModel;
+
+    /**
+     * 长度(MATERIAL_LENGTH,DECIMAL,0)
+     */
+    @ApiModelProperty(value="长度",required=false)
+    private BigDecimal materialLength;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 金蝶物资主键ID(EAS_MATERIAL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="金蝶物资主键ID",required=false)
+    private String easMaterialId;
+
+    /**
+     * 逻辑删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    /**
+     * 物资理重(默认保留3位小数,若盘螺则保留2位小数)(MATERIAL_THEORETICAL_WEIGHT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="物资理重(默认保留3位小数,若盘螺则保留2位小数)",required=false)
+    private BigDecimal materialTheoreticalWeight;
+
+    @ApiModelProperty(value = "装卸货优先次序",required = false)
+    private BigDecimal materialOrder;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.materialId;
+    }
+
+    @Override
+    public void setId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(BigDecimal materialId) {
+        this.materialId = materialId;
+    }
+
+    public BigDecimal getMaterialTypeId() {
+        return materialTypeId;
+    }
+
+    public void setMaterialTypeId(BigDecimal materialTypeId) {
+        this.materialTypeId = materialTypeId;
+    }
+
+    public BigDecimal getUnitOfMeasureId() {
+        return unitOfMeasureId;
+    }
+
+    public void setUnitOfMeasureId(BigDecimal unitOfMeasureId) {
+        this.unitOfMeasureId = unitOfMeasureId;
+    }
+
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode == null ? null : materialCode.trim();
+    }
+
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName == null ? null : materialName.trim();
+    }
+
+    public String getMaterialSpecification() {
+        return materialSpecification;
+    }
+
+    public void setMaterialSpecification(String materialSpecification) {
+        this.materialSpecification = materialSpecification == null ? null : materialSpecification.trim();
+    }
+
+    public String getMaterialModel() {
+        return materialModel;
+    }
+
+    public void setMaterialModel(String materialModel) {
+        this.materialModel = materialModel == null ? null : materialModel.trim();
+    }
+
+    public BigDecimal getMaterialLength() {
+        return materialLength;
+    }
+
+    public void setMaterialLength(BigDecimal materialLength) {
+        this.materialLength = materialLength;
+    }
+
+    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 String getEasMaterialId() {
+        return easMaterialId;
+    }
+
+    public void setEasMaterialId(String easMaterialId) {
+        this.easMaterialId = easMaterialId== null ? null : easMaterialId.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    public BigDecimal getMaterialTheoreticalWeight() {
+        return materialTheoreticalWeight;
+    }
+
+    public void setMaterialTheoreticalWeight(BigDecimal materialTheoreticalWeight) {
+        this.materialTheoreticalWeight = materialTheoreticalWeight;
+    }
+
+    public BigDecimal getMaterialOrder() {
+        return materialOrder;
+    }
+
+    public void setMaterialOrder(BigDecimal materialOrder) {
+        this.materialOrder = materialOrder;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", materialId=").append(materialId);
+        sb.append(", materialTypeId=").append(materialTypeId);
+        sb.append(", unitOfMeasureId=").append(unitOfMeasureId);
+        sb.append(", materialCode=").append(materialCode);
+        sb.append(", materialName=").append(materialName);
+        sb.append(", materialSpecification=").append(materialSpecification);
+        sb.append(", materialModel=").append(materialModel);
+        sb.append(", materialLength=").append(materialLength);
+        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(", easMaterialId=").append(easMaterialId);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", materialTheoreticalWeight=").append(materialTheoreticalWeight);
+        sb.append(", materialOrder=").append(materialOrder);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 243 - 0
src/main/java/com/steerinfo/dil/model/RmsWarehouse.java

@@ -0,0 +1,243 @@
+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 RmsWarehouse implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(WAREHOUSE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal warehouseId;
+
+    /**
+     * 仓库类型ID(WAREHOUSE_TYPE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="仓库类型ID",required=false)
+    private BigDecimal warehouseTypeId;
+
+    /**
+     * 港存库所属港口ID(PORT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="港存库所属港口ID",required=false)
+    private BigDecimal portId;
+
+    /**
+     * 仓库名称(一棒库,二棒库,高线库,配送库,某某港的港存库)(WAREHOUSE_NAME,VARCHAR,50)
+     */
+    @ApiModelProperty(value="仓库名称(一棒库,二棒库,高线库,配送库,某某港的港存库)",required=false)
+    private String warehouseName;
+
+    /**
+     * 仓库容量(WAREHOUSE_CAPACITY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="仓库容量",required=false)
+    private BigDecimal warehouseCapacity;
+
+    /**
+     * 仓库经度(WAREHOUSE_LONGITUDE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="仓库经度",required=false)
+    private String warehouseLongitude;
+
+    /**
+     * 仓库纬度(WAREHOUSE_LATITUDE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="仓库纬度",required=false)
+    private String warehouseLatitude;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 逻辑删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    /*
+     * 托运人Id
+     * */
+    @ApiModelProperty(value = "托运人",required = false)
+    private BigDecimal shipperId;
+
+    public BigDecimal getShipperId() {
+        return shipperId;
+    }
+
+    public void setShipperId(BigDecimal shipperId) {
+        this.shipperId = shipperId;
+    }
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.warehouseId;
+    }
+
+    @Override
+    public void setId(BigDecimal warehouseId) {
+        this.warehouseId = warehouseId;
+    }
+
+    public BigDecimal getWarehouseId() {
+        return warehouseId;
+    }
+
+    public void setWarehouseId(BigDecimal warehouseId) {
+        this.warehouseId = warehouseId;
+    }
+
+    public BigDecimal getWarehouseTypeId() {
+        return warehouseTypeId;
+    }
+
+    public void setWarehouseTypeId(BigDecimal warehouseTypeId) {
+        this.warehouseTypeId = warehouseTypeId;
+    }
+
+    public BigDecimal getPortId() {
+        return portId;
+    }
+
+    public void setPortId(BigDecimal portId) {
+        this.portId = portId;
+    }
+
+    public String getWarehouseName() {
+        return warehouseName;
+    }
+
+    public void setWarehouseName(String warehouseName) {
+        this.warehouseName = warehouseName == null ? null : warehouseName.trim();
+    }
+
+    public BigDecimal getWarehouseCapacity() {
+        return warehouseCapacity;
+    }
+
+    public void setWarehouseCapacity(BigDecimal warehouseCapacity) {
+        this.warehouseCapacity = warehouseCapacity;
+    }
+
+    public String getWarehouseLongitude() {
+        return warehouseLongitude;
+    }
+
+    public void setWarehouseLongitude(String warehouseLongitude) {
+        this.warehouseLongitude = warehouseLongitude == null ? null : warehouseLongitude.trim();
+    }
+
+    public String getWarehouseLatitude() {
+        return warehouseLatitude;
+    }
+
+    public void setWarehouseLatitude(String warehouseLatitude) {
+        this.warehouseLatitude = warehouseLatitude == null ? null : warehouseLatitude.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", warehouseId=").append(warehouseId);
+        sb.append(", warehouseTypeId=").append(warehouseTypeId);
+        sb.append(", portId=").append(portId);
+        sb.append(", warehouseName=").append(warehouseName);
+        sb.append(", warehouseCapacity=").append(warehouseCapacity);
+        sb.append(", warehouseLongitude=").append(warehouseLongitude);
+        sb.append(", warehouseLatitude=").append(warehouseLatitude);
+        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();
+    }
+}

+ 55 - 5
src/main/java/com/steerinfo/dil/service/impl/TmstruckLoadResultServiceImpl.java

@@ -72,6 +72,11 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
     @Autowired
     private TmstruckUnloadResultMapper tmstruckUnloadResultMapper;
 
+    @Autowired
+    private RmsMaterialMapper rmsMaterialMapper;
+
+    @Autowired
+    private RmsWarehouseMapper rmsWarehouseMapper;
 
     /**
      * 生成销售装车实绩(虚拟装车实绩)
@@ -807,15 +812,60 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int updateLoadingIdRemark(Map<String, Object> map) {
+        System.out.println(map);
+        if(map.get("processNo") != null) {
+            //当flag不为null时,说明该流程是由计量走向物流
+            if(map.get("orderNumber") == null || map.get("materialName") == null || map.get("unloadName") == null
+            || map.get("loadName") == null)
+            {
+                return -1;
+            }
+            Map<String,Object> orderMes = tmstruckUnloadResultMapper.getOrderType(map.get("orderNumber").toString().trim());
+            if(orderMes == null){
+                return -1;
+            }
+            map.putAll(orderMes);
+            //根据物资名称
+            BigDecimal materialId = tmstruckUnloadResultMapper.selectMaterialId(map.get("materialName").toString().trim());
+            if(materialId == null) {
+                RmsMaterial rmsMaterial = new RmsMaterial();
+                materialId = rmsMaterialMapper.getMaterialId();
+                rmsMaterial.setMaterialId(materialId);
+                rmsMaterial.setMaterialName(map.get("materialName").toString().trim());
+                rmsMaterial.setInsertUpdateRemark("计量联动新增,流程号:" + map.get("processNo"));
+                rmsMaterialMapper.insertSelective(rmsMaterial);
+            }
+            map.put("materialId",materialId);
+            BigDecimal unloadingId = tmstruckUnloadResultMapper.selectWarehouseId(map.get("unloadName").toString().trim());
+            if(unloadingId == null) {
+                RmsWarehouse rmsWarehouse = new RmsWarehouse();
+                unloadingId = rmsWarehouseMapper.selectWarehouseId();
+                rmsWarehouse.setWarehouseId(unloadingId);
+                rmsWarehouse.setWarehouseName(map.get("unloadName").toString().trim());
+                rmsWarehouse.setInsertUpdateRemark("计量联动新增,流程号:" + map.get("processNo"));
+                rmsWarehouseMapper.insertSelective(rmsWarehouse);
+            }
+            map.put("unloadingId",unloadingId);
+            BigDecimal loadingId = tmstruckUnloadResultMapper.selectWarehouseId(map.get("loadName").toString().trim());
+            if(loadingId == null) {
+                RmsWarehouse rmsWarehouse = new RmsWarehouse();
+                loadingId = rmsWarehouseMapper.selectWarehouseId();
+                rmsWarehouse.setWarehouseId(loadingId);
+                rmsWarehouse.setWarehouseName(map.get("loadName").toString().trim());
+                rmsWarehouse.setInsertUpdateRemark("计量联动新增,流程号:" + map.get("processNo"));
+                rmsWarehouseMapper.insertSelective(rmsWarehouse);
+            }
+            map.put("loadingId",loadingId);
+        }
         if(DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 11 || DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 15 || DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 16) {
             //如果是内转计重订单,则需要先寻找需求/计划进行替换
             BigDecimal orderPlanId = tmstruckLoadResultMapper.selectInwardOrderPlanId(map);
-            if(orderPlanId == null) {
-                return 11;
+            if(orderPlanId != null ) {
+                map.put("orderPlanId",orderPlanId);
+                tmstruckLoadResultMapper.updateOOOrderPlanId(map);
+                tmstruckLoadResultMapper.updateOOMaterialId(map);
             }
-            map.put("orderPlanId",orderPlanId);
-            tmstruckLoadResultMapper.updateOOOrderPlanId(map);
-            tmstruckLoadResultMapper.updateOOMaterialId(map);
+
         }
         if(DataChange.dataToBigDecimal(map.get("orderType")).intValue() == 21) {
             //如果是内转计重订单,则需要先寻找需求/计划进行替换

+ 533 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsMaterialMapper.xml

@@ -0,0 +1,533 @@
+<?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.RmsMaterialMapper">
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsMaterial">
+        <id column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId"/>
+        <result column="MATERIAL_TYPE_ID" jdbcType="DECIMAL" property="materialTypeId"/>
+        <result column="UNIT_OF_MEASURE_ID" jdbcType="DECIMAL" property="unitOfMeasureId"/>
+        <result column="MATERIAL_CODE" jdbcType="VARCHAR" property="materialCode"/>
+        <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName"/>
+        <result column="MATERIAL_SPECIFICATION" jdbcType="VARCHAR" property="materialSpecification"/>
+        <result column="MATERIAL_MODEL" jdbcType="VARCHAR" property="materialModel"/>
+        <result column="MATERIAL_LENGTH" jdbcType="DECIMAL" property="materialLength"/>
+        <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="EAS_MATERIAL_ID" jdbcType="VARCHAR" property="easMaterialId"/>
+        <result column="DELETED" jdbcType="DECIMAL" property="deleted"/>
+        <result column="MATERIAL_THEORETICAL_WEIGHT" jdbcType="DECIMAL" property="materialTheoreticalWeight"/>
+        <result column="MATERIAL_ORDER" jdbcType="DECIMAL" property="materialOrder"/>
+
+    </resultMap>
+    <sql id="columns">
+        MATERIAL_ID, MATERIAL_TYPE_ID, UNIT_OF_MEASURE_ID, MATERIAL_CODE, MATERIAL_NAME,
+    MATERIAL_SPECIFICATION, MATERIAL_MODEL, MATERIAL_LENGTH, INSERT_USERNAME, INSERT_TIME, 
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_MATERIAL_ID, DELETED,MATERIAL_THEORETICAL_WEIGHT,MATERIAL_ORDER
+    </sql>
+    <sql id="columns_alias">
+        t.MATERIAL_ID, t.MATERIAL_TYPE_ID, t.UNIT_OF_MEASURE_ID, t.MATERIAL_CODE, t.MATERIAL_NAME,
+    t.MATERIAL_SPECIFICATION, t.MATERIAL_MODEL, t.MATERIAL_LENGTH, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.EAS_MATERIAL_ID, 
+    t.DELETED,t.MATERIAL_THEORETICAL_WEIGHT,t.MATERIAL_ORDER
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM RMS_MATERIAL
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM RMS_MATERIAL t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="materialId != null">
+                and MATERIAL_ID = #{materialId}
+            </if>
+            <if test="materialTypeId != null">
+                and MATERIAL_TYPE_ID = #{materialTypeId}
+            </if>
+            <if test="unitOfMeasureId != null">
+                and UNIT_OF_MEASURE_ID = #{unitOfMeasureId}
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE = #{materialCode}
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME = #{materialName}
+            </if>
+            <if test="materialSpecification != null and materialSpecification != ''">
+                and MATERIAL_SPECIFICATION = #{materialSpecification}
+            </if>
+            <if test="materialModel != null and materialModel != ''">
+                and MATERIAL_MODEL = #{materialModel}
+            </if>
+            <if test="materialLength != null">
+                and MATERIAL_LENGTH = #{materialLength}
+            </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="easMaterialId != null">
+                and EAS_MATERIAL_ID = #{easMaterialId}
+            </if>
+            <if test="deleted != null">
+                and DELETED = #{deleted}
+            </if>
+            <if test="materialTheoreticalWeight !=null">
+                and MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+            </if>
+             <if test="materialOrder !=null">
+                 and MATERIAL_ORDER = #{materialOrder}
+             </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="materialId != null">
+                and MATERIAL_ID = #{materialId}
+            </if>
+            <if test="materialTypeId != null">
+                and MATERIAL_TYPE_ID = #{materialTypeId}
+            </if>
+            <if test="unitOfMeasureId != null">
+                and UNIT_OF_MEASURE_ID = #{unitOfMeasureId}
+            </if>
+            <if test="materialCode != null and materialCode != ''">
+                and MATERIAL_CODE LIKE '%${materialCode}%'
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and MATERIAL_NAME LIKE '%${materialName}%'
+            </if>
+            <if test="materialSpecification != null and materialSpecification != ''">
+                and MATERIAL_SPECIFICATION LIKE '%${materialSpecification}%'
+            </if>
+            <if test="materialModel != null and materialModel != ''">
+                and MATERIAL_MODEL LIKE '%${materialModel}%'
+            </if>
+            <if test="materialLength != null">
+                and MATERIAL_LENGTH = #{materialLength}
+            </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="easMaterialId != null">
+                and EAS_MATERIAL_ID = #{easMaterialId}
+            </if>
+            <if test="deleted != null">
+                and DELETED = #{deleted}
+            </if>
+            <if test="materialTheoreticalWeight !=null">
+                and MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+            </if>
+            <if test="MATERIAL_ORDER !=null">
+                and MATERIAL_ORDER = #{materialOrder}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+        delete
+        from RMS_MATERIAL
+        where MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from RMS_MATERIAL
+        where 1!=1
+        <if test="materialTypeId != null">
+            or MATERIAL_TYPE_ID = #{materialTypeId}
+        </if>
+        <if test="unitOfMeasureId != null">
+            or UNIT_OF_MEASURE_ID = #{unitOfMeasureId}
+        </if>
+        <if test="materialCode != null and materialCode != ''">
+            or MATERIAL_CODE = #{materialCode}
+        </if>
+        <if test="materialName != null and materialName != ''">
+            or MATERIAL_NAME = #{materialName}
+        </if>
+        <if test="materialSpecification != null and materialSpecification != ''">
+            or MATERIAL_SPECIFICATION = #{materialSpecification}
+        </if>
+        <if test="materialModel != null and materialModel != ''">
+            or MATERIAL_MODEL = #{materialModel}
+        </if>
+        <if test="materialLength != null">
+            or MATERIAL_LENGTH = #{materialLength}
+        </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="easMaterialId != null">
+            or EAS_MATERIAL_ID = #{easMaterialId}
+        </if>
+        <if test="deleted != null">
+            or DELETED = #{deleted}
+        </if>
+        <if test="materialTheoreticalWeight != null and materialTheoreticalWeight !=''">
+            or MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight}
+        </if>
+        <if test="materialOrder != null and materialOrder = ''" >
+            or MATERIAL_ORDER = #{materialOrder}
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.RmsMaterial">
+        insert into RMS_MATERIAL (MATERIAL_ID, MATERIAL_TYPE_ID, UNIT_OF_MEASURE_ID,
+                                  MATERIAL_CODE, MATERIAL_NAME, MATERIAL_SPECIFICATION,
+                                  MATERIAL_MODEL, MATERIAL_LENGTH, INSERT_USERNAME,
+                                  INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+                                  INSERT_UPDATE_REMARK, EAS_MATERIAL_ID, DELETED,MATERIAL_THEORETICAL_WEIGHT,MATERIAL_ORDER)
+        values (#{materialId,jdbcType=DECIMAL}, #{materialTypeId,jdbcType=DECIMAL}, #{unitOfMeasureId,jdbcType=DECIMAL},
+                #{materialCode,jdbcType=VARCHAR}, #{materialName,jdbcType=VARCHAR},
+                #{materialSpecification,jdbcType=VARCHAR},
+                #{materialModel,jdbcType=VARCHAR}, #{materialLength,jdbcType=DECIMAL},
+                #{insertUsername,jdbcType=VARCHAR},
+                #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
+                #{insertUpdateRemark,jdbcType=VARCHAR}, #{easMaterialId,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
+                 #{materialTheoreticalWeight,jdbcType=DECIMAL},#{materialOrder,jdbcType=DECIMAL} )
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsMaterial">
+        insert into RMS_MATERIAL
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="materialId != null">
+                MATERIAL_ID,
+            </if>
+            <if test="materialTypeId != null">
+                MATERIAL_TYPE_ID,
+            </if>
+            <if test="unitOfMeasureId != null">
+                UNIT_OF_MEASURE_ID,
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE,
+            </if>
+            <if test="materialName != null">
+                MATERIAL_NAME,
+            </if>
+            <if test="materialSpecification != null">
+                MATERIAL_SPECIFICATION,
+            </if>
+            <if test="materialModel != null">
+                MATERIAL_MODEL,
+            </if>
+            <if test="materialLength != null">
+                MATERIAL_LENGTH,
+            </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="easMaterialId != null">
+                EAS_MATERIAL_ID,
+            </if>
+            <if test="deleted != null">
+                DELETED,
+            </if>
+            <if test="materialTheoreticalWeight !=null">
+                 MATERIAL_THEORETICAL_WEIGHT,
+            </if>
+            <if test="materialOrder !=null">
+                 MATERIAL_ORDER,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="materialId != null">
+                #{materialId,jdbcType=DECIMAL},
+            </if>
+            <if test="materialTypeId != null">
+                #{materialTypeId,jdbcType=DECIMAL},
+            </if>
+            <if test="unitOfMeasureId != null">
+                #{unitOfMeasureId,jdbcType=DECIMAL},
+            </if>
+            <if test="materialCode != null">
+                #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialSpecification != null">
+                #{materialSpecification,jdbcType=VARCHAR},
+            </if>
+            <if test="materialModel != null">
+                #{materialModel,jdbcType=VARCHAR},
+            </if>
+            <if test="materialLength != null">
+                #{materialLength,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="easMaterialId != null">
+                #{easMaterialId,jdbcType=VARCHAR},
+            </if>
+            <if test="deleted != null">
+                #{deleted,jdbcType=DECIMAL},
+            </if>
+            <if test="materialTheoreticalWeight !=null">
+                #{materialTheoreticalWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="materialOrder !=null">
+                 #{materialOrder,jdbcType=DECIMAL},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsMaterial">
+        update RMS_MATERIAL
+        set MATERIAL_TYPE_ID       = #{materialTypeId,jdbcType=DECIMAL},
+            UNIT_OF_MEASURE_ID     = #{unitOfMeasureId,jdbcType=DECIMAL},
+            MATERIAL_CODE          = #{materialCode,jdbcType=VARCHAR},
+            MATERIAL_NAME          = #{materialName,jdbcType=VARCHAR},
+            MATERIAL_SPECIFICATION = #{materialSpecification,jdbcType=VARCHAR},
+            MATERIAL_MODEL         = #{materialModel,jdbcType=VARCHAR},
+            MATERIAL_LENGTH        = #{materialLength,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},
+            EAS_MATERIAL_ID        = #{easMaterialId,jdbcType=VARCHAR},
+            DELETED                = #{deleted,jdbcType=DECIMAL},
+            MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight,jdbcType=DECIMAL},
+            MATERIAL_ORDER         = #{MATERIAL_ORDER}
+        where MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsMaterial">
+        update RMS_MATERIAL
+        <set>
+            <if test="materialTypeId != null">
+                MATERIAL_TYPE_ID = #{materialTypeId,jdbcType=DECIMAL},
+            </if>
+            <if test="unitOfMeasureId != null">
+                UNIT_OF_MEASURE_ID = #{unitOfMeasureId,jdbcType=DECIMAL},
+            </if>
+            <if test="materialCode != null">
+                MATERIAL_CODE = #{materialCode,jdbcType=VARCHAR},
+            </if>
+            <if test="materialName != null">
+                MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
+            </if>
+            <if test="materialSpecification != null">
+                MATERIAL_SPECIFICATION = #{materialSpecification,jdbcType=VARCHAR},
+            </if>
+            <if test="materialModel != null">
+                MATERIAL_MODEL = #{materialModel,jdbcType=VARCHAR},
+            </if>
+            <if test="materialLength != null">
+                MATERIAL_LENGTH = #{materialLength,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="easMaterialId != null">
+                EAS_MATERIAL_ID = #{easMaterialId,jdbcType=VARCHAR},
+            </if>
+            <if test="deleted != null">
+                DELETED = #{deleted,jdbcType=DECIMAL},
+            </if>
+            <if test="materialTheoreticalWeight != null ">
+                 MATERIAL_THEORETICAL_WEIGHT = #{materialTheoreticalWeight,jdbcType=DECIMAL},
+            </if>
+            <if test="materialOrder != null " >
+                 MATERIAL_ORDER = #{materialOrder,jdbcType=DECIMAL},
+            </if>
+        </set>
+        where MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where MATERIAL_ID = #{materialId,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 RMS_MATERIAL
+        (MATERIAL_ID,
+        MATERIAL_TYPE_ID, UNIT_OF_MEASURE_ID,
+        MATERIAL_CODE, MATERIAL_NAME, MATERIAL_SPECIFICATION,
+        MATERIAL_MODEL, MATERIAL_LENGTH,
+        INSERT_USERNAME, INSERT_TIME,
+        UPDATE_USERNAME, UPDATE_TIME,
+        INSERT_UPDATE_REMARK, EAS_MATERIAL_ID,
+        DELETED, MATERIAL_THEORETICAL_WEIGHT,MATERIAL_ORDER)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.materialId,jdbcType=DECIMAL},
+        #{item.materialTypeId,jdbcType=DECIMAL}, #{item.unitOfMeasureId,jdbcType=DECIMAL},
+        #{item.materialCode,jdbcType=VARCHAR}, #{item.materialName,jdbcType=VARCHAR},
+        #{item.materialSpecification,jdbcType=VARCHAR},
+        #{item.materialModel,jdbcType=VARCHAR}, #{item.materialLength,jdbcType=DECIMAL},
+        #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
+        #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
+        #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.easMaterialId,jdbcType=VARCHAR},
+        #{item.deleted,jdbcType=DECIMAL},#{item.materialTheoreticalWeight,jdbcType=DECIMAL},
+        #{item.materialOrder,jdbcType=DECIMAL}
+        from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update RMS_MATERIAL
+        set
+        MATERIAL_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
+        </foreach>
+        ,MATERIAL_TYPE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialTypeId,jdbcType=DECIMAL}
+        </foreach>
+        ,UNIT_OF_MEASURE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.unitOfMeasureId,jdbcType=DECIMAL}
+        </foreach>
+        ,MATERIAL_CODE=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialCode,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_NAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialName,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_SPECIFICATION=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialSpecification,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_MODEL=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialModel,jdbcType=VARCHAR}
+        </foreach>
+        ,MATERIAL_LENGTH=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.materialLength,jdbcType=DECIMAL}
+        </foreach>
+        ,INSERT_USERNAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,INSERT_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_USERNAME=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,INSERT_UPDATE_REMARK=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+        </foreach>
+        ,EAS_MATERIAL_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.easMaterialId,jdbcType=VARCHAR}
+        </foreach>
+        ,DELETED=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+        </foreach>
+        ,MATERIAL_THEORETICAL_WEIGHT=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+        </foreach>
+        ,MATERIAL_ORDER=
+        <foreach close="end" collection="list" index="index" item="item" open="case MATERIAL_ID" separator=" ">
+            when #{item.materialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+        </foreach>
+        where MATERIAL_ID in
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+            #{item.materialId,jdbcType=DECIMAL}
+        </foreach>
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from RMS_MATERIAL
+        where MATERIAL_ID in
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <!-- 展示物资信息 -->
+</mapper>

+ 446 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsWarehouseMapper.xml

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

+ 24 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -1107,5 +1107,29 @@
         where TUR.RESULT_TOTAL_ID = #{resultTotalId}
           and  TUR.MATERIAL_ID = #{materialId}
     </select>
+    <select id="getOrderType" resultType="java.util.Map" parameterType="string">
+        SELECT OO.ORDER_TYPE "orderType",
+               OO.ORDER_ID "orderId",
+               TTR.RESULT_TOTAL_ID "resultTotalId",
+               TWR.WEIGHT_TASK_RESULT_ID "weightTaskId",
+               TUR.RESULT_ID    "unloadResultId",
+               TLR.RESULT_ID    "loadResultId"
+        FROM OMSTRUCK_ORDER OO
+        LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR on OO.ORDER_ID = TTR.ORDER_ID
+        LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
+        LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR on TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
+        LEFT JOIN TMSTRUCK_LOAD_RESULT TLR on TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
+        WHERE OO.ORDER_NUMBER = #{orderNumber}
+    </select>
+    <select id="selectMaterialId" resultType="java.math.BigDecimal" parameterType="string">
+        SELECT RM.MATERIAL_ID FROM RMS_MATERIAL RM
+        WHERE RM.MATERIAL_NAME = #{materialName}
+        FETCH FIRST 1 ROW ONLY
+    </select>
+    <select id="selectWarehouseId" resultType="java.math.BigDecimal" parameterType="string">
+        SELECT RW.WAREHOUSE_ID FROM RMS_WAREHOUSE RW
+        WHERE RW.WAREHOUSE_NAME = #{warehouseName}
+        FETCH FIRST 1 ROW ONLY
+    </select>
 
 </mapper>

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

@@ -152,7 +152,7 @@
                  select OOM.MATERIAL_ID
                  from OMSTRUCK_ORDER_MATERIAL OOM
                  where OOM.ORDER_ID = #{orderId}
-                 order by OOM.MATERIAL_DIRECTION
+                 order by OOM.MATERIAL_PRIORITY
              )
         where rownum = 1
     </select>