zx 2 anos atrás
pai
commit
e0db63f206

+ 4 - 4
pom.xml

@@ -105,13 +105,13 @@
                 <artifactId>generator-maven-plugin</artifactId>
                 <version>3.0</version>
                 <configuration>
-                    <connUrl>jdbc:oracle:thin:@192.168.1.51:1521:steerinfo</connUrl>
-                    <user>DIL0901</user>
-                    <password>st#0901</password>
+                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
+                    <user>dil</user>
+                    <password>Dil123789</password>
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>BMSPORT_HANDLING_FEE</param><!--运力-->
+                        <param>BMSSHIP_FEE</param><!--运力-->
                     </tables>
                 </configuration>
                 <executions>

+ 121 - 10
src/main/java/com/steerinfo/dil/controller/BmsportHandlingFeeController.java

@@ -4,9 +4,7 @@ import com.steerinfo.dil.model.BmsportHandlingFee;
 import com.steerinfo.dil.service.impl.BmsportHandlingFeeServiceImpl;
 import com.steerinfo.dil.service.impl.BmsshipStatementServiceImpl;
 import com.steerinfo.dil.service.impl.BmstruckFormulaServiceImpl;
-import com.steerinfo.dil.util.BaseRESTfulController;
-import com.steerinfo.dil.util.ColumnDataUtil;
-import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.dil.util.*;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
 import io.swagger.annotations.ApiImplicitParam;
@@ -14,10 +12,13 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,6 +41,9 @@ public class BmsportHandlingFeeController extends BaseRESTfulController {
     BmstruckFormulaServiceImpl bmstruckFormulaService;
     @Autowired
     ColumnDataUtil columnDataUtil;
+    @Autowired
+    private ImageFileUtils imageFileUtils;
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     /**
      * 展示港口装卸费结算信息
@@ -110,21 +114,128 @@ public class BmsportHandlingFeeController extends BaseRESTfulController {
         return success(code1);
     }
 
+
+
+
+    @ApiModelProperty(value = "修改港口装卸费结算")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "map", value = "港口装卸费字段", required = false, dataType = "java.util.List"),
+    })
+    @PostMapping("/updatePortHandlingFee")
+    public RESTfulResult updatePortHandlingFee(@RequestBody Map<String,Object> map) throws Exception {
+        int code1 = bmsportHandlingFeeService.updatePortHandlingFee(map);
+        if (code1==-2){
+            return  failed("费用不一致,请仔细核对数据是否更改");
+        }
+        return success(code1);
+    }
+
     /**
-     * 修改港口装卸费结算
-     * @param bmsportHandlingFee
+     * 新增港口装卸费结算
+     * @param map
      * @return
      */
-    @ApiModelProperty(value = "修改港口装卸费结算")
+    @ApiModelProperty(value = "新增二程船装卸费用")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "bmsportHandlingFee", value = "港口装卸费", required = false, dataType = "BmsportHandlingFee"),
+            @ApiImplicitParam(name = "map", value = "港口装卸费字段", required = false, dataType = "java.util.List"),
     })
-    @PostMapping("/updatePortHandlingFee")
-    public RESTfulResult updatePortHandlingFee(@RequestBody BmsportHandlingFee bmsportHandlingFee){
-        int code1 = bmsportHandlingFeeService.update(bmsportHandlingFee);
+    @PostMapping("/addPortHandlingFeeSecond")
+    public RESTfulResult addPortHandlingFeeSecond(@RequestBody Map<String,Object> map) throws Exception {
+        int code1 = bmsportHandlingFeeService.addPortHandlingFeeSecond(map);
+        if (code1==-2){
+            return failed("费用不一致,请仔细核对数据是否更改");
+        }
+        return success(code1);
+    }
+
+    @ApiModelProperty(value = "展示二程装卸费用")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "map", value = "港口装卸费字段", required = false, dataType = "java.util.List"),
+            @ApiImplicitParam(name = "apiId", value = "501", required = false, dataType = "java.lang.Integer"),
+    })
+    @PostMapping("/selectPortFeeSecondList")
+    public RESTfulResult selectPortFeeSecondList(@RequestBody Map<String,Object> map,
+                                                 Integer pageNum,
+                                                 Integer pageSize,
+                                                 Integer apiId,
+                                                 Integer feeType,
+                                                 String startTime,
+                                                 String endTime)
+      {
+          DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+         map.put("feeType",feeType);
+         PageHelper.startPage(pageNum, pageSize);
+         //分页查询数据
+        List<Map<String, Object>> columnList = bmsportHandlingFeeService.selectPortFeeSecondList(map);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
+        return success(data);
+    }
+
+
+    //处理水运单
+    @PostMapping(value = "/uploadBmsshipOrder",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public RESTfulResult uploadBmsshipOrder(@RequestParam("file") MultipartFile multipartFile) throws Exception {
+        String url = imageFileUtils.updateFile(multipartFile);
+        return success(url);
+    }
+
+    //处理水运单
+    @PostMapping(value = "/getBmsshipFee/{id}")
+    public RESTfulResult getBmsshipFee(@PathVariable("id") Integer id)  {
+        List<Map<String,Object>> list=bmsportHandlingFeeService.getBmsshipFee(id);
+        return success(list);
+    }
+
+
+
+
+
+    //获取水运单的图片
+    @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的bmsportHandlingFee信息来更新详细信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
+    })
+    @PostMapping(value = "/downloadBmsshipOrder", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult downloadBmsshipOrder(@RequestParam Integer resultId) {
+        String BmsshipOrderPic = bmsportHandlingFeeService.downloadBmsshipOrder(resultId);
+        String photo = null;
+        try {
+            photo = imageFileUtils.downloadFile(BmsshipOrderPic).toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return success(photo);
+    }
+
+
+    @ApiModelProperty(value = "逻辑删除港口装卸费结算")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "feeId", value = "主键id", required = false, dataType = "java.util.List"),
+    })
+    @PostMapping("/deletePortHandlingFeeSecond/{feeId}")
+    public RESTfulResult deletePortHandlingFeeSecond(@PathVariable("feeId") BigDecimal feeId){
+        int code1 = bmsportHandlingFeeService.deletePortHandlingFeeSecond(feeId);
         return success(code1);
     }
 
+
+
+//
+//    /**
+//     * 修改港口装卸费结算
+//     * @param bmsportHandlingFee
+//     * @return
+//     */
+//    @ApiModelProperty(value = "修改港口装卸费结算")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "bmsportHandlingFee", value = "港口装卸费", required = false, dataType = "BmsportHandlingFee"),
+//    })
+//    @PostMapping("/updatePortHandlingFee")
+//    public RESTfulResult updatePortHandlingFee(@RequestBody BmsportHandlingFee bmsportHandlingFee){
+//        int code1 = bmsportHandlingFeeService.update(bmsportHandlingFee);
+//        return success(code1);
+//    }
+
     /**
      * 查询修改数据渲染表单
      * @param feeId

+ 1 - 1
src/main/java/com/steerinfo/dil/feign/ColumnDataFeign.java

@@ -12,7 +12,7 @@ import java.util.Map;
  * @Date 2021/6/23 9:58
  * @Version 1.0
  */
