Ver código fonte

合并dev分支 解决冲突

txf 3 anos atrás
pai
commit
b2aa08cf4a
25 arquivos alterados com 1490 adições e 287 exclusões
  1. 3 3
      pom.xml
  2. 1 1
      src/main/java/com/steerinfo/dil/controller/RmsCapacityController.java
  3. 4 58
      src/main/java/com/steerinfo/dil/controller/RmsLineController.java
  4. 34 41
      src/main/java/com/steerinfo/dil/controller/RmsOilPriceController.java
  5. 2 1
      src/main/java/com/steerinfo/dil/feign/AmsFeign.java
  6. 4 0
      src/main/java/com/steerinfo/dil/mapper/RmsCapacityMapper.java
  7. 11 0
      src/main/java/com/steerinfo/dil/mapper/RmsLineGatepostCalculateMapper.java
  8. 4 1
      src/main/java/com/steerinfo/dil/mapper/RmsOilPriceMapper.java
  9. 20 0
      src/main/java/com/steerinfo/dil/mapper/RmsOilTypeMapper.java
  10. 169 0
      src/main/java/com/steerinfo/dil/model/RmsLineGatepostCalculate.java
  11. 40 9
      src/main/java/com/steerinfo/dil/model/RmsOilPrice.java
  12. 154 0
      src/main/java/com/steerinfo/dil/model/RmsOilType.java
  13. 1 1
      src/main/java/com/steerinfo/dil/service/IRmsCapacityService.java
  14. 2 1
      src/main/java/com/steerinfo/dil/service/IRmsLineService.java
  15. 8 4
      src/main/java/com/steerinfo/dil/service/IRmsOilPriceService.java
  16. 4 9
      src/main/java/com/steerinfo/dil/service/impl/RmsCapacityServiceImpl.java
  17. 58 2
      src/main/java/com/steerinfo/dil/service/impl/RmsLineServiceImpl.java
  18. 119 22
      src/main/java/com/steerinfo/dil/service/impl/RmsOilPriceServiceImpl.java
  19. 1 1
      src/main/java/com/steerinfo/dil/util/ColumnDataUtil.java
  20. 1 1
      src/main/resources/application-dev.yml
  21. 2 2
      src/main/resources/com/steerinfo/dil/mapper/RmsCapacityMapper.xml
  22. 319 0
      src/main/resources/com/steerinfo/dil/mapper/RmsLineGatepostCalculateMapper.xml
  23. 2 0
      src/main/resources/com/steerinfo/dil/mapper/RmsLineMapper.xml
  24. 226 130
      src/main/resources/com/steerinfo/dil/mapper/RmsOilPriceMapper.xml
  25. 301 0
      src/main/resources/com/steerinfo/dil/mapper/RmsOilTypeMapper.xml

+ 3 - 3
pom.xml

@@ -106,12 +106,12 @@
                 <version>3.0</version>
                 <configuration>
                     <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
-                    <user>dagang</user>
-                    <password>root123</password>
+                    <user>dil</user>
+                    <password>Dil123789</password>
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>RMS_CARRIER</param>
+                        <param>RMS_OIL_PRICE</param>
                     </tables>
                 </configuration>
                 <executions>

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

