Browse Source

修改结算

zx 2 years ago
parent
commit
07d3181a36

+ 1 - 1
pom.xml

@@ -111,7 +111,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>RMS_PIER</param>
+                        <param>BMSSHIP_CONTRACT_PRICE</param>
                     </tables>
                 </configuration>
                 <executions>

+ 122 - 0
src/main/java/com/steerinfo/dil/controller/BmsshipContractPriceController.java

@@ -0,0 +1,122 @@
+package com.steerinfo.dil.controller;
+
+
+import com.steerinfo.dil.service.IBmsshipContractPriceService;
+import com.steerinfo.dil.util.BaseRESTfulController;
+import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.dil.util.PageListAdd;
+import com.steerinfo.framework.controller.RESTfulResult;
+import com.steerinfo.framework.service.pagehelper.PageHelper;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * BmsshipContractPrice RESTful接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-07 09:38
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-07
+ * 作者:generator
+ * 参考:
+ * 描述:BmsshipContractPrice RESTful接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@RestController
+@RequestMapping("/${api.version}/bmsshipcontractprices")
+public class BmsshipContractPriceController extends BaseRESTfulController {
+
+    @Autowired
+    IBmsshipContractPriceService bmsshipContractPriceService;
+    @Autowired
+    ColumnDataUtil columnDataUtil;
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+     //新增船运合同
+     @ApiOperation(value="创建", notes="根据RmsCapacity对象创建")
+     @ApiImplicitParam(name = "rmsCapacity", value = "详细实体rmsCapacity", required = true, dataType = "RmsCapacity")
+     @PostMapping(value = "/insertBmsshipContractPrice")
+     public RESTfulResult insertBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
+      int result= bmsshipContractPriceService.insertBmsshipContractPrice(mapValue);
+      if (result==-1){
+          return failed("合同号已存在!!");
+      }
+      return success(result);
+     }
+
+
+
+
+    //新增船运合同
+    @ApiOperation(value="修改船运合同单价", notes="根据bmsshipContractPrice对象创建")
+    @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
+    @PostMapping(value = "/updateBmsshipContractPrice")
+    public RESTfulResult updateBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
+        int result= bmsshipContractPriceService.updateBmsshipContractPrice(mapValue);
+        if (result==-1){
+            return failed("合同号已存在!!");
+        }
+        return success(result);
+    }
+
+    //新增船运合同
+    @ApiOperation(value="删除船运合同单价", notes="根据bmsshipContractPrice对象创建")
+    @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
+    @PostMapping(value = "/deleteBmsshipContractPrice")
+    public RESTfulResult deleteBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
+        int result= bmsshipContractPriceService.deleteBmsshipContractPrice(mapValue);
+        return success(result);
+    }
+
+    //新增船运合同
+    @ApiOperation(value="渲染船运合同单价", notes="根据bmsshipContractPrice对象创建")
+    @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
+    @PostMapping(value = "/selectBmsshipPriceList/{id}")
+    public RESTfulResult selectBmsshipPriceList(@PathVariable("id") BigDecimal id) {
+     List<Map<String,Object>> list = bmsshipContractPriceService.selectBmsshipPriceList(id);
+        return success(list);
+    }
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
+            @ApiImplicitParam(name = "apiId", value = "500", required = false, dataType = "BigDecimal"),
+    })
+
+    @PostMapping(value = "/selectbmsshipContractPriceList")
+    public RESTfulResult selectbmsshipContractPriceList(@RequestBody(required = false) Map<String, Object> mapValue,
+                                     Integer apiId,
+                                     Integer pageNum,
+                                     Integer pageSize,
+                                     String con,
+                                     String startTime,
+                                     String endTime) {
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        if (mapValue == null) {
+            mapValue = new HashMap<>();
+        }
+
+        if (con != null && con.length() != 0) {
+            mapValue.put("con","%" + con + "%");
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+        //初始化过滤
+        List<Map<String, Object>> columnList = bmsshipContractPriceService.bmsshipContractPriceList(mapValue);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
+        return success(data);
+    }
+
+}