-@FeignClient(value = "DIL-COLUMN-DATA-DEV",url = "192.168.0.106:8083")
+@FeignClient(value = "DIL-COLUMN-DATA-DEV",url = "${openFeign.ColumnDataFeign.url}")
 public interface ColumnDataFeign {
     @RequestMapping("getColumnData")
     List<Map<String,Object>> getColumnData(@RequestParam("apiId") Integer apiId);

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

@@ -47,4 +47,11 @@ public interface BmsportHandlingFeeMapper extends IBaseMapper<BmsportHandlingFee
      * @return
      */
     List<Map<String, Object>> selectPriceId();
+
+    List<Map<String, Object>> selectPortFeeSecondList(Map<String, Object> map);
+
+    String downloadBmsshipOrder(Integer resultId);
+
+    //根据id渲染数据
+    List<Map<String, Object>> getBmsshipFee(Integer id);
 }

+ 18 - 0
src/main/java/com/steerinfo/dil/mapper/BmsshipFeeMapper.java

@@ -0,0 +1,18 @@
+package com.steerinfo.dil.mapper;
+
+
+import com.steerinfo.dil.model.BmsshipDetailsOrder;
+import com.steerinfo.dil.model.BmsshipFee;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface BmsshipFeeMapper extends IBaseMapper<BmsshipFee, BigDecimal> {
+    //生成主键id
+    @Select("select sql_BMSSHIP_FEE.nextval from dual")
+   BigDecimal MaxId();
+
+   String getPersonnelNameByUserId(String userId);
+}

+ 320 - 0
src/main/java/com/steerinfo/dil/model/BmsshipFee.java

@@ -0,0 +1,320 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="null")
+public class BmsshipFee implements IBasePO<BigDecimal> {
+    /**
+     * 主键id(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键id",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 费用(FEE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="费用",required=false)
+    private BigDecimal fee;
+
+    /**
+     * 费用类型(1:二程船水运费;2:二程船装卸费;
+     3:三程船水运费;4:三程船装卸费;5:水分检测费;
+     6:进口矿火运费;7:国产矿火运费)(FEE_TYPE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="费用类型(1:二程船水运费;2:二程船装卸费;3:三程船水运费;4:三程船装卸费;5:水分检测费;6:进口矿火运费;7:国产矿火运费)",required=false)
+    private BigDecimal feeType;
+
+    /**
+     * 采购订单ID(PURCHASE_ORDER_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="采购订单ID",required=false)
+    private BigDecimal purchaseOrderId;
+
+    /**
+     * 批次ID(BATCH_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="批次ID",required=false)
+    private BigDecimal batchId;
+
+    /**
+     * 实装吨位(REAL_TONNAGE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="实装吨位",required=false)
+    private BigDecimal realTonnage;
+
+    /**
+     * 单价(UNIT_PRICE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="单价",required=false)
+    private BigDecimal unitPrice;
+
+    /**
+     * 单价ID(UNIT_PRICE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="单价ID",required=false)
+    private BigDecimal unitPriceId;
+
+    /**
+     * 备注(RESULT_REMARKS,VARCHAR,100)
+     */
+    @ApiModelProperty(value="备注",required=false)
+    private String resultRemarks;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 是否删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="是否删除",required=false)
+    private BigDecimal deleted;
+
+    /**
+     * 水运单图片(IMAGE,VARCHAR,255)
+     */
+    @ApiModelProperty(value="水运单图片",required=false)
+    private String image;
+
+    /**
+     * 车皮数量(WAGON_NUMBER,DECIMAL,38)
+     */
+    @ApiModelProperty(value="车皮数量",required=false)
+    private BigDecimal wagonNumber;
+
+    /**
+     * 开票日期(MAKE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="开票日期",required=false)
+    private Date makeTime;
+
+    /**
+     * 港口ID(PORT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="港口ID",required=false)
+    private BigDecimal portId;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getFee() {
+        return fee;
+    }
+
+    public void setFee(BigDecimal fee) {
+        this.fee = fee;
+    }
+
+    public BigDecimal getFeeType() {
+        return feeType;
+    }
+
+    public void setFeeType(BigDecimal feeType) {
+        this.feeType = feeType;
+    }
+
+    public BigDecimal getPurchaseOrderId() {
+        return purchaseOrderId;
+    }
+
+    public void setPurchaseOrderId(BigDecimal purchaseOrderId) {
+        this.purchaseOrderId = purchaseOrderId;
+    }
+
+    public BigDecimal getBatchId() {
+        return batchId;
+    }
+
+    public void setBatchId(BigDecimal batchId) {
+        this.batchId = batchId;
+    }
+
+    public BigDecimal getRealTonnage() {
+        return realTonnage;
+    }
+
+    public void setRealTonnage(BigDecimal realTonnage) {
+        this.realTonnage = realTonnage;
+    }
+
+    public BigDecimal getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(BigDecimal unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public BigDecimal getUnitPriceId() {
+        return unitPriceId;
+    }
+
+    public void setUnitPriceId(BigDecimal unitPriceId) {
+        this.unitPriceId = unitPriceId;
+    }
+
+    public String getResultRemarks() {
+        return resultRemarks;
+    }
+
+    public void setResultRemarks(String resultRemarks) {
+        this.resultRemarks = resultRemarks == null ? null : resultRemarks.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    public String getImage() {
+        return image;
+    }
+
+    public void setImage(String image) {
+        this.image = image == null ? null : image.trim();
+    }
+
+    public BigDecimal getWagonNumber() {
+        return wagonNumber;
+    }
+
+    public void setWagonNumber(BigDecimal wagonNumber) {
+        this.wagonNumber = wagonNumber;
+    }
+
+    public Date getMakeTime() {
+        return makeTime;
+    }
+
+    public void setMakeTime(Date makeTime) {
+        this.makeTime = makeTime;
+    }
+
+    public BigDecimal getPortId() {
+        return portId;
+    }
+
+    public void setPortId(BigDecimal portId) {
+        this.portId = portId;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", fee=").append(fee);
+        sb.append(", feeType=").append(feeType);
+        sb.append(", purchaseOrderId=").append(purchaseOrderId);
+        sb.append(", batchId=").append(batchId);
+        sb.append(", realTonnage=").append(realTonnage);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", unitPriceId=").append(unitPriceId);
+        sb.append(", resultRemarks=").append(resultRemarks);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", image=").append(image);
+        sb.append(", wagonNumber=").append(wagonNumber);
+        sb.append(", makeTime=").append(makeTime);
+        sb.append(", portId=").append(portId);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 16 - 0
src/main/java/com/steerinfo/dil/service/IBmsportHandlingFeeService.java

@@ -65,4 +65,20 @@ public interface IBmsportHandlingFeeService {
      * @return
      */
     List<Map<String, Object>> getPriceId();