@@ -79,7 +79,7 @@ public class RmsCapacityController extends BaseRESTfulController {
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
     @PostMapping(value = "/deleteCapacity/{id}")
     public RESTfulResult deleteCapacity(@PathVariable("id") BigDecimal id){
-        String s = rmsCapacityService.deleteCapacity(id);
+        int s = rmsCapacityService.deleteCapacity(id);
         return success(s);
     }
 

+ 4 - 58
src/main/java/com/steerinfo/dil/controller/RmsLineController.java

@@ -76,15 +76,14 @@ public class RmsLineController extends BaseRESTfulController {
                                         String con){
 
         if(con != null){
-            if(!"".equals(con)){
+            if(!"".equals(con) && !"null".equals(con)){
                 mapValue.put("index", con);
             }
         }
-        List<Map<String, Object>>  list = rmsLineMapper.getAllLineDesk(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = rmsLineMapper.getAllLineDesk(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId,list,columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId,null,columnList);
         return success(data);
     }
 
@@ -100,61 +99,8 @@ public class RmsLineController extends BaseRESTfulController {
     @PostMapping("/insertSelective")
     @Transactional
     public RESTfulResult insertSelective(@RequestBody(required = false) Map<String,Object> mapVal){
-        // 创建运输路线主表实体
-        RmsLine rmsLine = new RmsLine();
-        //获取线路主表主键id
-        int lineId = commonSeq.getId("seq_RMS_LINE");
-        //将获取到的运输路线主表id赋值给运输路线主表实体中
-        rmsLine.setLineId(new BigDecimal(lineId));
-        // 拿到前端传递的运输路线名称,并存放到运输路线主表实体中
-        rmsLine.setLineName((String) mapVal.get("line_name"));
-        // 拿到前端传递的运输线路类型,并存放到运输路线主表实体中
-        rmsLine.setLineType((Integer) mapVal.get("line_type"));
-        // 拿到前端传递的运输路线开始
-        List<Map<String,Object>> linkList = (List<Map<String, Object>>) mapVal.get("linkList");
-        Integer lineStartNodeId = (Integer) linkList.get(0).get("linkId");
-        //存放到运输路线主表实体中
-        rmsLine.setLineStartNodeId(new BigDecimal(lineStartNodeId));
-        // 拿到前端传递的运输路线结束
-        Integer lineEndNodeId = (Integer) linkList.get(linkList.size()-1).get("linkId");
-        //存放到运输路线主表实体中
-        rmsLine.setLineEndNodeId(new BigDecimal(lineEndNodeId));
-        //生成运输线路编号
-        String lineNo = DataChange.generateEightDigitsNumber("YSXL", lineId);
-        //将运输线路存放进运输线路主表实体中
-        rmsLine.setLineNo(lineNo);
-        //逻辑删除(0为未删除,1为删除)
-        rmsLine.setDeleted(0);
-        //拿到前端传递的拼数
-        Integer spellNumber = (Integer) mapVal.get("spellNumber");
-        //把拼数添加到运输路线主表实体中
-        rmsLine.setSpellNumber(spellNumber);
-        //调用rmsLineService的新增方法
-        int i = rmsLineService.insertSelective(rmsLine);
-        int i1 = 0;
-        if(i == 1){
-            for (int j = 0;j<linkList.size();j++){
-                //创建线路子表实体
-                RmsLineSegemnt rmsLineSegemnt = new RmsLineSegemnt();
-                //获取线路子表主键id
-                int segmentId = commonSeq.getId("seq_RMS_LINE_SEGEMNT");
-                //将获取到的线路子表id添加到线路子表实体中
-                rmsLineSegemnt.setSegmentId(new BigDecimal(segmentId));
-                //将线路主表的主键id添加到线路子表实体中
-                rmsLineSegemnt.setLineId(new BigDecimal(lineId));
-                //添加线路子表的路段顺序号
-                rmsLineSegemnt.setSegmentSqe(new BigDecimal(j+1));
-                //拿到前端传递的运输路线起点id
-                Integer segmentStartNodeId = (Integer) linkList.get(j).get("linkId");
-                //将起点id添加到线路子表的实体中
-                rmsLineSegemnt.setSegmentStartNodeId(new BigDecimal(segmentStartNodeId));
-                //逻辑删除(0为未删除,1为删除)
-                rmsLineSegemnt.setDeleted(0);
-                //调用rmsLineSegemntService的新增方法
-                i1 = rmsLineSegemntService.insertSelective(rmsLineSegemnt);
-            }
-        }
-        if(i1 > 0){
+        int i = rmsLineService.insertSelective(mapVal);
+        if(i > 0){
             return  success();
         }
         return failed();

+ 34 - 41
src/main/java/com/steerinfo/dil/controller/RmsOilPriceController.java

@@ -2,6 +2,7 @@ package com.steerinfo.dil.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.steerinfo.dil.feign.ESFeign;
+import com.steerinfo.dil.mapper.RmsOilTypeMapper;
 import com.steerinfo.dil.model.RmsCarDriver;
 import com.steerinfo.dil.service.IRmsOilPriceService;
 import com.steerinfo.dil.service.impl.RmsCarDriverServiceImpl;
@@ -60,30 +61,45 @@ public class RmsOilPriceController extends BaseRESTfulController {
     ColumnDataUtil columnDataUtil;
     @Autowired
     ESFeign esFeign;
+    @Autowired
+    RmsOilTypeMapper rmsOilTypeMapper;
 
     /**
      *增加新油价
-     * @param rmsOilPrice
+     * @param
      * @return
      */
     @ApiOperation(value="创建", notes="根据RmsOilPrice对象创建")
     @ApiImplicitParam(name = "rmsOilPrice", value = "详细实体rmsOilPrice", required = true, dataType = "RmsOilPrice")
     @PostMapping(value = "/insertOilPrice")
-    public RESTfulResult insertOilPrice(@RequestBody(required = false) RmsOilPrice rmsOilPrice){
-        int result = rmsOilPriceService.insertOilPrice(rmsOilPrice);
+    public RESTfulResult insertOilPrice(@RequestBody(required = false) Map<String, Object> map){
+        int result = rmsOilPriceService.insertOilPrice(map);
         return success(result);
     }
 
+    @ApiOperation(value="创建", notes="添加油品名称")
+    @ApiImplicitParam(name = "oilTypeName", value = "油品名称", required = true, dataType = "String")
+    @PostMapping(value = "/addOilType")
+    public RESTfulResult addOilType(String oilTypeName){
+        int result = rmsOilPriceService.addOilType(oilTypeName);
+        return success(result);
+    }
 
+    @ApiOperation(value="创建", notes="查询油品名称")
+    @PostMapping(value = "/oilNameSelect")
+    public RESTfulResult oilNameSelect(){
+        List<Map<String, Object>> maps = rmsOilTypeMapper.oilNameSelect();
+        return success(maps);
+    }
     /**
      *更新油价
-     * @param rmsOilPrice
+     * @param
      * @return
      */
 
-    @PostMapping(value = "/updateOilPrice", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult updateOilPrice(@RequestBody RmsOilPrice rmsOilPrice){
-        int result = rmsOilPriceService.updateOilPrice(rmsOilPrice);
+    @PostMapping(value = "/updateOilPrice/{id}", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateOilPrice(@PathVariable("id") Integer id){
+        int result = rmsOilPriceService.updateOilPrice(id);
         return success(result);
     }
 
@@ -102,9 +118,13 @@ public class RmsOilPriceController extends BaseRESTfulController {
      */
     @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
-    @PostMapping(value = "/deleteOilPrice/{id}")//BigDecimal
+    @PostMapping(value = "/deleteOilPrice/{id}")
     public RESTfulResult deleteOilPrice(@PathVariable("id") BigDecimal id){
-        return success(rmsOilPriceService.deleteOilPrice(id));
+        int i = rmsOilPriceService. deleteOilPrice(id);
+        if(i <= 0){
+            return failed();
+        }
+        return success();
     }
 
     /**
@@ -118,7 +138,7 @@ public class RmsOilPriceController extends BaseRESTfulController {
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
     @PostMapping(value = "/getOilPriceById/{id}")
     public RESTfulResult getOilPriceById(@PathVariable("id") BigDecimal id){
-        List<Map<String,Object>> map= rmsOilPriceService.getOilPriceById(id);
+        Map<String,Object> map= rmsOilPriceService.getOilPriceById(id);
         return success(map);
     }
 
@@ -138,7 +158,7 @@ public class RmsOilPriceController extends BaseRESTfulController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
             @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "apiId", value = "355", required = false, dataType = "BigDecimal"),
+            @ApiImplicitParam(name = "apiId", value = "", required = false, dataType = "BigDecimal"),
     })
     @PostMapping(value = "/getOilPriceResultList")
     public RESTfulResult getOilPriceResultList(@RequestBody(required = false) Map<String, Object> mapValue,
@@ -149,40 +169,13 @@ public class RmsOilPriceController extends BaseRESTfulController {
         if (mapValue==null){
             mapValue=new HashMap<>();
         }
-        //框计算
-        if (con != null) {
-            if (!"undefined".equals(con)) {
-                //设置要查询的索引名称
-                String index = "get_oil_price_list";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue, index, apiId, pageNum, pageSize, con));
-            }
-        }
-        //初始化过滤
-        List<Map<String, Object>> listTotal = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if (mapValue.size() == 0) {
-            //将查询结果存入索引中
-            listTotal = rmsOilPriceService.getOilPriceList(null);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index", "get_oil_price_list");
-            //添加id
-            map.put("indexId", "priceId");
-            listTotal.add(map);
-            //新建索引
-            String s = JSON.toJSONString(listTotal);
-            esFeign.insertIndex(listTotal);
-            //删除
-            listTotal.remove(listTotal.size() - 1);
-        }
-        if (listTotal == null) {
-            listTotal = rmsOilPriceService.getOilPriceList(mapValue);
+        if(con != null && !"".equals(con) && !"null".equals(con)){
+            mapValue.put("index", con);
         }
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = rmsOilPriceService.getOilPriceList(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
+        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
         return success(data);
     }
 

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

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 
+import java.math.BigDecimal;
 import java.util.Map;
 
 /**
@@ -30,6 +31,6 @@ public interface AmsFeign {
     @ApiImplicitParams({
     })
     @PostMapping(value = "/api/v1/ams/amscontracttruckprices/batchUpdateTransportPriceByOilPrice1")
-    Map<String, Object> batchUpdateTransportPriceByOilPrice1();
+    Map<String, Object> batchUpdateTransportPriceByOilPrice1(Map<String, Object> map);
 
 }

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

@@ -16,13 +16,17 @@ public interface RmsCapacityMapper extends IBaseMapper<RmsCapacity, BigDecimal>
 
     //根据运力id获取运力信息
     List<Map<String, Object>> getCapacityById(BigDecimal id);
+
     //运力下拉框
     List<Map<String,Object>> getCapacityTypeId();
+
     //运力id自增
     @Select("select seq_RMS_CAPACITY.nextval from dual")
     BigDecimal selectCapacityId();
+
    //承运商下拉框
     List<Map<String, Object>> getCarrierId();
+
     //通过车牌号查询是否存在重复值
     Integer selectBycapacityNumber(String number);
 

+ 11 - 0
src/main/java/com/steerinfo/dil/mapper/RmsLineGatepostCalculateMapper.java

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

+ 4 - 1
src/main/java/com/steerinfo/dil/mapper/RmsOilPriceMapper.java

@@ -19,5 +19,8 @@ public interface RmsOilPriceMapper extends IBaseMapper<RmsOilPrice, BigDecimal>
     BigDecimal selectOilPriceId();
 
     //根据Id寻找油价
-    List<Map<String, Object>> getOilPriceById(BigDecimal id);
+    Map<String, Object> getOilPriceById(BigDecimal id);
+
+    //通过油品ID获取上一次油品价格
+    Map<String, Object> getLastOilPrice(BigDecimal oilNameId);
 }

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

@@ -0,0 +1,20 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsOilType;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface RmsOilTypeMapper extends IBaseMapper<RmsOilType, BigDecimal> {
+
+    @Select("select MAX(OIL_TYPE_ID) + 1 from RMS_OIL_TYPE")
+    Integer selectMaxId();
+
+    //油品名称下拉框
+    List<Map<String, Object>> oilNameSelect();
+}

+ 169 - 0
src/main/java/com/steerinfo/dil/model/RmsLineGatepostCalculate.java

@@ -0,0 +1,169 @@
+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 RmsLineGatepostCalculate implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(LINE_GATE_CAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal lineGateCalId;
+
+    /**
+     * 线路子表ID(SEGMENT_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="线路子表ID",required=false)
+    private BigDecimal segmentId;
+
+    /**
+     * 门岗或汽车衡ID(GATE_CAL_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="门岗或汽车衡ID",required=false)
+    private BigDecimal gateCalId;
+
+    /**
+     * 记录创建人(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;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.lineGateCalId;
+    }
+
+    @Override
+    public void setId(BigDecimal lineGateCalId) {
+        this.lineGateCalId = lineGateCalId;
+    }
+
+    public BigDecimal getLineGateCalId() {
+        return lineGateCalId;
+    }
+
+    public void setLineGateCalId(BigDecimal lineGateCalId) {
+        this.lineGateCalId = lineGateCalId;
+    }
+
+    public BigDecimal getSegmentId() {
+        return segmentId;
+    }
+
+    public void setSegmentId(BigDecimal segmentId) {
+        this.segmentId = segmentId;
+    }
+
+    public BigDecimal getGateCalId() {
+        return gateCalId;
+    }
+
+    public void setGateCalId(BigDecimal gateCalId) {
+        this.gateCalId = gateCalId;
+    }
+
+    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(", lineGateCalId=").append(lineGateCalId);
+        sb.append(", segmentId=").append(segmentId);
+        sb.append(", gateCalId=").append(gateCalId);
+        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();
+    }
+}

+ 40 - 9
src/main/java/com/steerinfo/dil/model/RmsOilPrice.java

@@ -3,22 +3,23 @@ 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 RmsOilPrice implements IBasePO<BigDecimal> {
     /**
-     * 油价ID(PRICE_ID,DECIMAL,38)
+     * 油价ID(PRICE_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="油价ID",required=true)
     private BigDecimal priceId;
 
     /**
-     * 油名(PRICE_OIL_NAME,VARCHAR,20)
+     * 油名ID(PRICE_OIL_TYPE_ID,DECIMAL,20)
      */
-    @ApiModelProperty(value="油名",required=false)
-    private String priceOilName;
+    @ApiModelProperty(value="油名ID",required=false)
+    private BigDecimal priceOilTypeId;
 
     /**
      * 油价(PRICE_VALUE,DECIMAL,0)
@@ -68,6 +69,18 @@ public class RmsOilPrice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="逻辑删除",required=false)
     private BigDecimal deleted;
 
+    /**
+     * 油价启用状态(PRICE_STATUS,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油价启用状态",required=false)
+    private BigDecimal priceStatus;
+
+    /**
+     * 浮动比例(FLOATING_SCALE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="浮动比例",required=false)
+    private BigDecimal floatingScale;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -88,12 +101,12 @@ public class RmsOilPrice implements IBasePO<BigDecimal> {
         this.priceId = priceId;
     }
 
-    public String getPriceOilName() {
-        return priceOilName;
+    public BigDecimal getPriceOilTypeId() {
+        return priceOilTypeId;
     }
 
-    public void setPriceOilName(String priceOilName) {
-        this.priceOilName = priceOilName == null ? null : priceOilName.trim();
+    public void setPriceOilTypeId(BigDecimal priceOilTypeId) {
+        this.priceOilTypeId = priceOilTypeId;
     }
 
     public BigDecimal getPriceValue() {
@@ -160,6 +173,22 @@ public class RmsOilPrice implements IBasePO<BigDecimal> {
         this.deleted = deleted;
     }
 
+    public BigDecimal getPriceStatus() {
+        return priceStatus;
+    }
+
+    public void setPriceStatus(BigDecimal priceStatus) {
+        this.priceStatus = priceStatus;
+    }
+
+    public BigDecimal getFloatingScale() {
+        return floatingScale;
+    }
+
+    public void setFloatingScale(BigDecimal floatingScale) {
+        this.floatingScale = floatingScale;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -167,7 +196,7 @@ public class RmsOilPrice implements IBasePO<BigDecimal> {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", priceId=").append(priceId);
-        sb.append(", priceOilName=").append(priceOilName);
+        sb.append(", priceOilTypeId=").append(priceOilTypeId);
         sb.append(", priceValue=").append(priceValue);
         sb.append(", priceDate=").append(priceDate);
         sb.append(", insertUsername=").append(insertUsername);
@@ -176,6 +205,8 @@ public class RmsOilPrice implements IBasePO<BigDecimal> {
         sb.append(", updateTime=").append(updateTime);
         sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
         sb.append(", deleted=").append(deleted);
+        sb.append(", priceStatus=").append(priceStatus);
+        sb.append(", floatingScale=").append(floatingScale);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 154 - 0
src/main/java/com/steerinfo/dil/model/RmsOilType.java

@@ -0,0 +1,154 @@
+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 RmsOilType implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(OIL_TYPE_ID,DECIMAL,38)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal oilTypeId;
+
+    /**
+     * 油品名称(OIL_TYPE_NAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="油品名称",required=false)
+    private String oilTypeName;
+
+    /**
+     * 记录创建人(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,38)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.oilTypeId;
+    }
+
+    @Override
+    public void setId(BigDecimal oilTypeId) {
+        this.oilTypeId = oilTypeId;
+    }
+
+    public BigDecimal getOilTypeId() {
+        return oilTypeId;
+    }
+
+    public void setOilTypeId(BigDecimal oilTypeId) {
+        this.oilTypeId = oilTypeId;
+    }
+
+    public String getOilTypeName() {
+        return oilTypeName;
+    }
+
+    public void setOilTypeName(String oilTypeName) {
+        this.oilTypeName = oilTypeName == null ? null : oilTypeName.trim();
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", oilTypeId=").append(oilTypeId);
+        sb.append(", oilTypeName=").append(oilTypeName);
+        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();
+    }
+}

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

@@ -28,7 +28,7 @@ public interface IRmsCapacityService{
 
     int updateCapacity(RmsCapacity rmsCapacity);
 
-    String deleteCapacity(BigDecimal id);
+    int deleteCapacity(BigDecimal id);
 
     List<Map<String, Object>> getCapacityById(BigDecimal id);
 

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

@@ -20,7 +20,8 @@ import java.util.Map;
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  */
 public interface IRmsLineService {
-    int insertSelective(RmsLine rmsLine);
+
+    int insertSelective(Map<String, Object> mapVal);
 
     //根据运输路线主表id查询运输路线主表信息
     Map<String, Object> getRmsLine(BigDecimal lineId);

+ 8 - 4
src/main/java/com/steerinfo/dil/service/IRmsOilPriceService.java

@@ -21,14 +21,18 @@ import java.util.Map;
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  */
 public interface IRmsOilPriceService{
+
     List<Map<String, Object>> getOilPriceList(Map<String,Object> mapVal);
 
 
-    int insertOilPrice(RmsOilPrice rmsOilPrice);
+    int insertOilPrice(Map<String,Object> map);
+
+    int updateOilPrice(Integer id);
 
-    int updateOilPrice(RmsOilPrice rmsOilPrice);
+    int deleteOilPrice(BigDecimal id);
 
-    Object deleteOilPrice(BigDecimal id);
+    Map<String, Object> getOilPriceById(BigDecimal id);
 
-    List<Map<String, Object>> getOilPriceById(BigDecimal id);
+    //添加油品名称
+    int addOilType(String oilTypeName);
 }

+ 4 - 9
src/main/java/com/steerinfo/dil/service/impl/RmsCapacityServiceImpl.java

@@ -48,7 +48,7 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
         //如果车辆已存在  那就是更改承运商
         Integer capacityId = rmsCapacityMapper.selectBycapacityNumber(capacityNumber);
         if(capacityId != null){
-            rmsCapacity.setCarrierId(new BigDecimal(capacityId));
+            rmsCapacity.setCapacityId(new BigDecimal(capacityId));
             rmsCapacity.setCarrierId(carrierIds);
             return rmsCapacityMapper.updateByPrimaryKeySelective(rmsCapacity);
         }
@@ -87,14 +87,8 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
     * 删除运力信息
     * */
     @Override
-    public String deleteCapacity(BigDecimal id) {
-          RmsCapacity rmsCapacity=new RmsCapacity();
-          rmsCapacity.setCapacityId(id);
-         //根据id查找ssoid
-          String ssoId = rmsCapacityMapper.ssoIdBycapacityId(id);
-          rmsCapacity.setDeleted(new BigDecimal(1));
-          rmsCapacityMapper.updateByPrimaryKeySelective(rmsCapacity);
-          return  ssoId;
+    public int deleteCapacity(BigDecimal id) {
+        return  rmsCapacityMapper.deleteByPrimaryKey(id);
     }
 
     /**
@@ -124,6 +118,7 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
         return map;
     }
 
+    //获取承运商id
     @Override
     public List<Map<String, Object>> getCarrierId() {
         return rmsCapacityMapper.getCarrierId();

+ 58 - 2
src/main/java/com/steerinfo/dil/service/impl/RmsLineServiceImpl.java

@@ -1,12 +1,21 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.mapper.CommonSeq;
+import com.steerinfo.dil.mapper.RmsLineGatepostCalculateMapper;
 import com.steerinfo.dil.mapper.RmsLineMapper;
+import com.steerinfo.dil.mapper.RmsLineSegemntMapper;
 import com.steerinfo.dil.model.RmsLine;
+import com.steerinfo.dil.model.RmsLineGatepostCalculate;
+import com.steerinfo.dil.model.RmsLineSegemnt;
+import com.steerinfo.dil.service.IRmsLineSegemntService;
 import com.steerinfo.dil.service.IRmsLineService;
+import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -29,9 +38,56 @@ public class RmsLineServiceImpl implements IRmsLineService {
     @Autowired
     private RmsLineMapper rmsLineMapper;
 
+    @Autowired
+    CommonSeq commonSeq;
+
+    @Autowired
+    RmsLineSegemntMapper rmsLineSegemntMapper;
+
+    @Autowired
+    private RmsLineGatepostCalculateMapper rmsLineGatepostCalculateMapper;
+
+
+    @Transactional
     @Override
-    public int insertSelective(RmsLine rmsLine) {
-        return rmsLineMapper.insertSelective(rmsLine);
+    public int insertSelective(Map<String, Object> map) {
+        //添加线路
+        RmsLine rmsLine = new RmsLine();
+        int lineId = commonSeq.getId("seq_RMS_LINE");
+        rmsLine.setLineId(new BigDecimal(lineId));
+        rmsLine.setLineName((String) map.get("line_name"));
+        rmsLine.setLineType(DataChange.dataToBigDecimal(map.get("line_type")).intValue());
+        rmsLine.setLineNo(DataChange.generateEightDigitsNumber("YSXL", lineId));
+        rmsLine.setSpellNumber(DataChange.dataToBigDecimal(map.get("spellNumber")).intValue());
+        rmsLine.setDeleted(0);
+        rmsLine.setInsertTime(new Date());
+        //添加线路子表数据 以及线路子表的子表
+        List<Map<String, Object>> linkList = (List<Map<String, Object>>) map.get("linkList");
+        RmsLineSegemnt rmsLineSegemnt = new RmsLineSegemnt();
+        rmsLineSegemnt.setLineId(new BigDecimal(lineId));   //添加线路主键
+        rmsLineSegemnt.setDeleted(0);
+        rmsLineSegemnt.setInsertTime(new Date());
+        int i = 1, j = 1;
+        for (Map<String, Object> linkMap : linkList) {
+            int segmentId = commonSeq.getId("seq_RMS_LINE_SEGEMNT");
+            rmsLineSegemnt.setId(new BigDecimal(segmentId));
+            rmsLineSegemnt.setSegmentSqe(new BigDecimal(i++)); //设置路段顺序号
+            rmsLineSegemnt.setSegmentStartNodeId(DataChange.dataToBigDecimal(linkMap.get("linkId")));//设置线路类型(进厂、出厂)等
+            List<Integer> params = (List<Integer>) linkMap.get("gateGuard"); //作业点
+            //添加线路子表的子表
+            RmsLineGatepostCalculate rmsLineGatepostCalculate = new RmsLineGatepostCalculate();
+            rmsLineGatepostCalculate.setSegmentId(new BigDecimal(segmentId)); //添加线路子表主键
+            rmsLineGatepostCalculate.setInsertTime(new Date());
+            for (Integer id : params) { //可能会有多个作业点
+                rmsLineGatepostCalculate.setId(new BigDecimal(commonSeq.getId("seq_line_gate_calc")));
+                rmsLineGatepostCalculate.setGateCalId(new BigDecimal(id));
+                rmsLineGatepostCalculate.setDeleted(new BigDecimal(0));
+                j += rmsLineGatepostCalculateMapper.insertSelective(rmsLineGatepostCalculate);
+            }
+            j += rmsLineSegemntMapper.insertSelective(rmsLineSegemnt);
+        }
+        j += rmsLineMapper.insertSelective(rmsLine);
+        return j;
     }
 
     @Override

+ 119 - 22
src/main/java/com/steerinfo/dil/service/impl/RmsOilPriceServiceImpl.java

@@ -1,6 +1,9 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.feign.AmsFeign;
+import com.steerinfo.dil.mapper.RmsOilTypeMapper;
+import com.steerinfo.dil.model.RmsOilType;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 import com.steerinfo.dil.model.RmsOilPrice;
@@ -8,8 +11,11 @@ import com.steerinfo.dil.mapper.RmsOilPriceMapper;
 import com.steerinfo.dil.service.IRmsOilPriceService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import java.util.Date;
 import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -33,46 +39,137 @@ public class RmsOilPriceServiceImpl implements IRmsOilPriceService {
     private RmsOilPriceMapper rmsOilPriceMapper;
     @Autowired
     private AmsFeign amsFeign;
-
+    @Autowired
+    private RmsOilTypeMapper rmsOilTypeMapper;
 
     @Override
     //展示油价,该操作还有一些元素未明,框计算报错,但能通过测试,bug排除第二优先级
     public List<Map<String, Object>> getOilPriceList(Map<String, Object> mapVal) {
-        return this.rmsOilPriceMapper.getOilPriceList(mapVal);
-    }
-    //插入新油价操作该操作正确无误,bug排查第三优先级
-    @Override
-    public int insertOilPrice(RmsOilPrice rmsOilPrice) {
-        //批量修改油价
-        amsFeign.batchUpdateTransportPriceByOilPrice1();
-        rmsOilPrice.setInsertUsername("admin");
-        rmsOilPrice.setInsertTime(new Date());
-        rmsOilPrice.setDeleted(new BigDecimal(0));
-        rmsOilPrice.setPriceId(rmsOilPriceMapper.selectOilPriceId());
-        return rmsOilPriceMapper.insertSelective(rmsOilPrice);
+        List<Map<String, Object>> oilPriceList = rmsOilPriceMapper.getOilPriceList(mapVal);
+        BigDecimal num = new BigDecimal(100);
+        for (Map<String, Object> map : oilPriceList) {
+            BigDecimal floatingScale = DataChange.dataToBigDecimal(map.get("floatingScale"));
+            map.put("floatingScale", floatingScale.multiply(num) + "%");
+        }
+        return oilPriceList;
     }
 
+
+    /**
+     * 启用油价
+     * @Author TXF
+     * @Date 2022/1/21 9:08
+     * @param id
+     * @return
+     **/
     @Override
-    //更新油价,还需要改改,排查bug第一优先级
-    public int updateOilPrice(RmsOilPrice rmsOilPrice) {
-        rmsOilPrice.setUpdateUsername("admin");
+    public int updateOilPrice(Integer id) {
+        RmsOilPrice rmsOilPrice = new RmsOilPrice();
+        Map<String, Object> mesMap = rmsOilPriceMapper.getOilPriceById(new BigDecimal(id));
+        if(DataChange.dataToBigDecimal(mesMap.get("priceStatus")).intValue() == 0){
+            return 0;
+        }
+        rmsOilPrice.setId(new BigDecimal(id));
         rmsOilPrice.setUpdateTime(new Date());
+        rmsOilPrice.setPriceStatus(new BigDecimal(0));
         //油价联动
-        amsFeign.batchUpdateTransportPriceByOilPrice1();
-        return  this.rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice);
+        amsFeign.batchUpdateTransportPriceByOilPrice1(mesMap);
+        return rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice);
     }
+
     //根据Id删除油价,该操作通过测试,排查第三优先级
     @Override
-    public Object deleteOilPrice(BigDecimal id) {
-        RmsOilPrice rmsOilPrice = this.rmsOilPriceMapper.selectByPrimaryKey(id);
+    public int deleteOilPrice(BigDecimal id) {
+        //如果是已经启用的则不能删除
+        Map<String, Object> mesMap = rmsOilPriceMapper.getOilPriceById(id);
+        BigDecimal priceStatus = DataChange.dataToBigDecimal(mesMap.get("priceStatus"));
+        if(priceStatus.intValue() != 1){
+            return 0;
+        }
+        RmsOilPrice rmsOilPrice = new RmsOilPrice();
+        rmsOilPrice.setPriceId(id);
         rmsOilPrice.setDeleted(new BigDecimal(1));
-        return this.rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice) ;
+        return rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice) ;
     }
 
 
     //根据Id查询油价
     @Override
-    public List<Map<String, Object>> getOilPriceById(BigDecimal id) {
+    public Map<String, Object> getOilPriceById(BigDecimal id) {
         return this.rmsOilPriceMapper.getOilPriceById(id);
     }
+
+
+
+    /**
+     * 新增油价
+     * @Author TXF
+     * @Date 2022/1/19 17:09
+     * @param map
+     * @return
+     **/
+    @Transactional
+    @Override
+    public int insertOilPrice(Map<String,Object> map) {
+        RmsOilPrice rmsOilPrice = new RmsOilPrice();
+        rmsOilPrice.setPriceId(rmsOilPriceMapper.selectOilPriceId());
+
+        //获取油品ID、油价日期、油价
+        BigDecimal oilNameId = DataChange.dataToBigDecimal(map.get("oilNameId"));
+        rmsOilPrice.setPriceOilTypeId(oilNameId);
+        rmsOilPrice.setPriceDate(new Date((long) map.get("priceDate")));
+        BigDecimal priceValue = DataChange.dataToBigDecimal(map.get("priceValue"));
+        rmsOilPrice.setPriceValue(priceValue);
+        //根据油品ID获取上一次油价价格计算油价浮动
+        Map<String, Object> mesMap = rmsOilPriceMapper.getLastOilPrice(oilNameId);
+        BigDecimal n = null; //浮动比例
+        if(mesMap != null){
+            BigDecimal lastPrice = DataChange.dataToBigDecimal(mesMap.get("priceValue"));
+            BigDecimal subtract = priceValue.subtract(lastPrice); //当前油价减去上一次油价
+            n = subtract.divide(lastPrice, 4,BigDecimal.ROUND_HALF_UP);
+            rmsOilPrice.setFloatingScale(n); //四舍五入
+        }
+        //如果新增的油价是启用的则关闭之前的已启用的
+        Boolean priceStatus = (Boolean) map.get("priceStatus");
+        if(priceStatus){
+            if(mesMap != null){
+                RmsOilPrice rmsOilPrice2 = new RmsOilPrice();
+                rmsOilPrice2.setPriceStatus(new BigDecimal(1));
+                rmsOilPrice2.setPriceId(DataChange.dataToBigDecimal(mesMap.get("priceId")));
+                rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice2);
+            }
+            //设置启用状态
+            rmsOilPrice.setPriceStatus(new BigDecimal(0));
+            //批量修改油价
+            Map<String, Object> updateMesMap = new HashMap<>();
+            updateMesMap.put("oilTypeId",oilNameId);
+            updateMesMap.put("newOilPrice", priceValue);
+            amsFeign.batchUpdateTransportPriceByOilPrice1(updateMesMap);
+        }else {
+            //否则设置停用状态
+            rmsOilPrice.setPriceStatus(new BigDecimal(1));
+        }
+        rmsOilPrice.setInsertUsername("admin");
+        rmsOilPrice.setInsertTime(new Date());
+        rmsOilPrice.setDeleted(new BigDecimal(0));
+        return rmsOilPriceMapper.insertSelective(rmsOilPrice);
+    }
+
+    /**
+     * 添加油品名称
+     * @Author TXF
+     * @Date 2022/1/19 17:11
+     * @param oilTypeName
+     * @return
+     **/
+    public int addOilType(String oilTypeName){
+        RmsOilType rmsOilType = new RmsOilType();
+        Integer maxId = rmsOilTypeMapper.selectMaxId();
+        rmsOilType.setOilTypeId(new BigDecimal(maxId==null?1:maxId));
+        rmsOilType.setOilTypeName(oilTypeName);
+        rmsOilType.setDeleted(new BigDecimal(0));
+        rmsOilType.setInsertTime(new Date());
+        rmsOilType.setInsertUsername("admin");
+        return rmsOilTypeMapper.insertSelective(rmsOilType);
+    }
 }

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

@@ -29,7 +29,7 @@ public class ColumnDataUtil {
         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);

+ 1 - 1
src/main/resources/application-dev.yml

@@ -12,7 +12,7 @@ openFeign:
     ESFeign:
       url: ${ESFEIGN_URL:172.16.33.162:8011}
     ColumnDataFeign:
-      url: ${COLUMNDATAFEIGN_URL:172.16.33.162:8001}
+      url: ${COLUMNDATAFEIGN_URL:172.16.33.166:8083}
     AmsFeign:
       url: ${AMSFEIGN_URL:172.16.33.162:8015}
 server:

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

@@ -199,7 +199,7 @@
       </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
     delete from RMS_CAPACITY
     where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
   </delete>
@@ -549,7 +549,7 @@
     </set>
     where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
     <include refid="select" />
     where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
   </select>

+ 319 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsLineGatepostCalculateMapper.xml

@@ -0,0 +1,319 @@
+<?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.RmsLineGatepostCalculateMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsLineGatepostCalculate">
+    <id column="LINE_GATE_CAL_ID" jdbcType="DECIMAL" property="lineGateCalId" />
+    <result column="SEGMENT_ID" jdbcType="DECIMAL" property="segmentId" />
+    <result column="GATE_CAL_ID" jdbcType="DECIMAL" property="gateCalId" />
+    <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">
+    LINE_GATE_CAL_ID, SEGMENT_ID, GATE_CAL_ID, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+    UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.LINE_GATE_CAL_ID, t.SEGMENT_ID, t.GATE_CAL_ID, t.INSERT_USERNAME, t.INSERT_TIME, 
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM RMS_LINE_GATEPOST_CALCULATE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM RMS_LINE_GATEPOST_CALCULATE t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="lineGateCalId != null">
+        and LINE_GATE_CAL_ID = #{lineGateCalId}
+      </if>
+      <if test="segmentId != null">
+        and SEGMENT_ID = #{segmentId}
+      </if>
+      <if test="gateCalId != null">
+        and GATE_CAL_ID = #{gateCalId}
+      </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="lineGateCalId != null">
+        and LINE_GATE_CAL_ID = #{lineGateCalId}
+      </if>
+      <if test="segmentId != null">
+        and SEGMENT_ID = #{segmentId}
+      </if>
+      <if test="gateCalId != null">
+        and GATE_CAL_ID = #{gateCalId}
+      </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 RMS_LINE_GATEPOST_CALCULATE
+    where LINE_GATE_CAL_ID = #{lineGateCalId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from RMS_LINE_GATEPOST_CALCULATE
+    where 1!=1 
+      <if test="segmentId != null">
+        or SEGMENT_ID = #{segmentId}
+      </if>
+      <if test="gateCalId != null">
+        or GATE_CAL_ID = #{gateCalId}
+      </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.RmsLineGatepostCalculate">
+    insert into RMS_LINE_GATEPOST_CALCULATE (LINE_GATE_CAL_ID, SEGMENT_ID, GATE_CAL_ID, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED
+      )
+    values (#{lineGateCalId,jdbcType=DECIMAL}, #{segmentId,jdbcType=DECIMAL}, #{gateCalId,jdbcType=DECIMAL}, 
+      #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsLineGatepostCalculate">
+    insert into RMS_LINE_GATEPOST_CALCULATE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="lineGateCalId != null">
+        LINE_GATE_CAL_ID,
+      </if>
+      <if test="segmentId != null">
+        SEGMENT_ID,
+      </if>
+      <if test="gateCalId != null">
+        GATE_CAL_ID,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="lineGateCalId != null">
+        #{lineGateCalId,jdbcType=DECIMAL},
+      </if>
+      <if test="segmentId != null">
+        #{segmentId,jdbcType=DECIMAL},
+      </if>
+      <if test="gateCalId != null">
+        #{gateCalId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsLineGatepostCalculate">
+    update RMS_LINE_GATEPOST_CALCULATE
+    set SEGMENT_ID = #{segmentId,jdbcType=DECIMAL},
+      GATE_CAL_ID = #{gateCalId,jdbcType=DECIMAL},
+      INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      DELETED = #{deleted,jdbcType=DECIMAL}
+    where LINE_GATE_CAL_ID = #{lineGateCalId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsLineGatepostCalculate">
+    update RMS_LINE_GATEPOST_CALCULATE
+    <set>
+      <if test="segmentId != null">
+        SEGMENT_ID = #{segmentId,jdbcType=DECIMAL},
+      </if>
+      <if test="gateCalId != null">
+        GATE_CAL_ID = #{gateCalId,jdbcType=DECIMAL},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where LINE_GATE_CAL_ID = #{lineGateCalId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where LINE_GATE_CAL_ID = #{lineGateCalId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into RMS_LINE_GATEPOST_CALCULATE 
+      (LINE_GATE_CAL_ID, 
+      SEGMENT_ID, GATE_CAL_ID, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.lineGateCalId,jdbcType=DECIMAL}, 
+      #{item.segmentId,jdbcType=DECIMAL}, #{item.gateCalId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR}, 
+      #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
+      #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
+      #{item.deleted,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update RMS_LINE_GATEPOST_CALCULATE
+     set
+       LINE_GATE_CAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.lineGateCalId,jdbcType=DECIMAL}
+       </foreach>
+       ,SEGMENT_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.segmentId,jdbcType=DECIMAL}
+       </foreach>
+       ,GATE_CAL_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.gateCalId,jdbcType=DECIMAL}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case LINE_GATE_CAL_ID" separator=" ">
+          when #{item.lineGateCalId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+     where LINE_GATE_CAL_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.lineGateCalId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from RMS_LINE_GATEPOST_CALCULATE
+    where LINE_GATE_CAL_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+  
+</mapper>

+ 2 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsLineMapper.xml

@@ -564,6 +564,8 @@
             THEN '采购'
           WHEN RL.LINE_TYPE = 4
             THEN '退货'
+          WHEN RL.LINE_TYPE = 5
+            THEN '零星'
           END) "lineType",
       (
         SELECT

+ 226 - 130
src/main/resources/com/steerinfo/dil/mapper/RmsOilPriceMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.steerinfo.dil.mapper.RmsOilPriceMapper">
   <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsOilPrice">
     <id column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
-    <result column="PRICE_OIL_NAME" jdbcType="VARCHAR" property="priceOilName" />
+    <result column="PRICE_OIL_TYPE_ID" jdbcType="DECIMAL" property="priceOilTypeId" />
     <result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
     <result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
     <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
@@ -11,14 +11,18 @@
     <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="PRICE_STATUS" jdbcType="DECIMAL" property="priceStatus" />
+    <result column="FLOATING_SCALE" jdbcType="DECIMAL" property="floatingScale" />
   </resultMap>
   <sql id="columns">
-    PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, 
-    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
+    PRICE_ID, PRICE_OIL_TYPE_ID, PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, 
+    UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, PRICE_STATUS, FLOATING_SCALE
   </sql>
   <sql id="columns_alias">
-    t.PRICE_ID, t.PRICE_OIL_NAME, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME, 
-    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+    t.PRICE_ID, t.PRICE_OIL_TYPE_ID, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, 
+    t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, 
+    t.PRICE_STATUS, t.FLOATING_SCALE
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_OIL_PRICE
@@ -27,12 +31,12 @@
     SELECT <include refid="columns_alias" /> FROM RMS_OIL_PRICE t
   </sql>
   <sql id="where">
-    <where> 
+    <where>
       <if test="priceId != null">
         and PRICE_ID = #{priceId}
       </if>
-      <if test="priceOilName != null and priceOilName != ''">
-        and PRICE_OIL_NAME = #{priceOilName}
+      <if test="priceOilTypeId != null">
+        and PRICE_OIL_TYPE_ID = #{priceOilTypeId}
       </if>
       <if test="priceValue != null">
         and PRICE_VALUE = #{priceValue}
@@ -55,15 +59,24 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
       </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="priceStatus != null">
+        and PRICE_STATUS = #{priceStatus}
+      </if>
+      <if test="floatingScale != null">
+        and FLOATING_SCALE = #{floatingScale}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
-    <where> 
+    <where>
       <if test="priceId != null">
         and PRICE_ID = #{priceId}
       </if>
-      <if test="priceOilName != null and priceOilName != ''">
-        and PRICE_OIL_NAME LIKE '%${priceOilName}%'
+      <if test="priceOilTypeId != null">
+        and PRICE_OIL_TYPE_ID = #{priceOilTypeId}
       </if>
       <if test="priceValue != null">
         and PRICE_VALUE = #{priceValue}
@@ -86,49 +99,69 @@
       <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
         and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
       </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="priceStatus != null">
+        and PRICE_STATUS = #{priceStatus}
+      </if>
+      <if test="floatingScale != null">
+        and FLOATING_SCALE = #{floatingScale}
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
     delete from RMS_OIL_PRICE
     where PRICE_ID = #{priceId,jdbcType=DECIMAL}
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from RMS_OIL_PRICE
-    where 1!=1 
-      <if test="priceOilName != null and priceOilName != ''">
-        or PRICE_OIL_NAME = #{priceOilName}
-      </if>
-      <if test="priceValue != null">
-        or PRICE_VALUE = #{priceValue}
-      </if>
-      <if test="priceDate != null">
-        or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
-      </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>
+    where 1!=1
+    <if test="priceOilTypeId != null">
+      or PRICE_OIL_TYPE_ID = #{priceOilTypeId}
+    </if>
+    <if test="priceValue != null">
+      or PRICE_VALUE = #{priceValue}
+    </if>
+    <if test="priceDate != null">
+      or TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = '#{priceDate}'
+    </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="priceStatus != null">
+      or PRICE_STATUS = #{priceStatus}
+    </if>
+    <if test="floatingScale != null">
+      or FLOATING_SCALE = #{floatingScale}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.RmsOilPrice">
-    insert into RMS_OIL_PRICE (PRICE_ID, PRICE_OIL_NAME, PRICE_VALUE, 
-      PRICE_DATE, INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
-      )
-    values (#{priceId,jdbcType=DECIMAL}, #{priceOilName,jdbcType=VARCHAR}, #{priceValue,jdbcType=DECIMAL}, 
-      #{priceDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, 
-      #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}
-      )
+    insert into RMS_OIL_PRICE (PRICE_ID, PRICE_OIL_TYPE_ID, PRICE_VALUE,
+                               PRICE_DATE, INSERT_USERNAME, INSERT_TIME,
+                               UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
+                               DELETED, PRICE_STATUS, FLOATING_SCALE
+    )
+    values (#{priceId,jdbcType=DECIMAL}, #{priceOilTypeId,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL},
+            #{priceDate,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
+            #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
+            #{deleted,jdbcType=DECIMAL}, #{priceStatus,jdbcType=DECIMAL}, #{floatingScale,jdbcType=DECIMAL}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsOilPrice">
     insert into RMS_OIL_PRICE
@@ -136,8 +169,8 @@
       <if test="priceId != null">
         PRICE_ID,
       </if>
-      <if test="priceOilName != null">
-        PRICE_OIL_NAME,
+      <if test="priceOilTypeId != null">
+        PRICE_OIL_TYPE_ID,
       </if>
       <if test="priceValue != null">
         PRICE_VALUE,
@@ -163,13 +196,19 @@
       <if test="deleted != null">
         DELETED,
       </if>
+      <if test="priceStatus != null">
+        PRICE_STATUS,
+      </if>
+      <if test="floatingScale != null">
+        FLOATING_SCALE,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="priceId != null">
         #{priceId,jdbcType=DECIMAL},
       </if>
-      <if test="priceOilName != null">
-        #{priceOilName,jdbcType=VARCHAR},
+      <if test="priceOilTypeId != null">
+        #{priceOilTypeId,jdbcType=DECIMAL},
       </if>
       <if test="priceValue != null">
         #{priceValue,jdbcType=DECIMAL},
@@ -195,26 +234,34 @@
       <if test="deleted != null">
         #{deleted,jdbcType=DECIMAL},
       </if>
+      <if test="priceStatus != null">
+        #{priceStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="floatingScale != null">
+        #{floatingScale,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsOilPrice">
     update RMS_OIL_PRICE
-    set PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
-      PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
-      PRICE_DATE = #{priceDate,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}
+    set PRICE_OIL_TYPE_ID = #{priceOilTypeId,jdbcType=DECIMAL},
+        PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
+        PRICE_DATE = #{priceDate,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},
+        PRICE_STATUS = #{priceStatus,jdbcType=DECIMAL},
+        FLOATING_SCALE = #{floatingScale,jdbcType=DECIMAL}
     where PRICE_ID = #{priceId,jdbcType=DECIMAL}
   </update>
-  <update id="updateByPrimaryKeySelective"  parameterType="com.steerinfo.dil.model.RmsOilPrice">
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsOilPrice">
     update RMS_OIL_PRICE
     <set>
-      <if test="priceOilName != null">
-        PRICE_OIL_NAME = #{priceOilName,jdbcType=VARCHAR},
+      <if test="priceOilTypeId != null">
+        PRICE_OIL_TYPE_ID = #{priceOilTypeId,jdbcType=DECIMAL},
       </if>
       <if test="priceValue != null">
         PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
@@ -240,11 +287,16 @@
       <if test="deleted != null">
         DELETED = #{deleted,jdbcType=DECIMAL},
       </if>
-
+      <if test="priceStatus != null">
+        PRICE_STATUS = #{priceStatus,jdbcType=DECIMAL},
+      </if>
+      <if test="floatingScale != null">
+        FLOATING_SCALE = #{floatingScale,jdbcType=DECIMAL},
+      </if>
     </set>
     where PRICE_ID = #{priceId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
     <include refid="select" />
     where PRICE_ID = #{priceId,jdbcType=DECIMAL}
   </select>
@@ -257,68 +309,82 @@
     <include refid="whereLike" />
   </select>
   <insert id="batchInsert" parameterType="java.util.List">
-    insert into RMS_OIL_PRICE 
-      (PRICE_ID, 
-      PRICE_OIL_NAME, PRICE_VALUE, PRICE_DATE, 
-      INSERT_USERNAME, INSERT_TIME, 
-      UPDATE_USERNAME, UPDATE_TIME, 
-      INSERT_UPDATE_REMARK)
-    ( <foreach collection="list" item="item" separator="union all"> 
-   select  
-      #{item.priceId,jdbcType=DECIMAL}, 
-      #{item.priceOilName,jdbcType=VARCHAR}, #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP}, 
-      #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
-      #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
-      #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual  
-   </foreach> )
+    insert into RMS_OIL_PRICE
+    (PRICE_ID,
+    PRICE_OIL_TYPE_ID, PRICE_VALUE, PRICE_DATE,
+    INSERT_USERNAME, INSERT_TIME,
+    UPDATE_USERNAME, UPDATE_TIME,
+    INSERT_UPDATE_REMARK, DELETED,
+    PRICE_STATUS, FLOATING_SCALE)
+    ( <foreach collection="list" item="item" separator="union all">
+    select
+    #{item.priceId,jdbcType=DECIMAL},
+    #{item.priceOilTypeId,jdbcType=DECIMAL}, #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,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},
+    #{item.priceStatus,jdbcType=DECIMAL}, #{item.floatingScale,jdbcType=DECIMAL} from dual
+  </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
-     update RMS_OIL_PRICE
-     set
-       PRICE_ID=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
-       </foreach>
-       ,PRICE_OIL_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.priceOilName,jdbcType=VARCHAR}
-       </foreach>
-       ,PRICE_VALUE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
-       </foreach>
-       ,PRICE_DATE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_USERNAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,INSERT_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,UPDATE_USERNAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
-       </foreach>
-       ,UPDATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
-       </foreach>
-       ,INSERT_UPDATE_REMARK=
-       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-          when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
-       </foreach>
-     where PRICE_ID in 
-     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
-    #{item.priceId,jdbcType=DECIMAL}
-     </foreach> 
+    update RMS_OIL_PRICE
+    set
+    PRICE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
+    </foreach>
+    ,PRICE_OIL_TYPE_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.priceOilTypeId,jdbcType=DECIMAL}
+    </foreach>
+    ,PRICE_VALUE=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
+    </foreach>
+    ,PRICE_DATE=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,INSERT_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,UPDATE_USERNAME=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+    </foreach>
+    ,UPDATE_TIME=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+    </foreach>
+    ,INSERT_UPDATE_REMARK=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+    </foreach>
+    ,DELETED=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+    </foreach>
+    ,PRICE_STATUS=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.priceStatus,jdbcType=DECIMAL}
+    </foreach>
+    ,FLOATING_SCALE=
+    <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+      when #{item.priceId,jdbcType=DECIMAL} then #{item.floatingScale,jdbcType=DECIMAL}
+    </foreach>
+    where PRICE_ID in
+    <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+      #{item.priceId,jdbcType=DECIMAL}
+    </foreach>
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from RMS_OIL_PRICE
-    where PRICE_ID in 
+    where PRICE_ID in
     <foreach close=")" collection="list" item="id" open="(" separator=",">
       #{id}
     </foreach>
@@ -332,16 +398,23 @@
     (
     SELECT
     ROP.PRICE_ID AS "priceId",
-    ROP.PRICE_OIL_NAME AS "priceOilName",
+    ROT.OIL_TYPE_NAME AS "priceOilName",
     ROP.PRICE_VALUE AS "priceValue",
-    ROP.PRICE_DATE AS "priceDate"
+    ROP.PRICE_DATE AS "priceDate",
+    ROP.FLOATING_SCALE  "floatingScale",
+    (case when ROP.PRICE_STATUS = 0
+          then '启用'
+          when ROP.PRICE_STATUS = 1
+          then '停用'
+     end ) "priceStatus"
     FROM RMS_OIL_PRICE ROP
-    WHERE ROP.DELETED !=1
+    left join RMS_OIL_TYPE ROT
+        on ROP.PRICE_OIL_TYPE_ID = ROT.OIL_TYPE_ID
+    WHERE ROP.DELETED = 0
     ORDER BY ROP.INSERT_TIME DESC
     )
     <where>
       <if test="priceId!= null">
-        and
         <foreach collection="priceId" item="item" open="(" separator="," close=")">
           "priceId" in #{item}
         </foreach>
@@ -364,10 +437,22 @@
           "priceDate" in #{item}
         </foreach>
       </if>
-
+      <if test="floatingScale!= null">
+        and
+        <foreach collection="floatingScale" item="item" open="(" separator="," close=")">
+          "floatingScale" in #{item}
+        </foreach>
+      </if>
+      <if test="priceStatus!= null">
+        and
+        <foreach collection="priceStatus" item="item" open="(" separator="," close=")">
+          "priceStatus" in #{item}
+        </foreach>
+      </if>
     </where>
     <include refid="orderBy"></include>
   </select>
+
   <sql id="orderBy">
     <if test="orderField!=null and orderField !=''">
       order by "${orderField}"
@@ -380,17 +465,28 @@
 
 
   <!--根据Id查询油价-->
-  <select id="getOilPriceById" resultType="java.util.LinkedHashMap" >
+  <select id="getOilPriceById" parameterType="map" resultType="java.util.LinkedHashMap" >
     SELECT
       ROP.PRICE_ID AS "priceId",
-      ROP.PRICE_OIL_NAME AS "priceOilName",
-      ROP.PRICE_VALUE AS "priceValue",
-      ROP.PRICE_DATE AS "priceDate"
+      ROP.PRICE_OIL_TYPE_ID AS "oilTypeId", --批量修改运输单价
+      ROP.PRICE_VALUE AS "newOilPrice", --批量修改运输单价
+      ROP.PRICE_DATE AS "priceDate",
+      ROP.PRICE_STATUS  "priceStatus",
+      ROP.FLOATING_SCALE    "floatingScale"
     FROM RMS_OIL_PRICE ROP
     WHERE ROP.PRICE_ID=#{id}
 
   </select>
-  
+
+<!-- 通过油品ID获取上一次油品价格 -->
+  <select id="getLastOilPrice" parameterType="java.math.BigDecimal" resultType="java.util.Map">
+    select ROP.PRICE_VALUE "priceValue",
+           ROP.PRICE_ID "priceId"
+    from RMS_OIL_PRICE ROP
+    where ROP.PRICE_OIL_TYPE_ID = #{oilNameId}
+      and ROP.DELETED = 0
+      and ROP.PRICE_STATUS = 0
+  </select>
 
 
 

+ 301 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsOilTypeMapper.xml

@@ -0,0 +1,301 @@
+<?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.RmsOilTypeMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsOilType">
+    <id column="OIL_TYPE_ID" jdbcType="DECIMAL" property="oilTypeId" />
+    <result column="OIL_TYPE_NAME" jdbcType="VARCHAR" property="oilTypeName" />
+    <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">
+    OIL_TYPE_ID, OIL_TYPE_NAME, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+    INSERT_UPDATE_REMARK, DELETED
+  </sql>
+  <sql id="columns_alias">
+    t.OIL_TYPE_ID, t.OIL_TYPE_NAME, 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 RMS_OIL_TYPE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM RMS_OIL_TYPE t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="oilTypeId != null">
+        and OIL_TYPE_ID = #{oilTypeId}
+      </if>
+      <if test="oilTypeName != null and oilTypeName != ''">
+        and OIL_TYPE_NAME = #{oilTypeName}
+      </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="oilTypeId != null">
+        and OIL_TYPE_ID = #{oilTypeId}
+      </if>
+      <if test="oilTypeName != null and oilTypeName != ''">
+        and OIL_TYPE_NAME LIKE '%${oilTypeName}%'
+      </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 RMS_OIL_TYPE
+    where OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from RMS_OIL_TYPE
+    where 1!=1 
+      <if test="oilTypeName != null and oilTypeName != ''">
+        or OIL_TYPE_NAME = #{oilTypeName}
+      </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.RmsOilType">
+    insert into RMS_OIL_TYPE (OIL_TYPE_ID, OIL_TYPE_NAME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+      INSERT_UPDATE_REMARK, DELETED)
+    values (#{oilTypeId,jdbcType=DECIMAL}, #{oilTypeName,jdbcType=VARCHAR}, #{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.RmsOilType">
+    insert into RMS_OIL_TYPE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="oilTypeId != null">
+        OIL_TYPE_ID,
+      </if>
+      <if test="oilTypeName != null">
+        OIL_TYPE_NAME,
+      </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="oilTypeId != null">
+        #{oilTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="oilTypeName != null">
+        #{oilTypeName,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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsOilType">
+    update RMS_OIL_TYPE
+    set OIL_TYPE_NAME = #{oilTypeName,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}
+    where OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsOilType">
+    update RMS_OIL_TYPE
+    <set>
+      <if test="oilTypeName != null">
+        OIL_TYPE_NAME = #{oilTypeName,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>
+    </set>
+    where OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="where" />
+  </select>
+  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select" />
+    <include refid="whereLike" />
+  </select>
+  <insert id="batchInsert" parameterType="java.util.List">
+    insert into RMS_OIL_TYPE 
+      (OIL_TYPE_ID, 
+      OIL_TYPE_NAME, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.oilTypeId,jdbcType=DECIMAL}, 
+      #{item.oilTypeName,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} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update RMS_OIL_TYPE
+     set
+       OIL_TYPE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.oilTypeId,jdbcType=DECIMAL}
+       </foreach>
+       ,OIL_TYPE_NAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.oilTypeName,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,INSERT_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,UPDATE_USERNAME=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
+       </foreach>
+       ,UPDATE_TIME=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
+       </foreach>
+       ,INSERT_UPDATE_REMARK=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
+       </foreach>
+       ,DELETED=
+       <foreach close="end" collection="list" index="index" item="item" open="case OIL_TYPE_ID" separator=" ">
+          when #{item.oilTypeId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
+       </foreach>
+     where OIL_TYPE_ID in 
+     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+    #{item.oilTypeId,jdbcType=DECIMAL}
+     </foreach> 
+  </update>
+  <delete id="batchDelete" parameterType="java.util.List">
+    delete from RMS_OIL_TYPE
+    where OIL_TYPE_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
+<!-- 油品名称下拉框 -->
+  <select id="oilNameSelect" resultType="java.util.Map">
+    select
+      ROT.OIL_TYPE_ID "id",
+      ROT.OIL_TYPE_ID "value",
+      ROT.OIL_TYPE_NAME "label"
+    from RMS_OIL_TYPE ROT
+  </select>
+
+</mapper>