Explorar o código

'修改船运输入字段'

HUJIANGUO %!s(int64=3) %!d(string=hai) anos
pai
achega
b28c49e052

+ 4 - 4
pom.xml

@@ -107,9 +107,9 @@
                 <artifactId>generator-maven-plugin</artifactId>
                 <version>3.0</version>
                 <configuration>
-                    <connUrl>jdbc:oracle:thin:@192.168.1.51:1521:steerinfo</connUrl>
-                    <user>dilusr</user>
-                    <password>stinf#0420</password>
+                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
+                    <user>dil</user>
+                    <password>Dil123789</password>
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
@@ -132,7 +132,7 @@
                         <!--<table>TRANSPORT_ORDER_PROGRESS</table>-->
 <!--                        <table>TMSSHIP_WATER_QUALITY_RESULT</table>-->
 <!--                        <table>OMSSHIP_INSTRUCTIONS_CAPACITY</table>-->
-                        <table>WMSH_OUTBOUND_RESULT</table>
+                        <table>RMS_CAPACITY</table>
 <!--                        <table>TMSSHIP_BARGE_OPERATION</table>-->
 <!--                        <table>TMSSHIP_LOAD_SHIP_RESULT</table>-->
 <!--                        <table>TMSSHIP_SHIP_LOCATION</table>-->

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

@@ -95,7 +95,7 @@ public class OmsshipInstructionsCapacityController extends BaseRESTfulController
     @ApiOperation(value="新增", notes="根据OmsshipInstructionsCapacity对象创建")
     @ApiImplicitParam(name = "omsshipInstructionsCapacity", value = "详细实体omsshipInstructionsCapacity", required = true, dataType = "OmsshipInstructionsCapacity")
     @PostMapping(value = "/addInstructionsCapacity")
-    public RESTfulResult addInstructionsCapacity(@RequestBody OmsshipInstructionsCapacity omsshipInstructionsCapacity){
+    public RESTfulResult addInstructionsCapacity(@RequestBody Map<String,Object> omsshipInstructionsCapacity){
         int code=omsshipInstructionsCapacityService.insert(omsshipInstructionsCapacity);
         return success(code);
     }

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/OmsshipShipmentInstructionsMapper.java

@@ -23,4 +23,7 @@ public interface OmsshipShipmentInstructionsMapper extends IBaseMapper<OmsshipSh
 
     @Select("select seq_OMSSHIP_SHIPMENT.nextval from dual")
     BigDecimal selectInstructionId();
+
+    // 通过批次查询上游港口和下游码头
+    Map<String, Object> getPortAndPier(BigDecimal batchId);
 }

+ 15 - 0
src/main/java/com/steerinfo/dil/mapper/RmsCapacityMapper.java

@@ -0,0 +1,15 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsCapacity;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface RmsCapacityMapper extends IBaseMapper<RmsCapacity, Short> {
+
+    @Select("select seq__RMS_CAPACITY.nextval from dual")
+    BigDecimal selectCapacityId();
+}

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/TmsshipLoadShipResultMapper.java

@@ -53,4 +53,7 @@ public interface TmsshipLoadShipResultMapper extends IBaseMapper<TmsshipLoadShip
 
     @Select("select seq_TMSSHIP_LOAD.nextval from dual")
     BigDecimal selectLoadId();
+
+    // 得到码头和港口
+    Map<String, Object> getPortAndPier(BigDecimal batchId);
 }

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

@@ -4,6 +4,7 @@ import com.steerinfo.dil.model.TmsshipShipLocation;
 import com.steerinfo.dil.model.TmsshipWaterQualityResult;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import java.math.*;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -57,4 +58,7 @@ public interface TmsshipWaterQualityResultMapper extends IBaseMapper<TmsshipWate
 
     @Select("select seq_TMSSHIP_QUALITY.nextval from dual")
     BigDecimal selectQualityId();
+
+    // 得到放货日期
+    Date getDeliveryDate(BigDecimal orderId);
 }

+ 379 - 0
src/main/java/com/steerinfo/dil/model/RmsCapacity.java