+
+
+    //新增二程船装卸费
+    int addPortHandlingFeeSecond(Map<String, Object> map);
+
+    //展示二程船装卸费用
+    List<Map<String, Object>> selectPortFeeSecondList(Map<String, Object> map);
+
+    //根据实绩查找数据库存取的地址
+    String downloadBmsshipOrder(Integer resultId);
+
+    List<Map<String, Object>> getBmsshipFee(Integer id);
+
+    int updatePortHandlingFee(Map<String, Object> map);
+
+    int deletePortHandlingFeeSecond(BigDecimal feeId);
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/service/IBmsshipStatementService.java

@@ -82,4 +82,7 @@ public interface IBmsshipStatementService {
      * @return
      */
     List<Map<String,Object>> getBatch(Map<String,Object> mapVal);
+
+
+
 }

+ 144 - 0
src/main/java/com/steerinfo/dil/service/impl/BmsportHandlingFeeServiceImpl.java

@@ -1,8 +1,11 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.BmsportHandlingFeeMapper;
+import com.steerinfo.dil.mapper.BmsshipFeeMapper;
 import com.steerinfo.dil.model.BmsportHandlingFee;
+import com.steerinfo.dil.model.BmsshipFee;
 import com.steerinfo.dil.service.IBmsportHandlingFeeService;
+import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -25,6 +28,8 @@ public class BmsportHandlingFeeServiceImpl implements IBmsportHandlingFeeService
     BmsportHandlingFeeMapper bmsportHandlingFeeMapper;
     @Autowired
     BmstruckFormulaServiceImpl bmstruckFormulaService;