+ 2 - 6
src/main/java/com/steerinfo/dil/controller/RmsPersonnelController.java

@@ -79,12 +79,11 @@ public class RmsPersonnelController extends BaseRESTfulController {
 
     /**
      * 添加人员信息
-     * @param rmsPersonnel
+     * @param map
      * @return
      */
     @ApiOperation(value="创建", notes="根据RmsPersonnel对象创建")
     @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = false, dataType = "RmsPersonnel")
-    //@RequiresPermissions("rmspersonnel:create")
     @PostMapping(value = "/insertPersonnel")
     public RESTfulResult insertPersonnel(@RequestBody(required = false) Map<String,Object> map){
         int result=rmsPersonnelService.insertPersonnel(map);
@@ -93,9 +92,7 @@ public class RmsPersonnelController extends BaseRESTfulController {
         }
         return success(result);
     }
-    /**
-     * 添加托运人
-     */
+
 
     /**
      * 更新人员信息
@@ -107,7 +104,6 @@ public class RmsPersonnelController extends BaseRESTfulController {
         @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
         @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = true, dataType = "RmsPersonnel")
     })
-    //@RequiresPermissions("rmspersonnel:update")
     @PostMapping(value = "/updatePersonnel", produces  = "application/json;charset=UTF-8")
     public RESTfulResult updatePersonnel(@RequestBody RmsPersonnel rmsPersonnel){
         int result=rmsPersonnelService.updatePersonnel(rmsPersonnel);

+ 26 - 0
src/main/java/com/steerinfo/dil/mapper/BmsshipContractPriceMapper.java

@@ -0,0 +1,26 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.BmsshipContractPrice;
+import com.steerinfo.dil.model.BmsshipContractPrice;
+import com.steerinfo.dil.model.RmsBidArea;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+@Mapper
+public interface BmsshipContractPriceMapper extends IBaseMapper<BmsshipContractPrice, BigDecimal> {
+    //获取主键id
+    @Select("select seq_bmsship_contract_price.nextval from dual")
+    BigDecimal getMaxId();
+    //判断合同号是否唯一
+    BigDecimal contractNoCompare(String contractNo);
+
+    List<Map<String, Object>> bmsshipContractPriceList(Map<String, Object> map);
+
+    //渲染数据
+    List<Map<String,Object>> selectBmsshipPriceList(BigDecimal id);
+}

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

@@ -35,4 +35,7 @@ public interface RmsPersonnelMapper extends IBaseMapper<RmsPersonnel, BigDecimal
 
     //通过用户名和账号判断是否存在
    BigDecimal getPersonnelIdByJobNumber(Map<String,Object> map);
+
+   //根据用户ssoId查找用户名
+    String getPersonnelNameByUserId(String userId);
 }

+ 213 - 0
src/main/java/com/steerinfo/dil/model/BmsshipContractPrice.java

@@ -0,0 +1,213 @@
+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 BmsshipContractPrice implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(RESULT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal resultId;
+
+    /**
+     * 合同号(CONTRACT_NO,VARCHAR,20)
+     */
+    @ApiModelProperty(value="合同号",required=false)
+    private String contractNo;
+
+    /**
+     * 单价(UNIT_PRICE,DECIMAL,38)
+     */
+    @ApiModelProperty(value="单价",required=false)
+    private BigDecimal unitPrice;
+
+    /**
+     * 批次ID(BATCH_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="批次ID",required=false)
+    private BigDecimal batchId;
+
+    /**
+     * 起始日期(START_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="起始日期",required=false)
+    private Date startTime;
+
+    /**
+     * 截止日期(END_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="截止日期",required=false)
+    private Date endTime;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 是否删除 ( 0:未删除 1:已删除)(DELETED,DECIMAL,9)
+     */
+    @ApiModelProperty(value="是否删除 ( 0:未删除 1:已删除)",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.resultId;
+    }
+
+    @Override
+    public void setId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public BigDecimal getResultId() {
+        return resultId;
+    }
+
+    public void setResultId(BigDecimal resultId) {
+        this.resultId = resultId;
+    }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo == null ? null : contractNo.trim();
+    }
+
+    public BigDecimal getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(BigDecimal unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public BigDecimal getBatchId() {
+        return batchId;
+    }
+
+    public void setBatchId(BigDecimal batchId) {
+        this.batchId = batchId;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", resultId=").append(resultId);
+        sb.append(", contractNo=").append(contractNo);
+        sb.append(", unitPrice=").append(unitPrice);
+        sb.append(", batchId=").append(batchId);
+        sb.append(", startTime=").append(startTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", insertUsername=").append(insertUsername);
+        sb.append(", insertTime=").append(insertTime);
+        sb.append(", updateUsername=").append(updateUsername);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
+        sb.append(", deleted=").append(deleted);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 38 - 0
src/main/java/com/steerinfo/dil/service/IBmsshipContractPriceService.java

@@ -0,0 +1,38 @@
+package com.steerinfo.dil.service;
+
+import com.steerinfo.dil.model.BmsshipContractPrice;
+import com.steerinfo.framework.service.IBaseService;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * BmsshipContractPrice服务接口:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-07 09:38
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-07
+ * 作者:generator
+ * 参考:
+ * 描述:BmsshipContractPrice服务接口
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+public interface IBmsshipContractPriceService {
+    //新增船运合同单价
+    int insertBmsshipContractPrice(Map<String, Object> mapValue);
+
+    //展示合同单价管理
+    List<Map<String,Object>> bmsshipContractPriceList(Map<String,Object> map);
+
+    //修改船运合同单价
+    int updateBmsshipContractPrice(Map<String, Object> mapValue);
+
+    //删除船运合同单价
+    int deleteBmsshipContractPrice(Map<String, Object> mapValue);
+
+    //渲染船运合同单价数据
+    List<Map<String, Object>> selectBmsshipPriceList(BigDecimal id);
+}

+ 128 - 0
src/main/java/com/steerinfo/dil/service/impl/BmsshipContractPriceServiceImpl.java

@@ -0,0 +1,128 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.BmsshipContractPriceMapper;
+import com.steerinfo.dil.mapper.RmsPersonnelMapper;
+import com.steerinfo.dil.model.BmsshipContractPrice;
+import com.steerinfo.dil.service.IBmsshipContractPriceService;
+import com.steerinfo.dil.util.DataChange;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import com.steerinfo.framework.service.impl.BaseServiceImpl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * BmsshipContractPrice服务实现:
+ * @author generator
+ * @version 1.0-SNAPSHORT 2022-07-07 09:38
+ * 类描述
+ * 修订历史:
+ * 日期:2022-07-07
+ * 作者:generator
+ * 参考:
+ * 描述:BmsshipContractPrice服务实现
+ * @see null
+ * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
+ */
+@Service(value = "bmsshipContractPriceService")
+public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceService {
+
+    @Autowired
+    private BmsshipContractPriceMapper bmsshipContractPriceMapper;
+    @Autowired
+    private RmsPersonnelMapper rmsPersonnelMapper;
+
+
+    @Override
+    public int insertBmsshipContractPrice(Map<String, Object> mapValue) {
+        String userId = (String) mapValue.get("userId");
+        String personnelName = rmsPersonnelMapper.getPersonnelNameByUserId(userId);
+        String remark =(String) mapValue.get("remark");
+        String contractNo =(String) mapValue.get("contractNo");
+        //判断是否存在相同的合同号
+        BigDecimal conpareNo = bmsshipContractPriceMapper.contractNoCompare(contractNo);
+        if (conpareNo!=null){
+            return  -1;
+        }
+        BigDecimal unitPrice = DataChange.dataToBigDecimal(mapValue.get("unitPrice"));
+        long startTime =(long) mapValue.get("startTime");
+        long endTime = (long) mapValue.get("endTime");
+        //新增实体类
+        BmsshipContractPrice bmsshipContractPrice=new BmsshipContractPrice();
+        bmsshipContractPrice.setResultId(bmsshipContractPriceMapper.getMaxId());
+        bmsshipContractPrice.setContractNo(contractNo);
+        bmsshipContractPrice.setUnitPrice(unitPrice);
+        bmsshipContractPrice.setStartTime(new Date(startTime));
+        bmsshipContractPrice.setEndTime(new Date(endTime));
+        bmsshipContractPrice.setInsertTime(new Date());
+        bmsshipContractPrice.setDeleted(new BigDecimal(0));
+        if (personnelName!=null){
+            bmsshipContractPrice.setInsertUsername(personnelName);
+        }else {
+            bmsshipContractPrice.setInsertUsername(userId);
+        }
+        bmsshipContractPrice.setInsertUpdateRemark(remark);
+        int i = bmsshipContractPriceMapper.insertSelective(bmsshipContractPrice);
+        return i;
+    }
+
+    @Override
+    public List<Map<String, Object>> bmsshipContractPriceList(Map<String, Object> map) {
+        return bmsshipContractPriceMapper.bmsshipContractPriceList(map);
+    }
+
+
+    //修改船运合同单价
+    @Override
+    public int updateBmsshipContractPrice(Map<String, Object> mapValue) {
+        BigDecimal resultId =DataChange.dataToBigDecimal(mapValue.get("resultId"));
+        String userId =(String) mapValue.get("userId");
+        String remark =(String) mapValue.get("remark");
+        String contractNo =(String) mapValue.get("contractNo");
+        //判断是否存在相同的合同号
+        BigDecimal conpareNo = bmsshipContractPriceMapper.contractNoCompare(contractNo);
+        if (conpareNo!=null&&!conpareNo.equals(resultId)){
+            return  -1;
+        }
+        BigDecimal unitPrice = DataChange.dataToBigDecimal(mapValue.get("unitPrice"));
+        long startTime =(long) mapValue.get("startTime");
+        long endTime = (long) mapValue.get("endTime");
+        String personnelName = rmsPersonnelMapper.getPersonnelNameByUserId(userId);
+        BmsshipContractPrice bmsshipContractPrice=new BmsshipContractPrice();
+        bmsshipContractPrice.setResultId(resultId);
+        bmsshipContractPrice.setUpdateTime(new Date());
+        if (personnelName!=null) {
+            bmsshipContractPrice.setUpdateUsername(personnelName);
+        }else {
+            bmsshipContractPrice.setUpdateUsername(userId);
+        }
+        bmsshipContractPrice.setStartTime(new Date(startTime));
+        bmsshipContractPrice.setEndTime(new Date(endTime));
+        bmsshipContractPrice.setContractNo(contractNo);
+        bmsshipContractPrice.setInsertUpdateRemark(remark);
+        bmsshipContractPrice.setUnitPrice(unitPrice);
+        return bmsshipContractPriceMapper.updateByPrimaryKeySelective(bmsshipContractPrice);
+    }
+
+    //删除合同单价
+    @Override
+    public int deleteBmsshipContractPrice(Map<String, Object> mapValue) {
+        String userId =(String) mapValue.get("userId");
+        BigDecimal resultId =DataChange.dataToBigDecimal(mapValue.get("resultId"));
+        BmsshipContractPrice bmsshipContractPrice=new BmsshipContractPrice();
+        bmsshipContractPrice.setResultId(resultId);
+        bmsshipContractPrice.setDeleted(new BigDecimal(1));
+        bmsshipContractPrice.setUpdateUsername(userId);
+        bmsshipContractPrice.setUpdateTime(new Date());
+        return bmsshipContractPriceMapper.updateByPrimaryKeySelective(bmsshipContractPrice);
+    }
+
+    @Override
+    public List<Map<String, Object>> selectBmsshipPriceList(BigDecimal id) {
+        return bmsshipContractPriceMapper.selectBmsshipPriceList(id);
+    }
+}

+ 117 - 16
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -7,6 +7,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 /**
  * @ author    :TXF
@@ -17,24 +18,45 @@ public class DataChange {
 
 
     /**
-     * 解析前端传来的日期字符串
+     * 时间转换类
+     * 处理了三种类型 yyyy-MM-dd HH:mm:ss  yyyy/MM/dd HH:mm:ss  时间戳类型(带毫秒数时间戳13位)
      * @param vueDate
      * @return
      */
     public static Date dataToDate(Object vueDate){
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        Date parseDate = null;
-        if (vueDate != null){
+        if(vueDate instanceof Date){
+            return (Date) vueDate;
+        } else {
             try {
-                String date = (String) vueDate;
-                parseDate = sdf.parse(date);
-            } catch (ParseException e) {
-                e.printStackTrace();
+                String str = String.valueOf(vueDate);
+                if(judgeNumber(str) && str.length() == 13){
+                    return new Date(Long.parseLong(str));
+                }else if(str.contains("-")){
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    return sdf.parse(str);
+                }else if(str.contains("/")){
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+                    return sdf.parse(str);
+                }
+            }catch (Exception e){
+                System.out.println("时间解析错误!返回null");
+                return null;
             }
         }
-        return parseDate;
+        return null;
     }
 
+    /**
+     * 判断是否纯数字(不带小数点)仅供上面方法使用
+     * @param str
+     * @return
+     */
+    public static boolean judgeNumber(String str){
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
+        return pattern.matcher(str).matches();
+    }
+
+
     /**
      * 数据转换成BigDecimal
      * @param data
@@ -51,7 +73,7 @@ public class DataChange {
                     try {
                         decimal = new BigDecimal(str);
                     } catch (Exception e) {
-                        e.printStackTrace();
+                        System.out.println(data + ":数据解析失败!返回0");
                         return new BigDecimal(0);
                     }
                 }
@@ -72,7 +94,7 @@ public class DataChange {
         if(date == null)
             return null;
         try{
-             changeDate = (Date) date;
+            changeDate = (Date) date;
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -90,7 +112,12 @@ public class DataChange {
             for (String s : key) {
                 //从map中取 date的值 并转换成字符串类型的日期
                 String stringDate = dateToDayDate(map.get(s));
-                map.put(s, stringDate);
+                if(stringDate.length() == 0){
+                    break;
+                }else {
+                    //修改map中的值
+                    map.put(s, stringDate);
+                }
             }
         }
     }
@@ -101,14 +128,18 @@ public class DataChange {
      * @param key
      */
     public static void dataTo2Number(List<Map<String, Object>> list, String ...key){
+        DecimalFormat df =  new DecimalFormat("0.00");
         //遍历List
         for (Map<String, Object> map : list) {
             for (String s : key) {
                 //修改数据为带两位小数
-                BigDecimal oldDate = (BigDecimal) map.get(s);
-                DecimalFormat df =  new DecimalFormat("0.00");
-                String resultDeduction = df.format(oldDate.doubleValue());
-                map.put(s, resultDeduction);
+                try {
+                    BigDecimal oldDate = dataToBigDecimal(map.get(s));
+                    String resultDeduction = df.format(oldDate.doubleValue());
+                    map.put(s, resultDeduction);
+                } catch (Exception e) {
+                    System.out.println("原料扣减量数据有误");
+                }
             }
         }
     }
@@ -156,4 +187,74 @@ public class DataChange {
         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");
+    }
 }

+ 428 - 0
src/main/resources/com/steerinfo/dil/mapper/BmsshipContractPriceMapper.xml

@@ -0,0 +1,428 @@
+<?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.BmsshipContractPriceMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmsshipContractPrice">
+    <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
+    <result column="CONTRACT_NO" jdbcType="VARCHAR" property="contractNo" />
+    <result column="UNIT_PRICE" jdbcType="DECIMAL" property="unitPrice" />
+    <result column="BATCH_ID" jdbcType="DECIMAL" property="batchId" />
+    <result column="START_TIME" jdbcType="TIMESTAMP" property="startTime" />
+    <result column="END_TIME" jdbcType="TIMESTAMP" property="endTime" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+  </resultMap>
+  <sql id="columns">
+    RESULT_ID, CONTRACT_NO, UNIT_PRICE, BATCH_ID, START_TIME, END_TIME, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.RESULT_ID, t.CONTRACT_NO, t.UNIT_PRICE, t.BATCH_ID, t.START_TIME, t.END_TIME, t.INSERT_USERNAME,
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM BMSSHIP_CONTRACT_PRICE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM BMSSHIP_CONTRACT_PRICE t
+  </sql>
+  <sql id="where">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="contractNo != null and contractNo != ''">
+        and CONTRACT_NO = #{contractNo}
+      </if>
+      <if test="unitPrice != null">
+        and UNIT_PRICE = #{unitPrice}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="startTime != null">
+        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+      </if>
+      <if test="endTime != null">
+        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where>
+      <if test="resultId != null">
+        and RESULT_ID = #{resultId}
+      </if>
+      <if test="contractNo != null and contractNo != ''">
+        and CONTRACT_NO LIKE '%${contractNo}%'
+      </if>
+      <if test="unitPrice != null">
+        and UNIT_PRICE = #{unitPrice}
+      </if>
+      <if test="batchId != null">
+        and BATCH_ID = #{batchId}
+      </if>
+      <if test="startTime != null">
+        and TO_CHAR(START_TIME,'yyyy-MM-dd') = #{startTime}
+      </if>
+      <if test="endTime != null">
+        and TO_CHAR(END_TIME,'yyyy-MM-dd') = #{endTime}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    delete from BMSSHIP_CONTRACT_PRICE
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from BMSSHIP_CONTRACT_PRICE
+    where 1!=1
+    <if test="contractNo != null and contractNo != ''">
+      or CONTRACT_NO = #{contractNo}
+    </if>
+    <if test="unitPrice != null">
+      or UNIT_PRICE = #{unitPrice}
+    </if>
+    <if test="batchId != null">
+      or BATCH_ID = #{batchId}
+    </if>
+    <if test="startTime != null">
+      or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
+    </if>
+    <if test="endTime != null">
+      or TO_CHAR(END_TIME,'yyyy-MM-dd') = '#{endTime}'
+    </if>
+    <if test="insertUsername != null and insertUsername != ''">
+      or INSERT_USERNAME = #{insertUsername}
+    </if>
+    <if test="insertTime != null">
+      or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
+    </if>
+    <if test="updateUsername != null and updateUsername != ''">
+      or UPDATE_USERNAME = #{updateUsername}
+    </if>
+    <if test="updateTime != null">
+      or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
+    </if>
+    <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+      or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+    </if>
+    <if test="deleted != null">
+      or DELETED = #{deleted}
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
+    insert into BMSSHIP_CONTRACT_PRICE (RESULT_ID, CONTRACT_NO, UNIT_PRICE,
+                                        BATCH_ID, START_TIME, END_TIME,
+                                        INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
+                                        UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+    )
+    values (#{resultId,jdbcType=DECIMAL}, #{contractNo,jdbcType=VARCHAR}, #{unitPrice,jdbcType=DECIMAL},
+            #{batchId,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
+            #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
+            #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}
+           )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
+    insert into BMSSHIP_CONTRACT_PRICE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        RESULT_ID,
+      </if>
+      <if test="contractNo != null">
+        CONTRACT_NO,
+      </if>
+      <if test="unitPrice != null">
+        UNIT_PRICE,
+      </if>
+      <if test="batchId != null">
+        BATCH_ID,
+      </if>
+      <if test="startTime != null">
+        START_TIME,
+      </if>
+      <if test="endTime != null">
+        END_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>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="resultId != null">
+        #{resultId,jdbcType=DECIMAL},
+      </if>
+      <if test="contractNo != null">
+        #{contractNo,jdbcType=VARCHAR},
+      </if>
+      <if test="unitPrice != null">
+        #{unitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="batchId != null">
+        #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="startTime != null">
+        #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
+    update BMSSHIP_CONTRACT_PRICE
+    set CONTRACT_NO = #{contractNo,jdbcType=VARCHAR},
+        UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+        START_TIME = #{startTime,jdbcType=TIMESTAMP},
+        END_TIME = #{endTime,jdbcType=TIMESTAMP},
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+        DELETED = #{deleted,jdbcType=DECIMAL}
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmsshipContractPrice">
+    update BMSSHIP_CONTRACT_PRICE
+    <set>
+      <if test="contractNo != null">
+        CONTRACT_NO = #{contractNo,jdbcType=VARCHAR},
+      </if>
+      <if test="unitPrice != null">
+        UNIT_PRICE = #{unitPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="batchId != null">
+        BATCH_ID = #{batchId,jdbcType=DECIMAL},
+      </if>
+      <if test="startTime != null">
+        START_TIME = #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        END_TIME = #{endTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where RESULT_ID = #{resultId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into BMSSHIP_CONTRACT_PRICE
+    (RESULT_ID,
+    CONTRACT_NO, UNIT_PRICE, BATCH_ID,
+    START_TIME, END_TIME, INSERT_USERNAME,
+    INSERT_TIME, UPDATE_USERNAME,
+    UPDATE_TIME, INSERT_UPDATE_REMARK,
+    DELETED)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.resultId,jdbcType=DECIMAL},
+    #{item.contractNo,jdbcType=VARCHAR}, #{item.unitPrice,jdbcType=DECIMAL}, #{item.batchId,jdbcType=DECIMAL},
+    #{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
+    #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
+    #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
+    #{item.deleted,jdbcType=DECIMAL} from dual
+  </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+    update BMSSHIP_CONTRACT_PRICE
+    set
+    RESULT_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+    ,CONTRACT_NO=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.contractNo,jdbcType=VARCHAR}
+    </foreach>
+    ,UNIT_PRICE=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.unitPrice,jdbcType=DECIMAL}
+    </foreach>
+    ,BATCH_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.batchId,jdbcType=DECIMAL}
+    </foreach>
+    ,START_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.startTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,END_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.endTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+      when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    where RESULT_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.resultId,jdbcType=DECIMAL}
+    </foreach>
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from BMSSHIP_CONTRACT_PRICE
+    where RESULT_ID in
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  <select id="contractNoCompare" resultType="java.math.BigDecimal" parameterType="java.lang.String">
+    select BCP.RESULT_ID "resultId"
+    from BMSSHIP_CONTRACT_PRICE BCP
+    WHERE BCP.CONTRACT_NO = #{contractNo}
+  </select>
+
+  <!-- 展示船运合同管理列表-->
+  <select id="bmsshipContractPriceList" resultType="java.util.Map" parameterType="java.util.Map">
+    select
+    BCP.RESULT_ID "resultId",
+    BCP.CONTRACT_NO "contractNo",
+    BCP.START_TIME "startTime",
+    BCP.END_TIME "endTime",
+    BCP.UNIT_PRICE "unitPrice"
+    from BMSSHIP_CONTRACT_PRICE BCP
+    where  BCP.DELETED=0
+    <if test="con!=null">
+     AND instr(BCP.CONTRACT_NO,#{con}) > 0
+    </if>
+    <if test="startDate != null">
+      and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=   BCP.END_TIME
+      and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= BCP.END_TIME
+    </if>
+  </select>
+  <select id="selectBmsshipPriceList" resultType="java.util.Map" parameterType="java.math.BigDecimal">
+    select  BCP.CONTRACT_NO "contractNo",
+            BCP.START_TIME "startTime",
+            BCP.END_TIME "endTime",
+            BCP.UNIT_PRICE "unitPrice",
+            BCP.RESULT_ID "resultId"
+    from BMSSHIP_CONTRACT_PRICE BCP
+    WHERE  BCP.RESULT_ID =#{resultId}
+  </select>
+
+</mapper>

+ 7 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsPersonnelMapper.xml

@@ -721,4 +721,11 @@
     WHERE  RP.PERSONNEL_JOB_NUMBER=#{personnelJobNumber} and RP.PERSONNEL_NAME=#{personnelName} and RP.DELETED=0
   </select>
 
+<!--  根据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>