@@ -0,0 +1,379 @@
+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 RmsCapacity implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(CAPACITY_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal capacityId;
+
+    /**
+     * 运力编号(CAPACITY_NUMBER,VARCHAR,32)
+     */
+    @ApiModelProperty(value="运力编号",required=false)
+    private String capacityNumber;
+
+    /**
+     * 运力额定载重(CAPACITY_MAX_LOAD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运力额定载重",required=false)
+    private BigDecimal capacityMaxLoad;
+
+    /**
+     * 运力类型ID(CAPACITY_TYPE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运力类型ID",required=false)
+    private BigDecimal capacityTypeId;
+
+    /**
+     * 运力状态(0:空闲中、1:运输中:2:待运中:3:维保中)(CAPACITY_STATUS,DECIMAL,20)
+     */
+    @ApiModelProperty(value="运力状态(0:空闲中、1:运输中:2:待运中:3:维保中)",required=false)
+    private BigDecimal capacityStatus;
+
+    /**
+     * 承运单位(CARRIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="承运单位",required=false)
+    private BigDecimal carrierId;
+
+    /**
+     * 能源名称(CAPACITY_ENERGY_ID,VARCHAR,16)
+     */
+    @ApiModelProperty(value="能源名称",required=false)
+    private String capacityEnergyId;
+
+    /**
+     * 可载长度上限(M)(CAPACITY_LEN_VAL,DECIMAL,0)
+     */
+    @ApiModelProperty(value="可载长度上限(M)",required=false)
+    private BigDecimal capacityLenVal;
+
+    /**
+     * 可载宽度上限(M)(CAPACITY_WID_VAL,DECIMAL,0)
+     */
+    @ApiModelProperty(value="可载宽度上限(M)",required=false)
+    private BigDecimal capacityWidVal;
+
+    /**
+     * 可载高度上限(M)(CAPACITY_HIG_VAL,DECIMAL,0)
+     */
+    @ApiModelProperty(value="可载高度上限(M)",required=false)
+    private BigDecimal capacityHigVal;
+
+    /**
+     * 油品代码(CAPACITY_OIL_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油品代码",required=false)
+    private BigDecimal capacityOilId;
+
+    /**
+     * 油耗(升/100公里)(CAPACITY_FUEL_CONSUMPTION,VARCHAR,16)
+     */
+    @ApiModelProperty(value="油耗(升/100公里)",required=false)
+    private String capacityFuelConsumption;
+
+    /**
+     * 是否自有车辆(0:是;1:不是)(CAPACITY_OWNERIS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否自有车辆(0:是;1:不是)",required=false)
+    private BigDecimal capacityOwneris;
+
+    /**
+     * 运力是否黑名单(0:是;1:不是)(CAPACITY_BLACKLIST,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运力是否黑名单(0:是;1:不是)",required=false)
+    private BigDecimal capacityBlacklist;
+
+    /**
+     * 备注(MEMO,VARCHAR,128)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String memo;
+
+    /**
+     * 记录创建人(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;
+
+    /**
+     * 车牌颜色(CAPACITY_CORLOR,VARCHAR,20)
+     */
+    @ApiModelProperty(value="车牌颜色",required=false)
+    private String capacityCorlor;
+
+    /**
+     * 是否VIP(CAPACITY_VIP,VARCHAR,20)
+     */
+    @ApiModelProperty(value="是否VIP",required=false)
+    private String capacityVip;
+
+    /**
+     * 逻辑删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.capacityId;
+    }
+
+    @Override
+    public void setId(BigDecimal capacityId) {
+        this.capacityId = capacityId;
+    }
+
+    public BigDecimal getCapacityId() {
+        return capacityId;
+    }
+
+    public void setCapacityId(BigDecimal capacityId) {
+        this.capacityId = capacityId;
+    }
+
+    public String getCapacityNumber() {
+        return capacityNumber;
+    }
+
+    public void setCapacityNumber(String capacityNumber) {
+        this.capacityNumber = capacityNumber == null ? null : capacityNumber.trim();
+    }
+
+    public BigDecimal getCapacityMaxLoad() {
+        return capacityMaxLoad;
+    }
+
+    public void setCapacityMaxLoad(BigDecimal capacityMaxLoad) {
+        this.capacityMaxLoad = capacityMaxLoad;
+    }
+
+    public BigDecimal getCapacityTypeId() {
+        return capacityTypeId;
+    }
+
+    public void setCapacityTypeId(BigDecimal capacityTypeId) {
+        this.capacityTypeId = capacityTypeId;
+    }
+
+    public BigDecimal getCapacityStatus() {
+        return capacityStatus;
+    }
+
+    public void setCapacityStatus(BigDecimal capacityStatus) {
+        this.capacityStatus = capacityStatus;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
+    public String getCapacityEnergyId() {
+        return capacityEnergyId;
+    }
+
+    public void setCapacityEnergyId(String capacityEnergyId) {
+        this.capacityEnergyId = capacityEnergyId == null ? null : capacityEnergyId.trim();
+    }
+
+    public BigDecimal getCapacityLenVal() {
+        return capacityLenVal;
+    }
+
+    public void setCapacityLenVal(BigDecimal capacityLenVal) {
+        this.capacityLenVal = capacityLenVal;
+    }
+
+    public BigDecimal getCapacityWidVal() {
+        return capacityWidVal;
+    }
+
+    public void setCapacityWidVal(BigDecimal capacityWidVal) {
+        this.capacityWidVal = capacityWidVal;
+    }
+
+    public BigDecimal getCapacityHigVal() {
+        return capacityHigVal;
+    }
+
+    public void setCapacityHigVal(BigDecimal capacityHigVal) {
+        this.capacityHigVal = capacityHigVal;
+    }
+
+    public BigDecimal getCapacityOilId() {
+        return capacityOilId;
+    }
+
+    public void setCapacityOilId(BigDecimal capacityOilId) {
+        this.capacityOilId = capacityOilId;
+    }
+
+    public String getCapacityFuelConsumption() {
+        return capacityFuelConsumption;
+    }
+
+    public void setCapacityFuelConsumption(String capacityFuelConsumption) {
+        this.capacityFuelConsumption = capacityFuelConsumption == null ? null : capacityFuelConsumption.trim();
+    }
+
+    public BigDecimal getCapacityOwneris() {
+        return capacityOwneris;
+    }
+
+    public void setCapacityOwneris(BigDecimal capacityOwneris) {
+        this.capacityOwneris = capacityOwneris;
+    }
+
+    public BigDecimal getCapacityBlacklist() {
+        return capacityBlacklist;
+    }
+
+    public void setCapacityBlacklist(BigDecimal capacityBlacklist) {
+        this.capacityBlacklist = capacityBlacklist;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo == null ? null : memo.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 String getCapacityCorlor() {
+        return capacityCorlor;
+    }
+
+    public void setCapacityCorlor(String capacityCorlor) {
+        this.capacityCorlor = capacityCorlor == null ? null : capacityCorlor.trim();
+    }
+
+    public String getCapacityVip() {
+        return capacityVip;
+    }
+
+    public void setCapacityVip(String capacityVip) {
+        this.capacityVip = capacityVip == null ? null : capacityVip.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(", capacityId=").append(capacityId);
+        sb.append(", capacityNumber=").append(capacityNumber);
+        sb.append(", capacityMaxLoad=").append(capacityMaxLoad);
+        sb.append(", capacityTypeId=").append(capacityTypeId);
+        sb.append(", capacityStatus=").append(capacityStatus);
+        sb.append(", carrierId=").append(carrierId);
+        sb.append(", capacityEnergyId=").append(capacityEnergyId);
+        sb.append(", capacityLenVal=").append(capacityLenVal);
+        sb.append(", capacityWidVal=").append(capacityWidVal);
+        sb.append(", capacityHigVal=").append(capacityHigVal);
+        sb.append(", capacityOilId=").append(capacityOilId);
+        sb.append(", capacityFuelConsumption=").append(capacityFuelConsumption);
+        sb.append(", capacityOwneris=").append(capacityOwneris);
+        sb.append(", capacityBlacklist=").append(capacityBlacklist);
+        sb.append(", memo=").append(memo);
+        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(", capacityCorlor=").append(capacityCorlor);
+        sb.append(", capacityVip=").append(capacityVip);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 1 - 1
src/main/java/com/steerinfo/dil/service/IOmsshipInstructionsCapacityService.java

@@ -39,7 +39,7 @@ public interface IOmsshipInstructionsCapacityService{
      * @param omsshipInstructionsCapacity
      * @return
      */
-    int insert(OmsshipInstructionsCapacity omsshipInstructionsCapacity);
+    int insert(Map<String,Object> omsshipInstructionsCapacity);
 
     /**
      * 根据主键删除

+ 48 - 9
src/main/java/com/steerinfo/dil/service/impl/OmsshipInstructionsCapacityServiceImpl.java

@@ -1,12 +1,17 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.OmsshipInstructionsCapacityMapper;
+import com.steerinfo.dil.mapper.RmsCapacityMapper;
 import com.steerinfo.dil.model.OmsshipInstructionsCapacity;
+import com.steerinfo.dil.model.RmsCapacity;
 import com.steerinfo.dil.service.IOmsshipInstructionsCapacityService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import java.util.Date;
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -29,6 +34,9 @@ public class OmsshipInstructionsCapacityServiceImpl implements IOmsshipInstructi
     @Autowired
     OmsshipInstructionsCapacityMapper omsshipInstructionsCapacityMapper;
 
+    @Autowired
+    RmsCapacityMapper rmsCapacityMapper;
+
 
     @Override
     public List<Map<String, Object>> getOrderId() {
@@ -49,17 +57,48 @@ public class OmsshipInstructionsCapacityServiceImpl implements IOmsshipInstructi
      * @param omsshipInstructionsCapacity
      * @return
      */
+    @Transactional
     @Override
-    public int insert(OmsshipInstructionsCapacity omsshipInstructionsCapacity) {
-        omsshipInstructionsCapacity.setInstructionsCapacityId(omsshipInstructionsCapacityMapper.selectInstructionCapacityId());
+    public int insert(Map<String,Object> omsshipInstructionsCapacity) {
+        String capacityNumber = (String) omsshipInstructionsCapacity.get("capacityName");
+        Map<String,Object> map = new HashMap<>();
+        map.put("capacityNumber",capacityNumber);
+        List<RmsCapacity> rmsCapacities = rmsCapacityMapper.selectByParameters(map);
+        OmsshipInstructionsCapacity realOmsshipInstructionsCapacity = new OmsshipInstructionsCapacity();
+        if (rmsCapacities.size() != 0 ) {
+            RmsCapacity rmsCapacity = rmsCapacities.get(0);
+            rmsCapacityMapper.updateByPrimaryKeySelective(rmsCapacity);
+            realOmsshipInstructionsCapacity.setCapacityId(rmsCapacity.getCapacityId());
+        }
+        else {
+            RmsCapacity rmsCapacity = new RmsCapacity();
+            rmsCapacity.setCapacityId(rmsCapacityMapper.selectCapacityId());
+            rmsCapacity.setCapacityNumber(capacityNumber);
+            rmsCapacity.setCapacityTypeId(new BigDecimal(3));
+            rmsCapacityMapper.insertSelective(rmsCapacity);
+            realOmsshipInstructionsCapacity.setCapacityId(rmsCapacity.getCapacityId());
+        }
+        String instructionPlannedLoading = (String) omsshipInstructionsCapacity.get("instructionPlannedLoading");
+        String instructionsShipPosition = (String) omsshipInstructionsCapacity.get("instructionsShipPosition");
+        String instructionContactInf = (String) omsshipInstructionsCapacity.get("instructionContactInf");
+        String instructionsCapacityStatus = (String) omsshipInstructionsCapacity.get("instructionsCapacityStatus");
+        Date instructionEsarrivalTime = new Date((Long) omsshipInstructionsCapacity.get("instructionEsarrivalTime"));
+        BigDecimal instructionsId = new BigDecimal((String) omsshipInstructionsCapacity.get("instructionsId"));
+        realOmsshipInstructionsCapacity.setInstructionsId(instructionsId);
+        realOmsshipInstructionsCapacity.setInstructionContactInf(instructionContactInf);
+        realOmsshipInstructionsCapacity.setInstructionEsarrivalTime(instructionEsarrivalTime);
+        realOmsshipInstructionsCapacity.setInstructionsCapacityStatus(instructionsCapacityStatus);
+        realOmsshipInstructionsCapacity.setInstructionsShipPosition(instructionsShipPosition);
+        realOmsshipInstructionsCapacity.setInstructionPlannedLoading(new BigDecimal(instructionPlannedLoading));
+        realOmsshipInstructionsCapacity.setInstructionsCapacityId(omsshipInstructionsCapacityMapper.selectInstructionCapacityId());
         // 设置常规字段
-        omsshipInstructionsCapacity.setDeleted(new BigDecimal(0));
-        omsshipInstructionsCapacity.setInsertTime(new Date());
-        omsshipInstructionsCapacity.setInsertUsername("admin");
-        omsshipInstructionsCapacity.setInsertUpdateRemark("无");
-        omsshipInstructionsCapacity.setUpdateTime(new Date());
-        omsshipInstructionsCapacity.setUpdateUsername("admin");
-        return omsshipInstructionsCapacityMapper.insert(omsshipInstructionsCapacity);
+        realOmsshipInstructionsCapacity.setDeleted(new BigDecimal(0));
+        realOmsshipInstructionsCapacity.setInsertTime(new Date());
+        realOmsshipInstructionsCapacity.setInsertUsername("admin");
+        realOmsshipInstructionsCapacity.setInsertUpdateRemark("无");
+        realOmsshipInstructionsCapacity.setUpdateTime(new Date());
+        realOmsshipInstructionsCapacity.setUpdateUsername("admin");
+        return omsshipInstructionsCapacityMapper.insert(realOmsshipInstructionsCapacity);
     }
 
     /**

+ 6 - 0
src/main/java/com/steerinfo/dil/service/impl/OmsshipShipmentInstructionsServiceImpl.java

@@ -81,6 +81,12 @@ public class OmsshipShipmentInstructionsServiceImpl implements IOmsshipShipmentI
     public int insert(OmsshipShipmentInstructions omsshipShipmentInstructions) {
         BigDecimal shipmentInstructionsId = omsshipShipmentInstructionsMapper.selectInstructionId();
         omsshipShipmentInstructions.setShipmentInstructionsId(shipmentInstructionsId);
+        BigDecimal batchId = omsshipShipmentInstructions.getBatchId();
+        Map<String,Object> map = omsshipShipmentInstructionsMapper.getPortAndPier(batchId);
+        BigDecimal pierId = (BigDecimal) map.get("pierId");
+        BigDecimal portId = (BigDecimal) map.get("portId");
+        omsshipShipmentInstructions.setRecipientCarrierId(pierId);
+        omsshipShipmentInstructions.setPortCarrierId(portId);
         //  设置常规字段
         omsshipShipmentInstructions.setInsertTime(new Date());
         omsshipShipmentInstructions.setDeleteName(null);

+ 15 - 14
src/main/java/com/steerinfo/dil/service/impl/TmsshipLoadShipResultServiceImpl.java

@@ -64,8 +64,13 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         TmsshipLoadShipResult tmsshipLoadShipResult = new TmsshipLoadShipResult();
         TmsshipEntryWharyResult tmsshipEntryWharyResult = new TmsshipEntryWharyResult();
         BigDecimal orderId = new BigDecimal((Integer) rowMap.get("orderId"));
+        BigDecimal batchId = getBatchId(rowMap);
+        Map<String,Object> ppMap = tmsshipLoadShipResultMapper.getPortAndPier(batchId);
+        BigDecimal startPortId = (BigDecimal) ppMap.get("startPortId");
+        BigDecimal arrivePortId = (BigDecimal) ppMap.get("arrivePortId");
+        BigDecimal pierId = (BigDecimal) ppMap.get("pierId");
+        Date noticeDeliveryTime = (Date) ppMap.get("noticeDeliveryTime");
         String resultMemo = (String) mapVal.get("resultMemo");
-        BigDecimal wharyId = new BigDecimal((Integer) mapVal.get("wharyId"));
         // 抵港
         Date resultPortDeclarationTime = new Date((Long) mapVal.get("resultPortDeclarationTime"));
         String resultPortDeclarationName = (String) mapVal.get("resultPortDeclarationName");
@@ -76,7 +81,7 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         tmsshipEntryWharyResult.setResultId(resultEntryId);
         String resultEntryNumber = noUtil.setResultNo("DG",resultEntryId);
         tmsshipEntryWharyResult.setResultNumber(resultEntryNumber);
-        tmsshipEntryWharyResult.setWharyId(wharyId);
+        tmsshipEntryWharyResult.setWharyId(pierId);
         tmsshipEntryWharyResult.setResultPortDeclarationTime(resultPortDeclarationTime);
         tmsshipEntryWharyResult.setResultPortDeclarationName(resultPortDeclarationName);
         tmsshipEntryWharyResult.setResultArrivalTime(resultArrivalTime);
@@ -98,7 +103,7 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         tmsshipOutWharyResult.setResultId(resultOutId);
         String resultOutNumber = noUtil.setResultNo("LG",resultOutId);
         tmsshipOutWharyResult.setResultNumber(resultOutNumber);
-        tmsshipOutWharyResult.setWharyId(wharyId);
+        tmsshipOutWharyResult.setWharyId(pierId);
         tmsshipOutWharyResult.setResultOutWharyTime(resultOutWharyTime);
         tmsshipOutWharyResult.setResultOutWharyName(resultOutWharyName);
         tmsshipOutWharyResult.setResultMemo(resultMemo);
@@ -112,10 +117,6 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         tmsshipOutWharyResult.setDeleteTime(null);
         // 装船
         BigDecimal resultId = tmsshipLoadShipResultMapper.selectLoadId();
-        BigDecimal locationStartPortId = new BigDecimal((Integer) mapVal.get("locationStartPortId"));
-        BigDecimal arrivalPortId = new BigDecimal((Integer) mapVal.get("arrivalPortId"));
-        BigDecimal batchId = getBatchId(rowMap);
-        Date resultDeliveryDate = new Date((Long) mapVal.get("resultDeliveryDate"));
         BigDecimal resultActualInstallations = new BigDecimal((String) mapVal.get("resultActualInstallations"));
         BigDecimal rwarehouseMaterialId = new BigDecimal((Integer) mapVal.get("rwarehouseMaterialId"));
         Date resultLoadShipDate = new Date((Long) mapVal.get("resultLoadShipDate"));
@@ -123,10 +124,10 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         String resultNumber = noUtil.setResultNo("ZC",resultEntryId);
         tmsshipLoadShipResult.setResultId(resultId);
         tmsshipLoadShipResult.setTotalResultId(totalResultId);
-        tmsshipLoadShipResult.setLocationStartPortId(locationStartPortId);
-        tmsshipLoadShipResult.setArrivalPortId(arrivalPortId);
+        tmsshipLoadShipResult.setLocationStartPortId(startPortId);
+        tmsshipLoadShipResult.setArrivalPortId(arrivePortId);
         tmsshipLoadShipResult.setBatchId(batchId);
-        tmsshipLoadShipResult.setResultDeliveryDate(resultDeliveryDate);
+        tmsshipLoadShipResult.setResultDeliveryDate(noticeDeliveryTime);
         tmsshipLoadShipResult.setResultActualInstallations(resultActualInstallations);
         tmsshipLoadShipResult.setResultNumber(resultNumber);
         tmsshipLoadShipResult.setRwarehouseMaterialId(rwarehouseMaterialId);
@@ -143,16 +144,16 @@ public class TmsshipLoadShipResultServiceImpl implements ITmsshipLoadShipResultS
         tmsshipLoadShipResult.setUpdateTime(new Date());
         tmsshipLoadShipResult.setUpdateUsername("admin");
         tmsshipLoadShipResult.setDeleted(new BigDecimal(0));
-        tmsshipEntryWharyResultMapper.insert(tmsshipEntryWharyResult);
-        tmsshipOutWharyResultMapper.insert(tmsshipOutWharyResult);
+        tmsshipEntryWharyResultMapper.insertSelective(tmsshipEntryWharyResult);
+        tmsshipOutWharyResultMapper.insertSelective(tmsshipOutWharyResult);
         // 新增出库实绩
         Map<String,Object> mapValue = new HashMap<>();
         mapValue.put("batchId",batchId);
-        mapValue.put("portId",locationStartPortId);
+        mapValue.put("portId",startPortId);
         mapValue.put("resultTonnage",resultActualInstallations);
         mapValue.put("isClean",resultIsClear);
         wmshboundFeign.addResult(mapValue);
-        int codeLoad = tmsshipLoadShipResultMapper.insert(tmsshipLoadShipResult);
+        int codeLoad = tmsshipLoadShipResultMapper.insertSelective(tmsshipLoadShipResult);
         return codeLoad;
     }
 

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

@@ -71,7 +71,7 @@ public class TmsshipWaterQualityResultServiceImpl implements ITmsshipWaterQualit
             shipmentRatio = strRatio.substring(0, 6);
         }
         BigDecimal resultShipmentRatio = new BigDecimal(shipmentRatio);
-        Date resultEsDeliveryDate = new Date((Long) mapVal.get("resultEsDeliveryDate"));
+        Date resultEsDeliveryDate = tmsshipWaterQualityResultMapper.getDeliveryDate(orderId);
         BigDecimal resultWaterTonnage = new BigDecimal((String) mapVal.get("resultWaterTonnage"));
         BigDecimal resultInspectionFees = new BigDecimal((String) mapVal.get("resultInspectionFees"));
         Double content = resultWaterTonnage.doubleValue()/resultActualInstallations.doubleValue();

+ 613 - 581
src/main/resources/com/steerinfo/dil/mapper/OmsshipShipmentInstructionsMapper.xml

@@ -1,601 +1,633 @@
 <?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.OmsshipShipmentInstructionsMapper">
-  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmsshipShipmentInstructions">
-    <id column="SHIPMENT_INSTRUCTIONS_ID" jdbcType="DECIMAL" property="shipmentInstructionsId" />
-    <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
-    <result column="RECIPIENT_CARRIER_ID" jdbcType="DECIMAL" property="recipientCarrierId" />
-    <result column="PORT_CARRIER_ID" jdbcType="DECIMAL" property="portCarrierId" />
-    <result column="INSTRUCTIONS_TOTAL_TONNAGE" jdbcType="DECIMAL" property="instructionsTotalTonnage" />
-    <result column="INSTRUCTION_TIME" jdbcType="TIMESTAMP" property="instructionTime" />
-    <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
-    <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime" />
-    <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="INSTRUCTION_ISSUE_STATUS" jdbcType="VARCHAR" property="instructionIssueStatus" />
-  </resultMap>
-  <sql id="columns">
-    SHIPMENT_INSTRUCTIONS_ID, BATCH_ID, RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmsshipShipmentInstructions">
+        <id column="SHIPMENT_INSTRUCTIONS_ID" jdbcType="DECIMAL" property="shipmentInstructionsId"/>
+        <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId"/>
+        <result column="RECIPIENT_CARRIER_ID" jdbcType="DECIMAL" property="recipientCarrierId"/>
+        <result column="PORT_CARRIER_ID" jdbcType="DECIMAL" property="portCarrierId"/>
+        <result column="INSTRUCTIONS_TOTAL_TONNAGE" jdbcType="DECIMAL" property="instructionsTotalTonnage"/>
+        <result column="INSTRUCTION_TIME" jdbcType="TIMESTAMP" property="instructionTime"/>
+        <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
+        <result column="DELETE_TIME" jdbcType="VARCHAR" property="deleteTime"/>
+        <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="INSTRUCTION_ISSUE_STATUS" jdbcType="VARCHAR" property="instructionIssueStatus"/>
+    </resultMap>
+    <sql id="columns">
+        SHIPMENT_INSTRUCTIONS_ID, BATCH_ID, RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
     INSTRUCTION_TIME, DELETE_NAME, DELETE_TIME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
     UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, INSTRUCTION_ISSUE_STATUS
-  </sql>
-  <sql id="columns_alias">
-    t.SHIPMENT_INSTRUCTIONS_ID, t.BATCH_ID, t.RECIPIENT_CARRIER_ID, t.PORT_CARRIER_ID,
+    </sql>
+    <sql id="columns_alias">
+        t.SHIPMENT_INSTRUCTIONS_ID, t.BATCH_ID, t.RECIPIENT_CARRIER_ID, t.PORT_CARRIER_ID,
     t.INSTRUCTIONS_TOTAL_TONNAGE, t.INSTRUCTION_TIME, t.DELETE_NAME, t.DELETE_TIME, t.INSERT_USERNAME,
     t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
     t.INSTRUCTION_ISSUE_STATUS
-  </sql>
-  <sql id="select">
-    SELECT <include refid="columns"/> FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
-  </sql>
-  <sql id="select_alias">
-    SELECT <include refid="columns_alias"/> FROM OMSSHIP_SHIPMENT_INSTRUCTIONS t
-  </sql>
-  <sql id="where">
-    <where>
-      <if test="shipmentInstructionsId != null">
-        and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
-      </if>
-      <if test="batchId != null">
-        and BATCH_ID = #{batchId}
-      </if>
-      <if test="recipientCarrierId != null">
-        and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
-      </if>
-      <if test="portCarrierId != null">
-        and PORT_CARRIER_ID = #{portCarrierId}
-      </if>
-      <if test="instructionsTotalTonnage != null">
-        and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
-      </if>
-      <if test="instructionTime != null">
-        and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
-      </if>
-      <if test="deleteName != null and deleteName != ''">
-        and DELETE_NAME = #{deleteName}
-      </if>
-      <if test="deleteTime != null and deleteTime != ''">
-        and DELETE_TIME = #{deleteTime}
-      </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="instructionIssueStatus != null and instructionIssueStatus != ''">
-        and INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
-      </if>
-    </where>
-  </sql>
-  <sql id="whereLike">
-    <where>
-      <if test="shipmentInstructionsId != null">
-        and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
-      </if>
-      <if test="batchId != null">
-        and BATCH_ID = #{batchId}
-      </if>
-      <if test="recipientCarrierId != null">
-        and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
-      </if>
-      <if test="portCarrierId != null">
-        and PORT_CARRIER_ID = #{portCarrierId}
-      </if>
-      <if test="instructionsTotalTonnage != null">
-        and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
-      </if>
-      <if test="instructionTime != null">
-        and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
-      </if>
-      <if test="deleteName != null and deleteName != ''">
-        and DELETE_NAME LIKE '%${deleteName}%'
-      </if>
-      <if test="deleteTime != null and deleteTime != ''">
-        and DELETE_TIME LIKE '%${deleteTime}%'
-      </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="instructionIssueStatus != null and instructionIssueStatus != ''">
-        and INSTRUCTION_ISSUE_STATUS LIKE '%${instructionIssueStatus}%'
-      </if>
-    </where>
-  </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
-    delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
-    where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
-  </delete>
-  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
-    delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
-    where 1!=1
-    <if test="batchId != null">
-      or BATCH_ID = #{batchId}
-    </if>
-    <if test="recipientCarrierId != null">
-      or RECIPIENT_CARRIER_ID = #{recipientCarrierId}
-    </if>
-    <if test="portCarrierId != null">
-      or PORT_CARRIER_ID = #{portCarrierId}
-    </if>
-    <if test="instructionsTotalTonnage != null">
-      or INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
-    </if>
-    <if test="instructionTime != null">
-      or TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = '#{instructionTime}'
-    </if>
-    <if test="deleteName != null and deleteName != ''">
-      or DELETE_NAME = #{deleteName}
-    </if>
-    <if test="deleteTime != null and deleteTime != ''">
-      or DELETE_TIME = #{deleteTime}
-    </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="instructionIssueStatus != null and instructionIssueStatus != ''">
-      or INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
-    insert into OMSSHIP_SHIPMENT_INSTRUCTIONS (SHIPMENT_INSTRUCTIONS_ID, BATCH_ID,
-      RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
-      INSTRUCTION_TIME, DELETE_NAME, DELETE_TIME,
-      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
-      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
-      INSTRUCTION_ISSUE_STATUS)
-    values (#{shipmentInstructionsId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL},
-      #{recipientCarrierId,jdbcType=DECIMAL}, #{portCarrierId,jdbcType=DECIMAL}, #{instructionsTotalTonnage,jdbcType=DECIMAL},
-      #{instructionTime,jdbcType=TIMESTAMP}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
-      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
-      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
-      #{instructionIssueStatus,jdbcType=VARCHAR})
-  </insert>
-  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
-    insert into OMSSHIP_SHIPMENT_INSTRUCTIONS
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="shipmentInstructionsId != null">
-        SHIPMENT_INSTRUCTIONS_ID,
-      </if>
-      <if test="batchId != null">
-        BATCH_ID,
-      </if>
-      <if test="recipientCarrierId != null">
-        RECIPIENT_CARRIER_ID,
-      </if>
-      <if test="portCarrierId != null">
-        PORT_CARRIER_ID,
-      </if>
-      <if test="instructionsTotalTonnage != null">
-        INSTRUCTIONS_TOTAL_TONNAGE,
-      </if>
-      <if test="instructionTime != null">
-        INSTRUCTION_TIME,
-      </if>
-      <if test="deleteName != null">
-        DELETE_NAME,
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME,
-      </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="instructionIssueStatus != null">
-        INSTRUCTION_ISSUE_STATUS,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="shipmentInstructionsId != null">
-        #{shipmentInstructionsId,jdbcType=DECIMAL},
-      </if>
-      <if test="batchId != null">
-        #{batchId,jdbcType=DECIMAL},
-      </if>
-      <if test="recipientCarrierId != null">
-        #{recipientCarrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="portCarrierId != null">
-        #{portCarrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="instructionsTotalTonnage != null">
-        #{instructionsTotalTonnage,jdbcType=DECIMAL},
-      </if>
-      <if test="instructionTime != null">
-        #{instructionTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteName != null">
-        #{deleteName,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        #{deleteTime,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="instructionIssueStatus != null">
-        #{instructionIssueStatus,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
-    update OMSSHIP_SHIPMENT_INSTRUCTIONS
-    set BATCH_ID = #{batchId,jdbcType=DECIMAL},
-      RECIPIENT_CARRIER_ID = #{recipientCarrierId,jdbcType=DECIMAL},
-      PORT_CARRIER_ID = #{portCarrierId,jdbcType=DECIMAL},
-      INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
-      INSTRUCTION_TIME = #{instructionTime,jdbcType=TIMESTAMP},
-      DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-      DELETE_TIME = #{deleteTime,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},
-      INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus,jdbcType=VARCHAR}
-    where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
-    update OMSSHIP_SHIPMENT_INSTRUCTIONS
-    <set>
-      <if test="batchId != null">
-        BATCH_ID = #{batchId,jdbcType=DECIMAL},
-      </if>
-      <if test="recipientCarrierId != null">
-        RECIPIENT_CARRIER_ID = #{recipientCarrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="portCarrierId != null">
-        PORT_CARRIER_ID = #{portCarrierId,jdbcType=DECIMAL},
-      </if>
-      <if test="instructionsTotalTonnage != null">
-        INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
-      </if>
-      <if test="instructionTime != null">
-        INSTRUCTION_TIME = #{instructionTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="deleteName != null">
-        DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
-      </if>
-      <if test="deleteTime != null">
-        DELETE_TIME = #{deleteTime,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="instructionIssueStatus != null">
-        INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,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 OMSSHIP_SHIPMENT_INSTRUCTIONS
-    (SHIPMENT_INSTRUCTIONS_ID,
-    BATCH_ID, RECIPIENT_CARRIER_ID,
-    PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
-    INSTRUCTION_TIME, DELETE_NAME,
-    DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
-    UPDATE_USERNAME, UPDATE_TIME,
-    INSERT_UPDATE_REMARK, DELETED,
-    INSTRUCTION_ISSUE_STATUS)
-    ( <foreach collection="list" item="item" separator="union all">
-    select
-    #{item.shipmentInstructionsId,jdbcType=DECIMAL},
-    #{item.batchId,jdbcType=DECIMAL}, #{item.recipientCarrierId,jdbcType=DECIMAL},
-    #{item.portCarrierId,jdbcType=DECIMAL}, #{item.instructionsTotalTonnage,jdbcType=DECIMAL},
-    #{item.instructionTime,jdbcType=TIMESTAMP}, #{item.deleteName,jdbcType=VARCHAR},
-    #{item.deleteTime,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.instructionIssueStatus,jdbcType=VARCHAR} from dual
-  </foreach> )
-  </insert>
-  <update id="batchUpdate" parameterType="java.util.List">
-    update OMSSHIP_SHIPMENT_INSTRUCTIONS
-    set
-    SHIPMENT_INSTRUCTIONS_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.shipmentInstructionsId,jdbcType=DECIMAL}
-    </foreach>
-    ,BATCH_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
-    </foreach>
-    ,RECIPIENT_CARRIER_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.recipientCarrierId,jdbcType=DECIMAL}
-    </foreach>
-    ,PORT_CARRIER_ID=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.portCarrierId,jdbcType=DECIMAL}
-    </foreach>
-    ,INSTRUCTIONS_TOTAL_TONNAGE=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionsTotalTonnage,jdbcType=DECIMAL}
-    </foreach>
-    ,INSTRUCTION_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,DELETE_NAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
-    </foreach>
-    ,DELETE_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
-    </foreach>
-    ,INSERT_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,INSERT_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,UPDATE_USERNAME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-    </foreach>
-    ,UPDATE_TIME=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-    </foreach>
-    ,INSERT_UPDATE_REMARK=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-    </foreach>
-    ,DELETED=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
-    </foreach>
-    ,INSTRUCTION_ISSUE_STATUS=
-    <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID" close="end">
-      when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionIssueStatus,jdbcType=VARCHAR}
-    </foreach>
-    where SHIPMENT_INSTRUCTIONS_ID in
-    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-      #{item.shipmentInstructionsId,jdbcType=DECIMAL}
-    </foreach>
-  </update>
-  <delete id="batchDelete" parameterType="java.util.List">
-    delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
-    where SHIPMENT_INSTRUCTIONS_ID in
-    <foreach collection="list" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </delete>
-  <!-- 友情提示!!!-->
-  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-  <sql id="orderByInsertTime">
-    <if test="orderField != null and orderField != ''">
-      order by "${orderField}"
-      <if test="orderType != null and orderType != ''">
-        ${orderType}
-      </if>
-    </if>
-    <if test="orderField == null  ">
-      order by "insertTime" desc
-    </if>
-  </sql>
-  <select id="selectAll"  resultType="java.util.Map">
-    select *
-    from(
-    select distinct
-    osi.SHIPMENT_INSTRUCTIONS_ID "instructionsId",
-    osi.INSERT_TIME "insertTime",
-    rpi.PIER_NAME "piername",
-    rpo.PORT_NAME  "portname",
-    rpo.PORT_NAME  "portname2",
-    rm.MATERIAL_NAME  "materialName",
-    db.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
-    rs.SHIPPER_NAME  "shipperName",
-    rs.SHIPPER_CONTACT_NUMBER  "shipperContactNumber",
-    osi.INSTRUCTION_TIME "instructionTime",
-    osi.INSTRUCTIONS_TOTAL_TONNAGE "instruct"
-    from  OMSSHIP_SHIPMENT_INSTRUCTIONS osi
-    left join AMSSHIP_DELIVERY_ATTORNEY ada
-    on  osi.BATCH_ID = ada.BATCH_ID
-    left join RMS_PIER rpi
-    on osi.RECIPIENT_CARRIER_ID=rpi.PIER_ID
-    left join  RMS_PORT rpo
-    on osi.PORT_CARRIER_ID=rpo.PORT_ID
-    left join AMSSHIP_DELIVERY_NOTICE adn
-    on ada.BATCH_ID=adn.BATCH_ID
-    left join DIL_BATCH db
-    on osi.BATCH_ID = db.BATCH_ID
-    left join RMS_MATERIAL rm
-    on db.MATERIAL_ID = rm.MATERIAL_ID
-    left join RMS_SHIPPER rs
-    on adn.REQUESTER_GROUP_ID=rs.SHIPPER_ID
-    where osi.DELETED = 0
-    )
-    <where>
-      <if test="piername!= null">
-        and
-        <foreach collection="piername" item="item" open="(" separator="," close=")">
-          "piername" in  #{item}
+    </sql>
+    <sql id="select">
+        SELECT
+        <include refid="columns"/>
+        FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
+    </sql>
+    <sql id="select_alias">
+        SELECT
+        <include refid="columns_alias"/>
+        FROM OMSSHIP_SHIPMENT_INSTRUCTIONS t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="shipmentInstructionsId != null">
+                and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
+            </if>
+            <if test="batchId != null">
+                and BATCH_ID = #{batchId}
+            </if>
+            <if test="recipientCarrierId != null">
+                and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
+            </if>
+            <if test="portCarrierId != null">
+                and PORT_CARRIER_ID = #{portCarrierId}
+            </if>
+            <if test="instructionsTotalTonnage != null">
+                and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
+            </if>
+            <if test="instructionTime != null">
+                and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
+            </if>
+            <if test="deleteName != null and deleteName != ''">
+                and DELETE_NAME = #{deleteName}
+            </if>
+            <if test="deleteTime != null and deleteTime != ''">
+                and DELETE_TIME = #{deleteTime}
+            </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="instructionIssueStatus != null and instructionIssueStatus != ''">
+                and INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
+            </if>
+        </where>
+    </sql>
+    <sql id="whereLike">
+        <where>
+            <if test="shipmentInstructionsId != null">
+                and SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
+            </if>
+            <if test="batchId != null">
+                and BATCH_ID = #{batchId}
+            </if>
+            <if test="recipientCarrierId != null">
+                and RECIPIENT_CARRIER_ID = #{recipientCarrierId}
+            </if>
+            <if test="portCarrierId != null">
+                and PORT_CARRIER_ID = #{portCarrierId}
+            </if>
+            <if test="instructionsTotalTonnage != null">
+                and INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
+            </if>
+            <if test="instructionTime != null">
+                and TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = #{instructionTime}
+            </if>
+            <if test="deleteName != null and deleteName != ''">
+                and DELETE_NAME LIKE '%${deleteName}%'
+            </if>
+            <if test="deleteTime != null and deleteTime != ''">
+                and DELETE_TIME LIKE '%${deleteTime}%'
+            </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="instructionIssueStatus != null and instructionIssueStatus != ''">
+                and INSTRUCTION_ISSUE_STATUS LIKE '%${instructionIssueStatus}%'
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+        delete
+        from OMSSHIP_SHIPMENT_INSTRUCTIONS
+        where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
+        where 1!=1
+        <if test="batchId != null">
+            or BATCH_ID = #{batchId}
+        </if>
+        <if test="recipientCarrierId != null">
+            or RECIPIENT_CARRIER_ID = #{recipientCarrierId}
+        </if>
+        <if test="portCarrierId != null">
+            or PORT_CARRIER_ID = #{portCarrierId}
+        </if>
+        <if test="instructionsTotalTonnage != null">
+            or INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage}
+        </if>
+        <if test="instructionTime != null">
+            or TO_CHAR(INSTRUCTION_TIME,'yyyy-MM-dd') = '#{instructionTime}'
+        </if>
+        <if test="deleteName != null and deleteName != ''">
+            or DELETE_NAME = #{deleteName}
+        </if>
+        <if test="deleteTime != null and deleteTime != ''">
+            or DELETE_TIME = #{deleteTime}
+        </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="instructionIssueStatus != null and instructionIssueStatus != ''">
+            or INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus}
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
+        insert into OMSSHIP_SHIPMENT_INSTRUCTIONS (SHIPMENT_INSTRUCTIONS_ID, BATCH_ID,
+                                                   RECIPIENT_CARRIER_ID, PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
+                                                   INSTRUCTION_TIME, DELETE_NAME, DELETE_TIME,
+                                                   INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                                   UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
+                                                   INSTRUCTION_ISSUE_STATUS)
+        values (#{shipmentInstructionsId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL},
+                #{recipientCarrierId,jdbcType=DECIMAL}, #{portCarrierId,jdbcType=DECIMAL},
+                #{instructionsTotalTonnage,jdbcType=DECIMAL},
+                #{instructionTime,jdbcType=TIMESTAMP}, #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=VARCHAR},
+                #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+                #{updateUsername,jdbcType=VARCHAR},
+                #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
+                #{instructionIssueStatus,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
+        insert into OMSSHIP_SHIPMENT_INSTRUCTIONS
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="shipmentInstructionsId != null">
+                SHIPMENT_INSTRUCTIONS_ID,
+            </if>
+            <if test="batchId != null">
+                BATCH_ID,
+            </if>
+            <if test="recipientCarrierId != null">
+                RECIPIENT_CARRIER_ID,
+            </if>
+            <if test="portCarrierId != null">
+                PORT_CARRIER_ID,
+            </if>
+            <if test="instructionsTotalTonnage != null">
+                INSTRUCTIONS_TOTAL_TONNAGE,
+            </if>
+            <if test="instructionTime != null">
+                INSTRUCTION_TIME,
+            </if>
+            <if test="deleteName != null">
+                DELETE_NAME,
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME,
+            </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="instructionIssueStatus != null">
+                INSTRUCTION_ISSUE_STATUS,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="shipmentInstructionsId != null">
+                #{shipmentInstructionsId,jdbcType=DECIMAL},
+            </if>
+            <if test="batchId != null">
+                #{batchId,jdbcType=DECIMAL},
+            </if>
+            <if test="recipientCarrierId != null">
+                #{recipientCarrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="portCarrierId != null">
+                #{portCarrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="instructionsTotalTonnage != null">
+                #{instructionsTotalTonnage,jdbcType=DECIMAL},
+            </if>
+            <if test="instructionTime != null">
+                #{instructionTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="deleteName != null">
+                #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                #{deleteTime,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="instructionIssueStatus != null">
+                #{instructionIssueStatus,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
+        update OMSSHIP_SHIPMENT_INSTRUCTIONS
+        set BATCH_ID                   = #{batchId,jdbcType=DECIMAL},
+            RECIPIENT_CARRIER_ID       = #{recipientCarrierId,jdbcType=DECIMAL},
+            PORT_CARRIER_ID            = #{portCarrierId,jdbcType=DECIMAL},
+            INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
+            INSTRUCTION_TIME           = #{instructionTime,jdbcType=TIMESTAMP},
+            DELETE_NAME                = #{deleteName,jdbcType=VARCHAR},
+            DELETE_TIME                = #{deleteTime,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},
+            INSTRUCTION_ISSUE_STATUS   = #{instructionIssueStatus,jdbcType=VARCHAR}
+        where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmsshipShipmentInstructions">
+        update OMSSHIP_SHIPMENT_INSTRUCTIONS
+        <set>
+            <if test="batchId != null">
+                BATCH_ID = #{batchId,jdbcType=DECIMAL},
+            </if>
+            <if test="recipientCarrierId != null">
+                RECIPIENT_CARRIER_ID = #{recipientCarrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="portCarrierId != null">
+                PORT_CARRIER_ID = #{portCarrierId,jdbcType=DECIMAL},
+            </if>
+            <if test="instructionsTotalTonnage != null">
+                INSTRUCTIONS_TOTAL_TONNAGE = #{instructionsTotalTonnage,jdbcType=DECIMAL},
+            </if>
+            <if test="instructionTime != null">
+                INSTRUCTION_TIME = #{instructionTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="deleteName != null">
+                DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
+            </if>
+            <if test="deleteTime != null">
+                DELETE_TIME = #{deleteTime,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="instructionIssueStatus != null">
+                INSTRUCTION_ISSUE_STATUS = #{instructionIssueStatus,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+        <include refid="select"/>
+        where SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId,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 OMSSHIP_SHIPMENT_INSTRUCTIONS
+        (SHIPMENT_INSTRUCTIONS_ID,
+        BATCH_ID, RECIPIENT_CARRIER_ID,
+        PORT_CARRIER_ID, INSTRUCTIONS_TOTAL_TONNAGE,
+        INSTRUCTION_TIME, DELETE_NAME,
+        DELETE_TIME, INSERT_USERNAME, INSERT_TIME,
+        UPDATE_USERNAME, UPDATE_TIME,
+        INSERT_UPDATE_REMARK, DELETED,
+        INSTRUCTION_ISSUE_STATUS)
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+        #{item.shipmentInstructionsId,jdbcType=DECIMAL},
+        #{item.batchId,jdbcType=DECIMAL}, #{item.recipientCarrierId,jdbcType=DECIMAL},
+        #{item.portCarrierId,jdbcType=DECIMAL}, #{item.instructionsTotalTonnage,jdbcType=DECIMAL},
+        #{item.instructionTime,jdbcType=TIMESTAMP}, #{item.deleteName,jdbcType=VARCHAR},
+        #{item.deleteTime,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.instructionIssueStatus,jdbcType=VARCHAR} from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+        update OMSSHIP_SHIPMENT_INSTRUCTIONS
+        set
+        SHIPMENT_INSTRUCTIONS_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.shipmentInstructionsId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="portname!= null">
-        and
-        <foreach collection="portname" item="item" open="(" separator="," close=")">
-          "portname"  in  #{item}
+        ,BATCH_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="portname2!= null">
-        and
-        <foreach collection="portname2" item="item" open="(" separator="," close=")">
-          "portname2" in  #{item}
+        ,RECIPIENT_CARRIER_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.recipientCarrierId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="materialName!= null">
-        and
-        <foreach collection="materialName" item="item" open="(" separator="," close=")">
-          "materialName" in  #{item}
+        ,PORT_CARRIER_ID=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.portCarrierId,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="foreignShipName!= null">
-        and
-        <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
-          "foreignShipName" in  #{item}
+        ,INSTRUCTIONS_TOTAL_TONNAGE=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionsTotalTonnage,jdbcType=DECIMAL}
         </foreach>
-      </if>
-      <if test="shipperName!= null">
-        and
-        <foreach collection="shipperName" item="item" open="(" separator="," close=")">
-          "shipperName" in  #{item}
+        ,INSTRUCTION_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionTime,jdbcType=TIMESTAMP}
         </foreach>
-      </if>
-      <if test="shipperContactNumber!= null">
-        and
-        <foreach collection="shipperContactNumber" item="item" open="(" separator="," close=")">
-          "shipperContactNumber" in  #{item}
+        ,DELETE_NAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="instructionTime!= null">
-        and
-        <foreach collection="instructionTime" item="item" open="(" separator="," close=")">
-          "instructionTime" in  to_date('${item}','yyyy-mm-dd hh24:mi:ss')
+        ,DELETE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=VARCHAR}
         </foreach>
-      </if>
-      <if test="instruct!= null">
-        and
-        <foreach collection="instruct" item="item" open="(" separator="," close=")">
-          "instruct" in  #{item}
+        ,INSERT_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
         </foreach>
-      </if>
-    </where>
-    <include refid="orderByInsertTime"></include>
-  </select>
-  <!-- 自动生成id-->
-  <select id="selectMaxId" resultType="DECIMAL">
-    SELECT MAX(SHIPMENT_INSTRUCTIONS_ID)+1 FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
-  </select>
+        ,INSERT_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,UPDATE_USERNAME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+        </foreach>
+        ,UPDATE_TIME=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+        </foreach>
+        ,INSERT_UPDATE_REMARK=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+        </foreach>
+        ,DELETED=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+        </foreach>
+        ,INSTRUCTION_ISSUE_STATUS=
+        <foreach collection="list" item="item" index="index" separator=" " open="case SHIPMENT_INSTRUCTIONS_ID"
+                 close="end">
+            when #{item.shipmentInstructionsId,jdbcType=DECIMAL} then #{item.instructionIssueStatus,jdbcType=VARCHAR}
+        </foreach>
+        where SHIPMENT_INSTRUCTIONS_ID in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.shipmentInstructionsId,jdbcType=DECIMAL}
+        </foreach>
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from OMSSHIP_SHIPMENT_INSTRUCTIONS
+        where SHIPMENT_INSTRUCTIONS_ID in
+        <foreach collection="list" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <sql id="orderByInsertTime">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+        <if test="orderField == null  ">
+            order by "insertTime" desc
+        </if>
+    </sql>
+    <select id="selectAll" resultType="java.util.Map">
+        select *
+        from(
+        select distinct
+        osi.SHIPMENT_INSTRUCTIONS_ID "instructionsId",
+        osi.INSERT_TIME "insertTime",
+        rpi.PIER_NAME "piername",
+        rpo.PORT_NAME "portname",
+        rpo.PORT_NAME "portname2",
+        rm.MATERIAL_NAME "materialName",
+        db.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
+        rs.SHIPPER_NAME "shipperName",
+        rs.SHIPPER_CONTACT_NUMBER "shipperContactNumber",
+        osi.INSTRUCTION_TIME "instructionTime",
+        osi.INSTRUCTIONS_TOTAL_TONNAGE "instruct"
+        from OMSSHIP_SHIPMENT_INSTRUCTIONS osi
+        left join AMSSHIP_DELIVERY_ATTORNEY ada
+        on osi.BATCH_ID = ada.BATCH_ID
+        left join RMS_PIER rpi
+        on osi.RECIPIENT_CARRIER_ID=rpi.PIER_ID
+        left join RMS_PORT rpo
+        on osi.PORT_CARRIER_ID=rpo.PORT_ID
+        left join AMSSHIP_DELIVERY_NOTICE adn
+        on ada.BATCH_ID=adn.BATCH_ID
+        left join DIL_BATCH db
+        on osi.BATCH_ID = db.BATCH_ID
+        left join RMS_MATERIAL rm
+        on db.MATERIAL_ID = rm.MATERIAL_ID
+        left join RMS_SHIPPER rs
+        on adn.REQUESTER_GROUP_ID=rs.SHIPPER_ID
+        where osi.DELETED = 0
+        )
+        <where>
+            <if test="piername!= null">
+                and
+                <foreach collection="piername" item="item" open="(" separator="," close=")">
+                    "piername" in #{item}
+                </foreach>
+            </if>
+            <if test="portname!= null">
+                and
+                <foreach collection="portname" item="item" open="(" separator="," close=")">
+                    "portname" in #{item}
+                </foreach>
+            </if>
+            <if test="portname2!= null">
+                and
+                <foreach collection="portname2" item="item" open="(" separator="," close=")">
+                    "portname2" in #{item}
+                </foreach>
+            </if>
+            <if test="materialName!= null">
+                and
+                <foreach collection="materialName" item="item" open="(" separator="," close=")">
+                    "materialName" in #{item}
+                </foreach>
+            </if>
+            <if test="foreignShipName!= null">
+                and
+                <foreach collection="foreignShipName" item="item" open="(" separator="," close=")">
+                    "foreignShipName" in #{item}
+                </foreach>
+            </if>
+            <if test="shipperName!= null">
+                and
+                <foreach collection="shipperName" item="item" open="(" separator="," close=")">
+                    "shipperName" in #{item}
+                </foreach>
+            </if>
+            <if test="shipperContactNumber!= null">
+                and
+                <foreach collection="shipperContactNumber" item="item" open="(" separator="," close=")">
+                    "shipperContactNumber" in #{item}
+                </foreach>
+            </if>
+            <if test="instructionTime!= null">
+                and
+                <foreach collection="instructionTime" item="item" open="(" separator="," close=")">
+                    "instructionTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
+                </foreach>
+            </if>
+            <if test="instruct!= null">
+                and
+                <foreach collection="instruct" item="item" open="(" separator="," close=")">
+                    "instruct" in #{item}
+                </foreach>
+            </if>
+        </where>
+        <include refid="orderByInsertTime"></include>
+    </select>
+    <!-- 自动生成id-->
+    <select id="selectMaxId" resultType="DECIMAL">
+        SELECT MAX(SHIPMENT_INSTRUCTIONS_ID) + 1
+        FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
+    </select>
+
+    <select id="selectShipmentInstructions" parameterType="DECIMAL" resultType="java.util.Map">
+        SELECT BATCH_ID                   "batchId",
+               RECIPIENT_CARRIER_ID       "recipientCarrierId",
+               PORT_CARRIER_ID            "portCarrierId",
+               INSTRUCTIONS_TOTAL_TONNAGE "instructionsTotalTonnage",
+               INSTRUCTION_TIME           "instructionTime"
+        FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
+        WHERE SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
+    </select>
 
-  <select id="selectShipmentInstructions" parameterType="DECIMAL" resultType="java.util.Map">
-    SELECT
-    BATCH_ID "batchId",
-    RECIPIENT_CARRIER_ID "recipientCarrierId",
-    PORT_CARRIER_ID "portCarrierId",
-    INSTRUCTIONS_TOTAL_TONNAGE "instructionsTotalTonnage",
-    INSTRUCTION_TIME "instructionTime"
-    FROM OMSSHIP_SHIPMENT_INSTRUCTIONS
-    WHERE SHIPMENT_INSTRUCTIONS_ID = #{shipmentInstructionsId}
-  </select>
+    <!--得到批次id-->
+    <select id="getBatchId" resultType="java.util.LinkedHashMap">
+        select BATCH_ID                                                                        "id",
+               BATCH_ID                                                                        "value",
+               CONCAT(CONCAT(RM.MATERIAL_NAME, '"'), CONCAT(DB.RESULT_FOREIGN_SHIP_NAME, '"')) "label"
+        from DIL_BATCH DB
+                 left join RMS_MATERIAL RM
+                           on RM.MATERIAL_ID = DB.MATERIAL_ID
+    </select>
 
-  <!--得到批次id-->
-  <select id="getBatchId" resultType="java.util.LinkedHashMap">
-    select
-      BATCH_ID "id",
-      BATCH_ID "value",
-      CONCAT(CONCAT(RM.MATERIAL_NAME, '"'), CONCAT(DB.RESULT_FOREIGN_SHIP_NAME, '"')) "label"
-    from DIL_BATCH DB
-           left join RMS_MATERIAL RM
-                     on RM.MATERIAL_ID = DB.MATERIAL_ID
-  </select>
+    <!-- 得到港口和码头 -->
+    <select id="getPortAndPier" parameterType="DECIMAL" resultType="java.util.Map">
+        SELECT ACTR.GROUP_ID AS "pierId",
+               ADN.PORT_ID   AS "portId"
+        FROM AMSSHIP_CARGO_TRANSFER_RESULT ACTR
+                 LEFT JOIN AMSSHIP_DELIVERY_NOTICE ADN
+                           ON ADN.BATCH_ID = ACTR.BATCH_ID
+        WHERE ADN.BATCH_ID = #{batchId}
+    </select>
 </mapper>

+ 683 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsCapacityMapper.xml

@@ -0,0 +1,683 @@
+<?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.RmsCapacityMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsCapacity">
+    <id column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
+    <result column="CAPACITY_NUMBER" jdbcType="VARCHAR" property="capacityNumber" />
+    <result column="CAPACITY_MAX_LOAD" jdbcType="DECIMAL" property="capacityMaxLoad" />
+    <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
+    <result column="CAPACITY_STATUS" jdbcType="DECIMAL" property="capacityStatus" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="CAPACITY_ENERGY_ID" jdbcType="VARCHAR" property="capacityEnergyId" />
+    <result column="CAPACITY_LEN_VAL" jdbcType="DECIMAL" property="capacityLenVal" />
+    <result column="CAPACITY_WID_VAL" jdbcType="DECIMAL" property="capacityWidVal" />
+    <result column="CAPACITY_HIG_VAL" jdbcType="DECIMAL" property="capacityHigVal" />
+    <result column="CAPACITY_OIL_ID" jdbcType="DECIMAL" property="capacityOilId" />
+    <result column="CAPACITY_FUEL_CONSUMPTION" jdbcType="VARCHAR" property="capacityFuelConsumption" />
+    <result column="CAPACITY_OWNERIS" jdbcType="DECIMAL" property="capacityOwneris" />
+    <result column="CAPACITY_BLACKLIST" jdbcType="DECIMAL" property="capacityBlacklist" />
+    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
+    <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="CAPACITY_CORLOR" jdbcType="VARCHAR" property="capacityCorlor" />
+    <result column="CAPACITY_VIP" jdbcType="VARCHAR" property="capacityVip" />
+    <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+  </resultMap>
+  <sql id="columns">
+    CAPACITY_ID, CAPACITY_NUMBER, CAPACITY_MAX_LOAD, CAPACITY_TYPE_ID, CAPACITY_STATUS, 
+    CARRIER_ID, CAPACITY_ENERGY_ID, CAPACITY_LEN_VAL, CAPACITY_WID_VAL, CAPACITY_HIG_VAL, 
+    CAPACITY_OIL_ID, CAPACITY_FUEL_CONSUMPTION, CAPACITY_OWNERIS, CAPACITY_BLACKLIST, 
+    MEMO, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+    CAPACITY_CORLOR, CAPACITY_VIP, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.CAPACITY_ID, t.CAPACITY_NUMBER, t.CAPACITY_MAX_LOAD, t.CAPACITY_TYPE_ID, t.CAPACITY_STATUS, 
+    t.CARRIER_ID, t.CAPACITY_ENERGY_ID, t.CAPACITY_LEN_VAL, t.CAPACITY_WID_VAL, t.CAPACITY_HIG_VAL, 
+    t.CAPACITY_OIL_ID, t.CAPACITY_FUEL_CONSUMPTION, t.CAPACITY_OWNERIS, t.CAPACITY_BLACKLIST, 
+    t.MEMO, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
+    t.CAPACITY_CORLOR, t.CAPACITY_VIP, t.DELETED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM RMS_CAPACITY
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM RMS_CAPACITY t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="capacityId != null">
+        and CAPACITY_ID = #{capacityId}
+      </if>
+      <if test="capacityNumber != null and capacityNumber != ''">
+        and CAPACITY_NUMBER = #{capacityNumber}
+      </if>
+      <if test="capacityMaxLoad != null">
+        and CAPACITY_MAX_LOAD = #{capacityMaxLoad}
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="capacityStatus != null">
+        and CAPACITY_STATUS = #{capacityStatus}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="capacityEnergyId != null and capacityEnergyId != ''">
+        and CAPACITY_ENERGY_ID = #{capacityEnergyId}
+      </if>
+      <if test="capacityLenVal != null">
+        and CAPACITY_LEN_VAL = #{capacityLenVal}
+      </if>
+      <if test="capacityWidVal != null">
+        and CAPACITY_WID_VAL = #{capacityWidVal}
+      </if>
+      <if test="capacityHigVal != null">
+        and CAPACITY_HIG_VAL = #{capacityHigVal}
+      </if>
+      <if test="capacityOilId != null">
+        and CAPACITY_OIL_ID = #{capacityOilId}
+      </if>
+      <if test="capacityFuelConsumption != null and capacityFuelConsumption != ''">
+        and CAPACITY_FUEL_CONSUMPTION = #{capacityFuelConsumption}
+      </if>
+      <if test="capacityOwneris != null">
+        and CAPACITY_OWNERIS = #{capacityOwneris}
+      </if>
+      <if test="capacityBlacklist != null">
+        and CAPACITY_BLACKLIST = #{capacityBlacklist}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO = #{memo}
+      </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="capacityCorlor != null and capacityCorlor != ''">
+        and CAPACITY_CORLOR = #{capacityCorlor}
+      </if>
+      <if test="capacityVip != null and capacityVip != ''">
+        and CAPACITY_VIP = #{capacityVip}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="capacityId != null">
+        and CAPACITY_ID = #{capacityId}
+      </if>
+      <if test="capacityNumber != null and capacityNumber != ''">
+        and CAPACITY_NUMBER LIKE '%${capacityNumber}%'
+      </if>
+      <if test="capacityMaxLoad != null">
+        and CAPACITY_MAX_LOAD = #{capacityMaxLoad}
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="capacityStatus != null">
+        and CAPACITY_STATUS = #{capacityStatus}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="capacityEnergyId != null and capacityEnergyId != ''">
+        and CAPACITY_ENERGY_ID LIKE '%${capacityEnergyId}%'
+      </if>
+      <if test="capacityLenVal != null">
+        and CAPACITY_LEN_VAL = #{capacityLenVal}
+      </if>
+      <if test="capacityWidVal != null">
+        and CAPACITY_WID_VAL = #{capacityWidVal}
+      </if>
+      <if test="capacityHigVal != null">
+        and CAPACITY_HIG_VAL = #{capacityHigVal}
+      </if>
+      <if test="capacityOilId != null">
+        and CAPACITY_OIL_ID = #{capacityOilId}
+      </if>
+      <if test="capacityFuelConsumption != null and capacityFuelConsumption != ''">
+        and CAPACITY_FUEL_CONSUMPTION LIKE '%${capacityFuelConsumption}%'
+      </if>
+      <if test="capacityOwneris != null">
+        and CAPACITY_OWNERIS = #{capacityOwneris}
+      </if>
+      <if test="capacityBlacklist != null">
+        and CAPACITY_BLACKLIST = #{capacityBlacklist}
+      </if>
+      <if test="memo != null and memo != ''">
+        and MEMO LIKE '%${memo}%'
+      </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="capacityCorlor != null and capacityCorlor != ''">
+        and CAPACITY_CORLOR LIKE '%${capacityCorlor}%'
+      </if>
+      <if test="capacityVip != null and capacityVip != ''">
+        and CAPACITY_VIP LIKE '%${capacityVip}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    delete from RMS_CAPACITY
+    where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from RMS_CAPACITY
+    where 1!=1 
+      <if test="capacityNumber != null and capacityNumber != ''">
+        or CAPACITY_NUMBER = #{capacityNumber}
+      </if>
+      <if test="capacityMaxLoad != null">
+        or CAPACITY_MAX_LOAD = #{capacityMaxLoad}
+      </if>
+      <if test="capacityTypeId != null">
+        or CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="capacityStatus != null">
+        or CAPACITY_STATUS = #{capacityStatus}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="capacityEnergyId != null and capacityEnergyId != ''">
+        or CAPACITY_ENERGY_ID = #{capacityEnergyId}
+      </if>
+      <if test="capacityLenVal != null">
+        or CAPACITY_LEN_VAL = #{capacityLenVal}
+      </if>
+      <if test="capacityWidVal != null">
+        or CAPACITY_WID_VAL = #{capacityWidVal}
+      </if>
+      <if test="capacityHigVal != null">
+        or CAPACITY_HIG_VAL = #{capacityHigVal}
+      </if>
+      <if test="capacityOilId != null">
+        or CAPACITY_OIL_ID = #{capacityOilId}
+      </if>
+      <if test="capacityFuelConsumption != null and capacityFuelConsumption != ''">
+        or CAPACITY_FUEL_CONSUMPTION = #{capacityFuelConsumption}
+      </if>
+      <if test="capacityOwneris != null">
+        or CAPACITY_OWNERIS = #{capacityOwneris}
+      </if>
+      <if test="capacityBlacklist != null">
+        or CAPACITY_BLACKLIST = #{capacityBlacklist}
+      </if>
+      <if test="memo != null and memo != ''">
+        or MEMO = #{memo}
+      </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="capacityCorlor != null and capacityCorlor != ''">
+        or CAPACITY_CORLOR = #{capacityCorlor}
+      </if>
+      <if test="capacityVip != null and capacityVip != ''">
+        or CAPACITY_VIP = #{capacityVip}
+      </if>
+      <if test="deleted != null">
+        or DELETED = #{deleted}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.RmsCapacity">
+    insert into RMS_CAPACITY (CAPACITY_ID, CAPACITY_NUMBER, CAPACITY_MAX_LOAD, 
+      CAPACITY_TYPE_ID, CAPACITY_STATUS, CARRIER_ID, 
+      CAPACITY_ENERGY_ID, CAPACITY_LEN_VAL, CAPACITY_WID_VAL, 
+      CAPACITY_HIG_VAL, CAPACITY_OIL_ID, CAPACITY_FUEL_CONSUMPTION, 
+      CAPACITY_OWNERIS, CAPACITY_BLACKLIST, MEMO, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, CAPACITY_CORLOR, 
+      CAPACITY_VIP, DELETED)
+    values (#{capacityId,jdbcType=DECIMAL}, #{capacityNumber,jdbcType=VARCHAR}, #{capacityMaxLoad,jdbcType=DECIMAL}, 
+      #{capacityTypeId,jdbcType=DECIMAL}, #{capacityStatus,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
+      #{capacityEnergyId,jdbcType=VARCHAR}, #{capacityLenVal,jdbcType=DECIMAL}, #{capacityWidVal,jdbcType=DECIMAL}, 
+      #{capacityHigVal,jdbcType=DECIMAL}, #{capacityOilId,jdbcType=DECIMAL}, #{capacityFuelConsumption,jdbcType=VARCHAR}, 
+      #{capacityOwneris,jdbcType=DECIMAL}, #{capacityBlacklist,jdbcType=DECIMAL}, #{memo,jdbcType=VARCHAR}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{capacityCorlor,jdbcType=VARCHAR}, 
+      #{capacityVip,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsCapacity">
+    insert into RMS_CAPACITY
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="capacityId != null">
+        CAPACITY_ID,
+      </if>
+      <if test="capacityNumber != null">
+        CAPACITY_NUMBER,
+      </if>
+      <if test="capacityMaxLoad != null">
+        CAPACITY_MAX_LOAD,
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID,
+      </if>
+      <if test="capacityStatus != null">
+        CAPACITY_STATUS,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="capacityEnergyId != null">
+        CAPACITY_ENERGY_ID,
+      </if>
+      <if test="capacityLenVal != null">
+        CAPACITY_LEN_VAL,
+      </if>
+      <if test="capacityWidVal != null">
+        CAPACITY_WID_VAL,
+      </if>
+      <if test="capacityHigVal != null">
+        CAPACITY_HIG_VAL,
+      </if>
+      <if test="capacityOilId != null">
+        CAPACITY_OIL_ID,
+      </if>
+      <if test="capacityFuelConsumption != null">
+        CAPACITY_FUEL_CONSUMPTION,
+      </if>
+      <if test="capacityOwneris != null">
+        CAPACITY_OWNERIS,
+      </if>
+      <if test="capacityBlacklist != null">
+        CAPACITY_BLACKLIST,
+      </if>
+      <if test="memo != null">
+        MEMO,
+      </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="capacityCorlor != null">
+        CAPACITY_CORLOR,
+      </if>
+      <if test="capacityVip != null">
+        CAPACITY_VIP,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="capacityId != null">
+        #{capacityId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityNumber != null">
+        #{capacityNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityMaxLoad != null">
+        #{capacityMaxLoad,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityTypeId != null">
+        #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityStatus != null">
+        #{capacityStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityEnergyId != null">
+        #{capacityEnergyId,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityLenVal != null">
+        #{capacityLenVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityWidVal != null">
+        #{capacityWidVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityHigVal != null">
+        #{capacityHigVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityOilId != null">
+        #{capacityOilId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityFuelConsumption != null">
+        #{capacityFuelConsumption,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityOwneris != null">
+        #{capacityOwneris,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityBlacklist != null">
+        #{capacityBlacklist,jdbcType=DECIMAL},
+      </if>
+      <if test="memo != null">
+        #{memo,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="capacityCorlor != null">
+        #{capacityCorlor,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityVip != null">
+        #{capacityVip,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsCapacity">
+    update RMS_CAPACITY
+    set CAPACITY_NUMBER = #{capacityNumber,jdbcType=VARCHAR},
+      CAPACITY_MAX_LOAD = #{capacityMaxLoad,jdbcType=DECIMAL},
+      CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+      CAPACITY_STATUS = #{capacityStatus,jdbcType=DECIMAL},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      CAPACITY_ENERGY_ID = #{capacityEnergyId,jdbcType=VARCHAR},
+      CAPACITY_LEN_VAL = #{capacityLenVal,jdbcType=DECIMAL},
+      CAPACITY_WID_VAL = #{capacityWidVal,jdbcType=DECIMAL},
+      CAPACITY_HIG_VAL = #{capacityHigVal,jdbcType=DECIMAL},
+      CAPACITY_OIL_ID = #{capacityOilId,jdbcType=DECIMAL},
+      CAPACITY_FUEL_CONSUMPTION = #{capacityFuelConsumption,jdbcType=VARCHAR},
+      CAPACITY_OWNERIS = #{capacityOwneris,jdbcType=DECIMAL},
+      CAPACITY_BLACKLIST = #{capacityBlacklist,jdbcType=DECIMAL},
+      MEMO = #{memo,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},
+      CAPACITY_CORLOR = #{capacityCorlor,jdbcType=VARCHAR},
+      CAPACITY_VIP = #{capacityVip,jdbcType=VARCHAR},
+      DELETED = #{deleted,jdbcType=DECIMAL}
+    where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsCapacity">
+    update RMS_CAPACITY
+    <set>
+      <if test="capacityNumber != null">
+        CAPACITY_NUMBER = #{capacityNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityMaxLoad != null">
+        CAPACITY_MAX_LOAD = #{capacityMaxLoad,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityStatus != null">
+        CAPACITY_STATUS = #{capacityStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityEnergyId != null">
+        CAPACITY_ENERGY_ID = #{capacityEnergyId,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityLenVal != null">
+        CAPACITY_LEN_VAL = #{capacityLenVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityWidVal != null">
+        CAPACITY_WID_VAL = #{capacityWidVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityHigVal != null">
+        CAPACITY_HIG_VAL = #{capacityHigVal,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityOilId != null">
+        CAPACITY_OIL_ID = #{capacityOilId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityFuelConsumption != null">
+        CAPACITY_FUEL_CONSUMPTION = #{capacityFuelConsumption,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityOwneris != null">
+        CAPACITY_OWNERIS = #{capacityOwneris,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityBlacklist != null">
+        CAPACITY_BLACKLIST = #{capacityBlacklist,jdbcType=DECIMAL},
+      </if>
+      <if test="memo != null">
+        MEMO = #{memo,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="capacityCorlor != null">
+        CAPACITY_CORLOR = #{capacityCorlor,jdbcType=VARCHAR},
+      </if>
+      <if test="capacityVip != null">
+        CAPACITY_VIP = #{capacityVip,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <include refid="select" />
+    where CAPACITY_ID = #{capacityId,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_CAPACITY 
+      (CAPACITY_ID, 
+      CAPACITY_NUMBER, CAPACITY_MAX_LOAD, 
+      CAPACITY_TYPE_ID, CAPACITY_STATUS, 
+      CARRIER_ID, CAPACITY_ENERGY_ID, 
+      CAPACITY_LEN_VAL, CAPACITY_WID_VAL, 
+      CAPACITY_HIG_VAL, CAPACITY_OIL_ID, 
+      CAPACITY_FUEL_CONSUMPTION, CAPACITY_OWNERIS, 
+      CAPACITY_BLACKLIST, MEMO, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      CAPACITY_CORLOR, CAPACITY_VIP, 
+      DELETED)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.capacityId,jdbcType=DECIMAL}, 
+      #{item.capacityNumber,jdbcType=VARCHAR}, #{item.capacityMaxLoad,jdbcType=DECIMAL}, 
+      #{item.capacityTypeId,jdbcType=DECIMAL}, #{item.capacityStatus,jdbcType=DECIMAL}, 
+      #{item.carrierId,jdbcType=DECIMAL}, #{item.capacityEnergyId,jdbcType=VARCHAR}, 
+      #{item.capacityLenVal,jdbcType=DECIMAL}, #{item.capacityWidVal,jdbcType=DECIMAL}, 
+      #{item.capacityHigVal,jdbcType=DECIMAL}, #{item.capacityOilId,jdbcType=DECIMAL}, 
+      #{item.capacityFuelConsumption,jdbcType=VARCHAR}, #{item.capacityOwneris,jdbcType=DECIMAL}, 
+      #{item.capacityBlacklist,jdbcType=DECIMAL}, #{item.memo,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.capacityCorlor,jdbcType=VARCHAR}, #{item.capacityVip,jdbcType=VARCHAR}, 
+      #{item.deleted,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update RMS_CAPACITY
+     set
+       CAPACITY_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_NUMBER=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityNumber,jdbcType=VARCHAR}
+       </foreach>
+       ,CAPACITY_MAX_LOAD=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityMaxLoad,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_TYPE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_STATUS=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityStatus,jdbcType=DECIMAL}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_ENERGY_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityEnergyId,jdbcType=VARCHAR}
+       </foreach>
+       ,CAPACITY_LEN_VAL=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityLenVal,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_WID_VAL=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityWidVal,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_HIG_VAL=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityHigVal,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_OIL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityOilId,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_FUEL_CONSUMPTION=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityFuelConsumption,jdbcType=VARCHAR}
+       </foreach>
+       ,CAPACITY_OWNERIS=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityOwneris,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_BLACKLIST=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityBlacklist,jdbcType=DECIMAL}
+       </foreach>
+       ,MEMO=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.memo,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,CAPACITY_CORLOR=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityCorlor,jdbcType=VARCHAR}
+       </foreach>
+       ,CAPACITY_VIP=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacityVip,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+     where CAPACITY_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.capacityId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from RMS_CAPACITY
+    where CAPACITY_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+ 
+  
+</mapper>

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

@@ -836,7 +836,7 @@
         WHERE RESULT_ID = #{resultId}
     </select>
 
-  <!-- 通过外轮船名和物资名称得到批次id -->
+    <!-- 通过外轮船名和物资名称得到批次id -->
     <select id="getBatchId" parameterType="java.util.Map" resultType="DECIMAL">
         SELECT BATCH_ID
         FROM DIL_BATCH db
@@ -845,4 +845,18 @@
         WHERE rm.MATERIAL_NAME = #{materialName}
           AND db.RESULT_FOREIGN_SHIP_NAME = #{resultForeignShipName}
     </select>
+
+    <!-- 得到码头和港口 -->
+    <select id="getPortAndPier" parameterType="DECIMAL" resultType="java.util.Map">
+        SELECT ADN.PORT_ID              AS "startPortId",
+               ADA.DOWN_SWIM_PORT_ID    AS "arrivePortId",
+               ACTR.GROUP_ID            AS "pierId",
+               ADN.NOTICE_DELIVERY_TIME AS "noticeDeliveryTime"
+        FROM AMSSHIP_DELIVERY_NOTICE ADN
+                 LEFT JOIN AMSSHIP_DELIVERY_ATTORNEY ADA
+                           ON ADA.BATCH_ID = ADN.BATCH_ID
+                 LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT ACTR
+                           ON ACTR.BATCH_ID = ADN.BATCH_ID
+        WHERE ADA.BATCH_ID = #{batchId}
+    </select>
 </mapper>

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

@@ -511,7 +511,8 @@
         SELECT db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
         rm.MATERIAL_NAME as "materialName",
         rc.CAPACITY_NUMBER as "capacityNumber",
-        oic.INSTRUCTIONS_CAPACITY_ID as "orderId"
+        oic.INSTRUCTIONS_CAPACITY_ID as "orderId",
+        db.BATCH_ID as "batchId"
         FROM OMSSHIP_INSTRUCTIONS_CAPACITY oic
         LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS osi
         ON oic.INSTRUCTIONS_ID = osi.SHIPMENT_INSTRUCTIONS_ID

+ 11 - 0
src/main/resources/com/steerinfo/dil/mapper/TmsshipWaterQualityResultMapper.xml

@@ -741,4 +741,15 @@
         FROM OMSSHIP_INSTRUCTIONS_CAPACITY
         WHERE INSTRUCTIONS_CAPACITY_ID = #{orderId}
     </select>
+
+    <!-- 得到放货日期 -->
+    <select id="getDeliveryDate" parameterType="DECIMAL" resultType="java.util.Date">
+        SELECT ACTR.RESULT_DATE_OF_LOANS AS "resultEsDeliveryDate"
+        FROM OMSSHIP_INSTRUCTIONS_CAPACITY OIC
+                 LEFT JOIN OMSSHIP_SHIPMENT_INSTRUCTIONS OSI
+                           ON OSI.SHIPMENT_INSTRUCTIONS_ID = OIC.INSTRUCTIONS_ID
+                 LEFT JOIN AMSSHIP_CARGO_TRANSFER_RESULT ACTR
+                           ON ACTR.BATCH_ID = OSI.BATCH_ID
+        WHERE OIC.INSTRUCTIONS_CAPACITY_ID = #{orderId}
+    </select>
 </mapper>