+    @Autowired
+    BmsshipFeeMapper bmsshipFeeMapper;
 
     /**
      * 修改港口装卸费结算
@@ -133,4 +138,143 @@ public class BmsportHandlingFeeServiceImpl implements IBmsportHandlingFeeService
     public List<Map<String, Object>> getPriceId() {
         return bmsportHandlingFeeMapper.selectPriceId();
     }
+
+
+    @Override
+    public int addPortHandlingFeeSecond(Map<String, Object> map) {
+        //获取运输单价
+        BigDecimal Fee=null;
+        BigDecimal unitPrice = DataChange.dataToBigDecimal(map.get("unitPrice"));
+        //水运单总吨位
+        BigDecimal tonnage =DataChange.dataToBigDecimal(map.get("realTonnage"));
+        BigDecimal batchId =DataChange.dataToBigDecimal(map.get("batchId"));
+        BigDecimal purchaseOrderId =DataChange.dataToBigDecimal(map.get("purchaseOrderId"));
+        long makeTime =(long) map.get("makeTime");
+        //获取userId
+        String userId = (String) map.get("userId");
+        //根据userId查找姓名
+        String personnelName = bmsshipFeeMapper.getPersonnelNameByUserId(userId);
+        //单价*总吨位
+        BmsshipFee bmsshipFee =new BmsshipFee();
+        //获取主键id
+        bmsshipFee.setResultId(bmsshipFeeMapper.MaxId());
+        bmsshipFee.setRealTonnage(tonnage);
+        bmsshipFee.setFeeType(DataChange.dataToBigDecimal(map.get("feeType")));
+        bmsshipFee.setImage((String) map.get("image"));
+        bmsshipFee.setInsertTime(new Date());
+        bmsshipFee.setDeleted(new BigDecimal(0));
+        if (personnelName!=null) {
+            bmsshipFee.setInsertUsername(personnelName);
+        }else {
+            bmsshipFee.setInsertUsername(userId);
+        }
+        bmsshipFee.setMakeTime(new Date(makeTime));
+        bmsshipFee.setBatchId(batchId);
+        bmsshipFee.setPurchaseOrderId(purchaseOrderId);
+        //设置总运费
+        if (unitPrice!=null&&unitPrice.intValue()!=0) {
+             Fee = unitPrice.multiply(tonnage);
+            bmsshipFee.setUnitPrice(unitPrice);
+            bmsshipFee.setUnitPriceId(DataChange.dataToBigDecimal(map.get("unitPriceId")));
+            if (DataChange.dataToBigDecimal(map.get("fee")).compareTo(Fee) == 0) {
+                bmsshipFee.setFee(Fee);
+            } else {
+                return -2;
+            }
+        }else {
+            bmsshipFee.setFee(DataChange.dataToBigDecimal(map.get("fee")));
+        }
+        if (map.get("resultRemarks")!=null){
+            bmsshipFee.setInsertUpdateRemark((String) map.get("resultRemarks"));
+        }
+        int i = bmsshipFeeMapper.insertSelective(bmsshipFee);
+        return i;
+    }
+
+    @Override
+    public List<Map<String, Object>> selectPortFeeSecondList(Map<String, Object> map) {
+        List<Map<String, Object>> mapList = bmsportHandlingFeeMapper.selectPortFeeSecondList(map);
+        return mapList;
+    }
+
+    @Override
+    public String downloadBmsshipOrder(Integer resultId) {
+        return bmsportHandlingFeeMapper.downloadBmsshipOrder(resultId);
+    }
+
+    @Override
+    public List<Map<String, Object>> getBmsshipFee(Integer id) {
+        return bmsportHandlingFeeMapper.getBmsshipFee(id);
+    }
+
+    //修改港口装卸费
+    @Override
+    public int updatePortHandlingFee(Map<String, Object> map) {
+        BigDecimal purchaseOrderId=null;
+        BigDecimal resultId =DataChange.dataToBigDecimal(map.get("resultId"));
+        //水运单总吨位
+        BigDecimal tonnage =DataChange.dataToBigDecimal(map.get("realTonnage"));
+        if(map.get("purchaseOrderId")!=null) {
+             purchaseOrderId = DataChange.dataToBigDecimal(map.get("purchaseOrderId"));
+        }
+        long makeTime =(long) map.get("makeTime");
+        //获取userId
+        String userId = (String) map.get("userId");
+        //根据userId查找姓名
+        String personnelName = bmsshipFeeMapper.getPersonnelNameByUserId(userId);
+        //单价*总吨位
+        BmsshipFee bmsshipFee =new BmsshipFee();
+        //获取主键id
+        bmsshipFee.setResultId(resultId);
+        bmsshipFee.setRealTonnage(tonnage);
+        bmsshipFee.setFeeType(DataChange.dataToBigDecimal(map.get("feeType")));
+        bmsshipFee.setImage((String) map.get("image"));
+        bmsshipFee.setInsertTime(new Date());
+        bmsshipFee.setDeleted(new BigDecimal(0));
+        if (personnelName!=null) {
+            bmsshipFee.setInsertUsername(personnelName);
+        }else {
+            bmsshipFee.setInsertUsername(userId);
+        }
+
+        bmsshipFee.setMakeTime(new Date(makeTime));
+        if (map.get("batchId")!=null) {
+            BigDecimal batchId =DataChange.dataToBigDecimal(map.get("batchId"));
+            bmsshipFee.setBatchId(batchId);
+        }
+
+        bmsshipFee.setPurchaseOrderId(purchaseOrderId);
+        //设置总运费
+        //获取运输单价
+        if (map.get("unitPrice")!=null) {
+            BigDecimal unitPrice = DataChange.dataToBigDecimal(map.get("unitPrice"));
+            bmsshipFee.setUnitPrice(unitPrice);
+            if (map.get("unitPriceId") != null) {
+                bmsshipFee.setUnitPriceId(DataChange.dataToBigDecimal(map.get("unitPriceId")));
+            }
+            BigDecimal Fee = unitPrice.multiply(tonnage);
+            if (DataChange.dataToBigDecimal(map.get("fee")).compareTo(Fee) == 0) {
+                bmsshipFee.setFee(Fee);
+            } else {
+                return -2;
+            }
+        }else {
+            bmsshipFee.setFee(DataChange.dataToBigDecimal(map.get("fee")));
+        }
+        if (map.get("resultRemarks")!=null){
+            bmsshipFee.setInsertUpdateRemark((String) map.get("resultRemarks"));
+        }
+        int i = bmsshipFeeMapper.updateByPrimaryKeySelective(bmsshipFee);
+        return i;
+    }
+
+    @Override
+    public int deletePortHandlingFeeSecond(BigDecimal feeId) {
+        BmsshipFee bmsshipFee =new BmsshipFee();
+        bmsshipFee.setResultId(feeId);
+        bmsshipFee.setDeleted(new BigDecimal(1));
+        return bmsshipFeeMapper.updateByPrimaryKeySelective(bmsshipFee);
+    }
+
+
 }

+ 2 - 2
src/main/java/com/steerinfo/dil/util/ColumnDataUtil.java

@@ -28,8 +28,8 @@ public class ColumnDataUtil {
     public PageListAdd tableColumnData(Integer apiId, List<Map<String, Object>> list, List<Map<String,Object>> data) {
         List<Map<String, Object>> columnDataList = columnDataFeign.getColumnData(apiId);
         for (Map<String, Object> columnData : columnDataList) {
-            //每个表头字段的过滤条
-            columnData.put("filters", setListMap(list, columnData.get("prop").toString()));
+            //每个表头字段的过滤条
+            columnData.put("filters", setListMap(data, columnData.get("prop").toString()));
         }
         PageListAdd pageList = new PageListAdd(data);
         pageList.setColumnData(columnDataList);

+ 259 - 0
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -0,0 +1,259 @@
+package com.steerinfo.dil.util;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ author    :TXF
+ * @ time      :2021/8/25 11:25
+ */
+
+public class DataChange {
+    /**
+     * 解析前端传来的日期字符串
+     * @param vueDate
+     * @return
+     */
+    public static Date dataToDate(Object vueDate){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date parseDate = null;
+        if (vueDate != null){
+            try {
+                String date = (String) vueDate;
+                parseDate = sdf.parse(date);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+        return parseDate;
+    }
+
+    /**
+     * 数据转换成BigDecimal
+     * @param data
+     * @return
+     */
+    public static BigDecimal dataToBigDecimal(Object data){
+        if (data != null){
+            if(data instanceof BigDecimal){
+                return (BigDecimal) data;
+            }else{
+                String str = String.valueOf(data);
+                BigDecimal decimal = null;
+                if(!"".equals(str)){
+                    try {
+                        decimal = new BigDecimal(str);
+                    } catch (Exception e) {
+                        System.out.println(data + ":数据解析失败!返回0");
+                        return new BigDecimal(0);
+                    }
+                }
+                return decimal;
+            }
+        }
+        return new BigDecimal(0);
+    }
+
+    /**
+     * 将时间截取到天  为字符串类型 用于前端只显示到天
+     * @param date 传入时间
+     * @return
+     */
+    public static String dateToDayDate(Object date){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date changeDate = null;
+        if(date == null)
+            return null;
+        try{
+            changeDate = (Date) date;
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return sdf.format(changeDate);
+    }
+
+    /**
+     * 遍历从数据库中传进来的数据
+     * @param list 从数据库查询出来的list数据列表
+     * @param key map中多个需要转换的date参数
+     */
+    public static void changeDateToDayDate(List<Map<String, Object>> list, String ...key){
+        //遍历List
+        for (Map<String, Object> map : list) {
+            for (String s : key) {
+                //从map中取 date的值 并转换成字符串类型的日期
+                String stringDate = dateToDayDate(map.get(s));
+                if(stringDate.length() == 0){
+                    break;
+                }else {
+                    //修改map中的值
+                    map.put(s, stringDate);
+                }
+            }
+        }
+    }
+
+    /**
+     * 遍历列表使只显示两位小数
+     * @param list
+     * @param key
+     */
+    public static void dataTo2Number(List<Map<String, Object>> list, String ...key){
+        //遍历List
+        for (Map<String, Object> map : list) {
+            for (String s : key) {
+                //修改数据为带两位小数
+                try {
+                    BigDecimal oldDate = (BigDecimal) map.get(s);
+                    DecimalFormat df =  new DecimalFormat("0.00");
+                    String resultDeduction = df.format(oldDate.doubleValue());
+                    map.put(s, resultDeduction);
+                } catch (Exception e) {
+                    System.out.println("原料扣减量数据有误");
+                }
+
+            }
+        }
+    }
+
+    /**
+     * 计算相差时间  日时分秒
+     * @param
+     * @return
+     */
+    public static String calculatedTimeDifference(Date time1, Date time2){
+        long t1 = time1.getTime();
+        long t2 = time2.getTime();
+        if(t1 > t2){
+            long temp = t1;
+            t1 = t2;
+            t2 = temp;
+        }
+        long between = t2 - t1;
+        long day = between / (24 * 60 * 60 * 1000);
+        long hour = (between / (60 * 60 * 1000) - day * 24);
+        long min = ((between / (60 * 1000)) - day * 24 * 60 - hour * 60);
+        long s = (between / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
+        return day + "天"+  + hour+ "时" + min + "分"  + s + "秒";
+    }
+
+    /**
+     * 生成带时间的八位数顺序号
+     * @param start 前缀
+     * @param id 顺序号  主键Id
+     * @return
+     */
+    public static String generateEightDigitsNumber(String start, Integer id){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        StringBuilder sb = new StringBuilder(start + sdf.format(new Date()));
+        sb.append(
+                id < 10
+                        ? "0000000" + id : id < 100
+                        ? "000000" + id : id < 1000
+                        ? "00000" + id : id < 10000
+                        ? "0000" + id : id < 100000
+                        ? "000" + id : id < 1000000
+                        ? "00" + id : id < 10000000
+                        ? "0" + id : id.toString()
+        );
+        return sb.toString();
+    }
+
+    /**
+     * 根据时间段查询数据 支持只选择单个时间
+     * @Author TXF
+     * @Date 2022/1/10 23:21
+     * @param startTime
+     * @param endTime
+     * @param map
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDate(String startTime, String endTime, Map<String, Object> map, SimpleDateFormat sdf){
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime) + 86400000)));
+        } else if (startTime != null && !"null".equals(startTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(startTime))));
+        } else if (endTime != null && !"null".equals(endTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(endTime))));
+        } else {
+            map.put("oneDate", sdf.format(new Date()));
+        }
+    }
+
+    /**
+     * 只支持两个时间查询
+     * @Author TXF
+     * @Date 2022/1/15 9:08
+     * @param startTime
+     * @param endTime
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDateTime(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime))));
+        }
+        //如果开始时间和结束时间有且只有一个为空 则只查那天的数据
+        else if((startTime != null && !"null".equals(startTime)) || (endTime != null && !"null".equals(endTime))){
+            if(startTime != null && !"null".equals(startTime)){
+                queryDataByTwoDateSon(map, startTime, sdfDate);
+            }
+            if(endTime != null && !"null".equals(endTime)){
+                queryDataByTwoDateSon(map, endTime, sdfDate);
+            }
+        }else {
+            //如果两者时间都为空,则查询当天数据
+            String nowDate = sdfDate.format(new Date());
+            map.put("oneDate", nowDate + " 00:00:00");
+        }
+    }
+
+    /**
+     * 上面方法的儿子方法 如果只传入了一个时间 则查询那天的数据
+     * @Author TXF
+     * @Date 2022/1/17 16:17
+     * @param map
+     * @param time
+     * @param sdfDate
+     * @return
+     **/
+    private static void queryDataByTwoDateSon(Map<String, Object> map, String time, SimpleDateFormat sdfDate){
+        Date date1 = new Date(Long.parseLong(time));
+        Date date2 = new Date(Long.parseLong(time) + 86400000);
+        String dayStartTime = sdfDate.format(date1);
+        String dayEndTime = sdfDate.format(date2);
+        map.put("startDate", dayStartTime + " 00:00:00");
+        map.put("endDate", dayEndTime + " 00:00:00");
+    }
+
+    /**
+     * 生成带时间的八位数顺序号
+     * @param start 前缀
+     * @param id 顺序号  主键Id
+     * @return
+     */
+    public static String generateEightDigitsNumber(String start, Integer id,String pot){
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        StringBuilder sb = new StringBuilder(start + pot + sdf.format(new Date()) + pot);
+        sb.append(
+                id < 10
+                        ? "0000000" + id : id < 100
+                        ? "000000" + id : id < 1000
+                        ? "00000" + id : id < 10000
+                        ? "0000" + id : id < 100000
+                        ? "000" + id : id < 1000000
+                        ? "00" + id : id < 10000000
+                        ? "0" + id : id.toString()
+        );
+        return sb.toString();
+    }
+}

+ 12 - 0
src/main/java/com/steerinfo/dil/util/FileUtils.java

@@ -0,0 +1,12 @@
+package com.steerinfo.dil.util;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+public interface FileUtils {
+
+    public List<String> updateFiles(MultipartFile files[])throws Exception;
+
+     public Object downloadFile(String url) throws Exception;
+}

+ 232 - 0
src/main/java/com/steerinfo/dil/util/ImageFileUtils.java

@@ -0,0 +1,232 @@
+package com.steerinfo.dil.util;
+
+import com.steerinfo.framework.utils.misc.IdGenerator;
+import com.steerinfo.framework.utils.upload.UploadUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.*;
+
+@Component
+public class ImageFileUtils implements FileUtils {
+
+    @Value(value = "${piction.path:/shared}" )
+    private String path;
+
+    public static final HashMap fileTypes = new HashMap();
+
+    static {
+
+        // images
+
+        fileTypes.put("FFD8FF", "jpg");
+
+        fileTypes.put("89504E47", "png");
+
+        fileTypes.put("47494638", "gif");
+
+        fileTypes.put("49492A00", "tif");
+
+        fileTypes.put("424D", "bmp");
+
+        // CAD
+
+        fileTypes.put("41433130", "dwg");
+
+        fileTypes.put("38425053", "psd");
+
+        // 日记本
+
+        fileTypes.put("7B5C727466", "rtf");
+
+        fileTypes.put("3C3F786D6C", "xml");
+
+        fileTypes.put("68746D6C3E", "html");
+
+        // 邮件
+
+        fileTypes.put("44656C69766572792D646174653A", "eml");
+
+        fileTypes.put("D0CF11E0", "doc");
+
+        //excel2003版本文件
+
+        fileTypes.put("D0CF11E0", "xls");
+
+        fileTypes.put("5374616E64617264204A", "mdb");
+
+        fileTypes.put("252150532D41646F6265", "ps");
+
+        fileTypes.put("255044462D312E", "pdf");
+
+        fileTypes.put("504B0304", "docx");
+
+        //excel2007以上版本文件
+
+        fileTypes.put("504B0304", "xlsx");
+
+        fileTypes.put("52617221", "rar");
+
+        fileTypes.put("57415645", "wav");
+
+        fileTypes.put("41564920", "avi");
+
+        fileTypes.put("2E524D46", "rm");
+
+        fileTypes.put("000001BA", "mpg");
+
+        fileTypes.put("000001B3", "mpg");
+
+        fileTypes.put("6D6F6F76", "mov");
+
+        fileTypes.put("3026B2758E66CF11", "asf");
+
+        fileTypes.put("4D546864", "mid");
+
+        fileTypes.put("1F8B08", "gz");
+
+    }
+
+
+    /**
+     * 上传多张图片
+     * @param files
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public synchronized List<String> updateFiles(MultipartFile files[]) throws Exception {
+        //首先通过Calendard对象获得年月日
+        Calendar calendar= Calendar.getInstance();
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day= calendar.get(Calendar.DAY_OF_MONTH);
+        //上传文件夹路径
+        List<String> urls=new ArrayList<>();
+        for (int i=0;i<files.length;i++){
+            String url = UploadUtils.uploadFile(files[i], new IdGenerator(i, 10), path, File.separator+year+ File.separator+month+ File.separator+day+ File.separator);
+            urls.add(url);
+        }
+        return urls;
+    }
+
+
+    /**
+     * 上传单张图片
+     * @param file
+     * @return
+     * @throws Exception
+     */
+    public synchronized String updateFile(MultipartFile file) throws Exception {
+        //首先通过Calendard对象获得年月日
+        Calendar calendar= Calendar.getInstance();
+        int year = calendar.get(Calendar.YEAR);
+        int month = calendar.get(Calendar.MONTH);
+        int day= calendar.get(Calendar.DAY_OF_MONTH);
+        String url = UploadUtils.uploadFile(file, new IdGenerator(0, 10), path, File.separator+year+ File.separator+month+ File.separator+day+ File.separator);
+        return url;
+    }
+
+    /**
+     * 下载图片获得字节码
+     * @param filePath
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public Object downloadFile(String filePath) throws Exception {
+        File file = new File(filePath);
+        if(file.isDirectory()){
+            throw new RuntimeException("当前路径是目录");
+        }
+        byte[] b = bytes(file);
+        String type =getFileHeader(b);
+        String src="data:image/"+type+";base64,"+ Base64.getEncoder().encodeToString(b);
+        return src;
+    }
+
+
+
+
+    /**
+     * @return 文件头信息
+     * @author liang.pan
+     * <p>
+     * 方法描述:根据输入流获取文件头信息
+     */
+    public static String getFileHeader(byte[] b) {
+        String value = bytesToHexString(b);
+
+        if (StringUtils.startsWith(value, "FFD8FF")) {
+            value = value.substring(0, 6);
+        }
+
+        //判断什么类型的
+        Set set = fileTypes.keySet();
+        Iterator iterator = set.iterator();
+        while(iterator.hasNext()){
+            String key=iterator.next().toString();
+            if (value.contains(key)){
+                return fileTypes.get(key).toString();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @param src 要读取文件头信息的文件的byte数组
+     * @return 文件头信息
+     * @author liang.pan
+     * <p>
+     * 方法描述:将要读取文件头信息的文件的byte数组转换成string类型表示
+     */
+    private static String bytesToHexString(byte[] src) {
+        StringBuilder builder = new StringBuilder();
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        String hv;
+        for (int i = 0; i < src.length; i++) {
+            // 以十六进制(基数 16)无符号整数形式返回一个整数参数的字符串表示形式,并转换为大写
+            hv = Integer.toHexString(src[i] & 0xFF).toUpperCase();
+            if (hv.length() < 2) {
+                builder.append(0);
+            }
+            builder.append(hv);
+        }
+        return builder.toString();
+    }
+
+
+    public byte[] bytes(File file) throws Exception {
+        FileInputStream fin = new FileInputStream(file);
+        try {
+            //可能溢出,简单起见就不考虑太多,如果太大就要另外想办法,比如一次传入固定长度byte[]
+            byte[] bytes  = new byte[fin.available()];
+            //将文件内容写入字节数组,提供测试的case
+            fin.read(bytes);
+            fin.close();
+            return bytes;
+        }catch (Exception ex){
+            throw ex;
+        }
+        finally {
+            if (null != fin) {
+
+                try {
+
+                    fin.close();
+
+                } catch (IOException e) {
+
+                }
+
+            }
+        }
+    }
+}

+ 8 - 4
src/main/resources/application-dev.yml

@@ -1,9 +1,13 @@
 spring:
   datasource:
-    url: jdbc:oracle:thin:@192.168.1.51:1521:steerinfo
-    password: st#0901
-    username: DIL0901
+    url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
+    password: Dil123789
+    username: dil
     driver-class-name: oracle.jdbc.OracleDriver
   application:
-    name: dil-bmsship-api-dev
+    name: dal-bms-ship-api
 
+
+  openFeign:
+    ColumnDataFeign:
+      url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}

+ 20 - 4
src/main/resources/application-prod.yml

@@ -1,8 +1,24 @@
 spring:
   datasource:
-    url: jdbc:oracle:thin:@192.168.1.51:1521:steerinfo
-    password: st#0901
-    username: DIL0901
+    url: jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri
+    password: Dil123789
+    username: dil
     driver-class-name: oracle.jdbc.OracleDriver
   application:
-    name: dil-bmsship-api-dev
+    name: dal-bms-ship-api
+
+
+
+openFeign:
+  ColumnDataFeign:
+    url: ${COLUMNDATAFEIGN_URL:172.16.33.161:8083}
+
+
+piction:
+  # path: /usr/share/nginx/html/image
+  #  path: /test/data/nginx/html/image
+   path: C:\Users\zx\Pictures\test
+#  path: /shared
+server:
+  port: 8078
+

+ 9 - 4
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1/bmsship
 spring:
   profiles:
-    include: ${SPRING_PROFILES:dev}
+    include: ${SPRING_PROFILES:prod}
   jackson:
       date-format: yyyy-MM-dd HH:mm:ss
       time-zone: GMT+8
@@ -20,7 +20,14 @@ spring:
 eureka:
   client:
     service-url:
-      defaultZone: http://root:root@discovery.steerinfo.com/eureka/
+      defaultZone: http://root:root@${EUREKA_HOST:172.16.33.166}:${EUREKA_PORT:8081}/eureka/
+    register-with-eureka: false #表示向EurekaServer注册自己 默认为true
+    fetch-registry: false #是否从EurekaServer抓取已有的注册信息,默认为true,单节点无所谓,集群必须设置为true才能配合ribbon使用负载均衡
+
+  instance:
+    prefer-ip-address: false
+    status-page-url: http://${spring.cloud.client.ip-address}:${server.port}/swagger-ui.html#/
+    instance-id: ${spring.cloud.client.ip-address}:${server.port}
 
 genxml:
   pth: com/a
@@ -50,5 +57,3 @@ mybatis:
     mapUnderscoreToCamelCase: true
     call-setters-on-nulls: true
 
-server:
-  port: 8078

+ 67 - 0
src/main/resources/com/steerinfo/dil/mapper/BmsportHandlingFeeMapper.xml

@@ -490,4 +490,71 @@
         FROM AMS_CONTRACT_OTHER_PRICE
         WHERE PRICE_TYPE = '港口装卸单价'
     </select>
+
+  <!--  展示结算列表-->
+    <select id="selectPortFeeSecondList" resultType="java.util.Map" parameterType="java.util.Map">
+        select BF.REAL_TONNAGE "realTonnage",
+               BF.UNIT_PRICE "unitPrice",
+               APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+               BCP.CONTRACT_NO "contractNo",
+               DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
+               RM.MATERIAL_NAME "materialName",
+               BF.FEE "fee",
+              (case
+               WHEN  BF.FEE_TYPE = 1 then '二程船水运费'
+               WHEN BF.FEE_TYPE = 2 THEN  '二程船装卸费'
+               WHEN BF.FEE_TYPE = 3 THEN '三程船水运费'
+               WHEN BF.FEE_TYPE = 4 THEN  '三程船装卸费'
+               WHEN BF.FEE_TYPE =5 THEN  '水分检测费'
+               WHEN BF.FEE_TYPE = 6 THEN '进口矿火运费'
+               WHEN  BF.FEE_TYPE = 7 THEN '国产矿火运费'
+               end) AS "feeType",
+               BF.RESULT_ID "resultId",
+               BF.MAKE_TIME "makeTime"
+
+        from BMSSHIP_FEE BF
+        LEFT JOIN DIL_BATCH DB
+        ON BF.BATCH_ID = DB.BATCH_ID
+        LEFT JOIN RMS_MATERIAL RM
+        ON RM.MATERIAL_ID = DB.MATERIAL_ID
+        left join AMS_PURCHASE_ORDER APO
+        ON BF.PURCHASE_ORDER_ID = APO.PURCHASE_ORDER_ID
+        LEFT JOIN BMSSHIP_CONTRACT_PRICE BCP
+        ON BF.UNIT_PRICE_ID = BCP.RESULT_ID
+        WHERE  BF.FEE_TYPE = #{feeType}
+          AND  BF.DELETED = 0
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=    BF.MAKE_TIME
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  BF.MAKE_TIME
+        </if>
+    </select>
+<!--    -->
+    <select id="downloadBmsshipOrder" resultType="java.lang.String" parameterType="java.lang.Integer">
+        select  BF.IMAGE "image"
+        from BMSSHIP_FEE BF
+        WHERE  BF.RESULT_ID = #{resultId}
+    </select>
+
+
+    <select id="getBmsshipFee" resultType="java.util.Map" parameterType="java.lang.Integer">
+        select  APO.PURCHASE_ORDER_NO "purchaseOrderNo",
+                BF.RESULT_ID "resultId",
+                concat(DB.RESULT_FOREIGN_SHIP_NAME ,rm.MATERIAL_NAME) "batchName",
+                bcp.UNIT_PRICE "unitPrice",
+                bf.REAL_TONNAGE "realTonnage",
+                bf.MAKE_TIME "makeTime",
+                bf.IMAGE "image",
+                bf.FEE "fee"
+
+        from BMSSHIP_FEE BF
+        LEFT JOIN DIL_BATCH DB
+        ON BF.BATCH_ID = DB.BATCH_ID
+        left join RMS_MATERIAL rm
+         on rm.MATERIAL_ID = DB.MATERIAL_ID
+        left join BMSSHIP_CONTRACT_PRICE bcp
+        on bcp.RESULT_ID = BF.UNIT_PRICE_ID
+        LEFT JOIN AMS_PURCHASE_ORDER APO
+        ON APO.PURCHASE_ORDER_ID=BF.PURCHASE_ORDER_ID
+        WHERE  BF.RESULT_ID = #{id}
+    </select>
 </mapper>

+ 579 - 0
src/main/resources/com/steerinfo/dil/mapper/BmsshipFeeMapper.xml

@@ -0,0 +1,579 @@
+<?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.BmsshipFeeMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmsshipFee">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="FEE" jdbcType="DECIMAL" property="fee" />
+    <result column="FEE_TYPE" jdbcType="DECIMAL" property="feeType" />
+    <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
+    <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
+    <result column="REAL_TONNAGE" jdbcType="DECIMAL" property="realTonnage" />
+    <result column="UNIT_PRICE" jdbcType="DECIMAL" property="unitPrice" />
+    <result column="UNIT_PRICE_ID" jdbcType="DECIMAL" property="unitPriceId" />
+    <result column="RESULT_REMARKS" jdbcType="VARCHAR" property="resultRemarks" />
+    <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="IMAGE" jdbcType="VARCHAR" property="image" />
+    <result column="WAGON_NUMBER" jdbcType="DECIMAL" property="wagonNumber" />
+    <result column="MAKE_TIME" jdbcType="TIMESTAMP" property="makeTime" />
+    <result column="PORT_ID" jdbcType="DECIMAL" property="portId" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, FEE, FEE_TYPE, PURCHASE_ORDER_ID, BATCH_ID, REAL_TONNAGE, UNIT_PRICE,
+    UNIT_PRICE_ID, RESULT_REMARKS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, DELETED, IMAGE, WAGON_NUMBER, MAKE_TIME, PORT_ID
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.FEE, t.FEE_TYPE, t.PURCHASE_ORDER_ID, t.BATCH_ID, t.REAL_TONNAGE,
+    t.UNIT_PRICE, t.UNIT_PRICE_ID, t.RESULT_REMARKS, t.INSERT_USERNAME, t.INSERT_TIME,
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.IMAGE, t.WAGON_NUMBER,
+    t.MAKE_TIME, t.PORT_ID
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns"/> FROM BMSSHIP_FEE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias"/> FROM BMSSHIP_FEE t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="fee != null">
+        and FEE = #{fee}
+      </if>
+      <if test="feeType != null">
+        and FEE_TYPE = #{feeType}
+      </if>
+      <if test="purchaseOrderId != null">
+        and PURCHASE_ORDER_ID = #{purchaseOrderId}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="realTonnage != null">
+        and REAL_TONNAGE = #{realTonnage}
+      </if>
+      <if test="unitPrice != null">
+        and UNIT_PRICE = #{unitPrice}
+      </if>
+      <if test="unitPriceId != null">
+        and UNIT_PRICE_ID = #{unitPriceId}
+      </if>
+      <if test="resultRemarks != null and resultRemarks != ''">
+        and RESULT_REMARKS = #{resultRemarks}
+      </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="image != null and image != ''">
+        and IMAGE = #{image}
+      </if>
+      <if test="wagonNumber != null">
+        and WAGON_NUMBER = #{wagonNumber}
+      </if>
+      <if test="makeTime != null">
+        and TO_CHAR(MAKE_TIME,'yyyy-MM-dd') = #{makeTime}
+      </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="fee != null">
+        and FEE = #{fee}
+      </if>
+      <if test="feeType != null">
+        and FEE_TYPE = #{feeType}
+      </if>
+      <if test="purchaseOrderId != null">
+        and PURCHASE_ORDER_ID = #{purchaseOrderId}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="realTonnage != null">
+        and REAL_TONNAGE = #{realTonnage}
+      </if>
+      <if test="unitPrice != null">
+        and UNIT_PRICE = #{unitPrice}
+      </if>
+      <if test="unitPriceId != null">
+        and UNIT_PRICE_ID = #{unitPriceId}
+      </if>
+      <if test="resultRemarks != null and resultRemarks != ''">
+        and RESULT_REMARKS LIKE '%${resultRemarks}%'
+      </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="image != null and image != ''">
+        and IMAGE LIKE '%${image}%'
+      </if>
+      <if test="wagonNumber != null">
+        and WAGON_NUMBER = #{wagonNumber}
+      </if>
+      <if test="makeTime != null">
+        and TO_CHAR(MAKE_TIME,'yyyy-MM-dd') = #{makeTime}
+      </if>
+      <if test="portId != null">
+        and PORT_ID = #{portId}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from BMSSHIP_FEE
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from BMSSHIP_FEE
+    where 1!=1
+    <if test="fee != null">
+      or FEE = #{fee}
+    </if>
+    <if test="feeType != null">
+      or FEE_TYPE = #{feeType}
+    </if>
+    <if test="purchaseOrderId != null">
+      or PURCHASE_ORDER_ID = #{purchaseOrderId}
+    </if>
+    <if test="batchId != null">
+      or BATCH_ID = #{batchId}
+    </if>
+    <if test="realTonnage != null">
+      or REAL_TONNAGE = #{realTonnage}
+    </if>
+    <if test="unitPrice != null">
+      or UNIT_PRICE = #{unitPrice}
+    </if>
+    <if test="unitPriceId != null">
+      or UNIT_PRICE_ID = #{unitPriceId}
+    </if>
+    <if test="resultRemarks != null and resultRemarks != ''">
+      or RESULT_REMARKS = #{resultRemarks}
+    </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="image != null and image != ''">
+      or IMAGE = #{image}
+    </if>
+    <if test="wagonNumber != null">
+      or WAGON_NUMBER = #{wagonNumber}
+    </if>
+    <if test="makeTime != null">
+      or TO_CHAR(MAKE_TIME,'yyyy-MM-dd') = '#{makeTime}'
+    </if>
+    <if test="portId != null">
+      or PORT_ID = #{portId}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.BmsshipFee">
+    insert into BMSSHIP_FEE (RESULT_ID, FEE, FEE_TYPE,
+                             PURCHASE_ORDER_ID, BATCH_ID, REAL_TONNAGE,
+                             UNIT_PRICE, UNIT_PRICE_ID, RESULT_REMARKS,
+                             INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                             UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
+                             IMAGE, WAGON_NUMBER, MAKE_TIME,
+                             PORT_ID)
+    values (#{resultId,jdbcType=DECIMAL}, #{fee,jdbcType=DECIMAL}, #{feeType,jdbcType=DECIMAL},
+            #{purchaseOrderId,jdbcType=DECIMAL}, #{batchId,jdbcType=DECIMAL}, #{realTonnage,jdbcType=DECIMAL},
+            #{unitPrice,jdbcType=DECIMAL}, #{unitPriceId,jdbcType=DECIMAL}, #{resultRemarks,jdbcType=VARCHAR},
+            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
+            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
+            #{image,jdbcType=VARCHAR}, #{wagonNumber,jdbcType=DECIMAL}, #{makeTime,jdbcType=TIMESTAMP},
+            #{portId,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipFee">
+    insert into BMSSHIP_FEE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="fee != null">
+        FEE,
+      </if>
+      <if test="feeType != null">
+        FEE_TYPE,
+      </if>
+      <if test="purchaseOrderId != null">
+        PURCHASE_ORDER_ID,
+      </if>
+      <if test="batchId != null">
+        BATCH_ID,
+      </if>
+      <if test="realTonnage != null">
+        REAL_TONNAGE,
+      </if>
+      <if test="unitPrice != null">
+        UNIT_PRICE,
+      </if>
+      <if test="unitPriceId != null">
+        UNIT_PRICE_ID,
+      </if>
+      <if test="resultRemarks != null">
+        RESULT_REMARKS,
+      </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="image != null">
+        IMAGE,
+      </if>
+      <if test="wagonNumber != null">
+        WAGON_NUMBER,
+      </if>
+      <if test="makeTime != null">
+        MAKE_TIME,
+      </if>
+      <if test="portId != null">
+        PORT_ID,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="fee != null">
+        #{fee,jdbcType=DECIMAL},
+      </if>
+      <if test="feeType != null">
+        #{feeType,jdbcType=DECIMAL},
+      </if>
+      <if test="purchaseOrderId != null">
+        #{purchaseOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="batchId != null">
+        #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="realTonnage != null">
+        #{realTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="unitPriceId != null">
+        #{unitPriceId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultRemarks != null">
+        #{resultRemarks,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="image != null">
+        #{image,jdbcType=VARCHAR},
+      </if>
+      <if test="wagonNumber != null">
+        #{wagonNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="makeTime != null">
+        #{makeTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="portId != null">
+        #{portId,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmsshipFee">
+    update BMSSHIP_FEE
+    set FEE = #{fee,jdbcType=DECIMAL},
+        FEE_TYPE = #{feeType,jdbcType=DECIMAL},
+        PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+        REAL_TONNAGE = #{realTonnage,jdbcType=DECIMAL},
+        UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
+        UNIT_PRICE_ID = #{unitPriceId,jdbcType=DECIMAL},
+        RESULT_REMARKS = #{resultRemarks,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},
+        IMAGE = #{image,jdbcType=VARCHAR},
+        WAGON_NUMBER = #{wagonNumber,jdbcType=DECIMAL},
+        MAKE_TIME = #{makeTime,jdbcType=TIMESTAMP},
+        PORT_ID = #{portId,jdbcType=DECIMAL}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmsshipFee">
+    update BMSSHIP_FEE
+    <set>
+      <if test="fee != null">
+        FEE = #{fee,jdbcType=DECIMAL},
+      </if>
+      <if test="feeType != null">
+        FEE_TYPE = #{feeType,jdbcType=DECIMAL},
+      </if>
+      <if test="purchaseOrderId != null">
+        PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
+      </if>
+      <if test="batchId != null">
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="realTonnage != null">
+        REAL_TONNAGE = #{realTonnage,jdbcType=DECIMAL},
+      </if>
+      <if test="unitPrice != null">
+        UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="unitPriceId != null">
+        UNIT_PRICE_ID = #{unitPriceId,jdbcType=DECIMAL},
+      </if>
+      <if test="resultRemarks != null">
+        RESULT_REMARKS = #{resultRemarks,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="image != null">
+        IMAGE = #{image,jdbcType=VARCHAR},
+      </if>
+      <if test="wagonNumber != null">
+        WAGON_NUMBER = #{wagonNumber,jdbcType=DECIMAL},
+      </if>
+      <if test="makeTime != null">
+        MAKE_TIME = #{makeTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="portId != null">
+        PORT_ID = #{portId,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="whereLike"/>
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into BMSSHIP_FEE
+    (RESULT_ID,
+    FEE, FEE_TYPE, PURCHASE_ORDER_ID,
+    BATCH_ID, REAL_TONNAGE, UNIT_PRICE,
+    UNIT_PRICE_ID, RESULT_REMARKS, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK,
+    DELETED, IMAGE, WAGON_NUMBER,
+    MAKE_TIME, PORT_ID)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.fee,jdbcType=DECIMAL}, #{item.feeType,jdbcType=DECIMAL}, #{item.purchaseOrderId,jdbcType=DECIMAL},
+    #{item.batchId,jdbcType=DECIMAL}, #{item.realTonnage,jdbcType=DECIMAL}, #{item.unitPrice,jdbcType=DECIMAL},
+    #{item.unitPriceId,jdbcType=DECIMAL}, #{item.resultRemarks,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.image,jdbcType=VARCHAR}, #{item.wagonNumber,jdbcType=DECIMAL},
+    #{item.makeTime,jdbcType=TIMESTAMP}, #{item.portId,jdbcType=DECIMAL} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update BMSSHIP_FEE
+    set
+    RESULT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,FEE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.fee,jdbcType=DECIMAL}
+    </foreach>
+    ,FEE_TYPE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.feeType,jdbcType=DECIMAL}
+    </foreach>
+    ,PURCHASE_ORDER_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
+    </foreach>
+    ,BATCH_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
+    </foreach>
+    ,REAL_TONNAGE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.realTonnage,jdbcType=DECIMAL}
+    </foreach>
+    ,UNIT_PRICE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPrice,jdbcType=DECIMAL}
+    </foreach>
+    ,UNIT_PRICE_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPriceId,jdbcType=DECIMAL}
+    </foreach>
+    ,RESULT_REMARKS=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultRemarks,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    ,IMAGE=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.image,jdbcType=VARCHAR}
+    </foreach>
+    ,WAGON_NUMBER=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.wagonNumber,jdbcType=DECIMAL}
+    </foreach>
+    ,MAKE_TIME=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.makeTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,PORT_ID=
+    <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.portId,jdbcType=DECIMAL}
+    </foreach>
+    where RESULT_ID in
+    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from BMSSHIP_FEE
+    where RESULT_ID in
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!--  根据userId查找用户名-->
+  <select id="getPersonnelNameByUserId" resultType="java.lang.String" parameterType="java.lang.String">
+    select RP.PERSONNEL_NAME "personnelName"
+    from RMS_PERSONNEL RP
+    WHERE  RP.PERSONNEL_SSO_ID =#{userId}
+  </select>
+
+</mapper>