luobang 1 yıl önce
ebeveyn
işleme
cb14737684

+ 1 - 1
pom.xml

@@ -116,7 +116,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>BMSTRUCK_STATEMENT</param><!--运力-->
+                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param><!--运力-->
                     </tables>
                 </configuration>
                 <executions>

+ 16 - 0
src/main/java/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.java

@@ -0,0 +1,16 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.AmsContractTransportPrice;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.math.BigDecimal;
+
+@Mapper
+public interface AmsContractTransportPriceMapper extends IBaseMapper<AmsContractTransportPrice, BigDecimal> {
+
+    //查询主键最大值
+    @Select("select seq_truck_price.nextval from dual")
+    BigDecimal selectMaxId();
+}

+ 10 - 0
src/main/java/com/steerinfo/dil/mapper/BmstruckDetailsOrderMapper.java

@@ -7,6 +7,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 @Mapper
@@ -225,4 +226,13 @@ public interface BmstruckDetailsOrderMapper extends IBaseMapper<BmstruckDetailsO
     int updateTruckDetails(Map<String,Object> map);
 
     int updateConsignee(Map<String,Object> map);
+
+    int updateOrderPrice(@Param("orderId") BigDecimal orderId, @Param("priceId") BigDecimal priceId);
+
+    int updateAsomPriceIdByOrderId(@Param("orderId") BigDecimal orderId, @Param("priceId") BigDecimal priceId);
+
+    String getUserNameByUserId(String userId);
+
+    List<BigDecimal> getOrderIds(BigDecimal orderId);
+
 }

+ 424 - 0
src/main/java/com/steerinfo/dil/model/AmsContractTransportPrice.java

@@ -0,0 +1,424 @@
+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 AmsContractTransportPrice implements IBasePO<BigDecimal> {
+    /**
+     * 主键ID(PRICE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="主键ID",required=true)
+    private BigDecimal priceId;
+
+    /**
+     * 托运人ID(SHIPPER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="托运人ID",required=false)
+    private BigDecimal shipperId;
+
+    /**
+     * 承运商ID(CARRIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="承运商ID",required=false)
+    private BigDecimal carrierId;
+
+    /**
+     * 运输线路ID(LINE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运输线路ID",required=false)
+    private BigDecimal lineId;
+
+    /**
+     * 运力类型ID(CAPACITY_TYPE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运力类型ID",required=false)
+    private BigDecimal capacityTypeId;
+
+    /**
+     * 货物类型ID(CARGONAME_ID,CHAR,20)
+     */
+    @ApiModelProperty(value="货物类型ID",required=false)
+    private String cargonameId;
+
+    /**
+     * 吨公里(元/吨.km)(PRICE_TON_KILOMETER,DECIMAL,0)
+     */
+    @ApiModelProperty(value="吨公里(元/吨.km)",required=false)
+    private BigDecimal priceTonKilometer;
+
+    /**
+     * 运价(保留两位小数)(PRICE_VALUE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运价(保留两位小数)",required=false)
+    private BigDecimal priceValue;
+
+    /**
+     * 执行日期(PRICE_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="执行日期",required=false)
+    private Date priceDate;
+
+    /**
+     * 记录创建人(INSERT_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录创建人",required=false)
+    private String insertUsername;
+
+    /**
+     * 记录创建时间(INSERT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录创建时间",required=false)
+    private Date insertTime;
+
+    /**
+     * 记录修改人(UPDATE_USERNAME,VARCHAR,20)
+     */
+    @ApiModelProperty(value="记录修改人",required=false)
+    private String updateUsername;
+
+    /**
+     * 记录修改时间(UPDATE_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="记录修改时间",required=false)
+    private Date updateTime;
+
+    /**
+     * 记录创建或修改备注(INSERT_UPDATE_REMARK,VARCHAR,100)
+     */
+    @ApiModelProperty(value="记录创建或修改备注",required=false)
+    private String insertUpdateRemark;
+
+    /**
+     * 逻辑删除(DELETED,DECIMAL,0)
+     */
+    @ApiModelProperty(value="逻辑删除",required=false)
+    private BigDecimal deleted;
+
+    /**
+     * 收货地址ID(PLACE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="收货地址ID",required=false)
+    private BigDecimal placeId;
+
+    /**
+     * 类型:1为销售钢材 2为内转计重 3为采购水运 4为采购汽运5内转计时 6内转计数7采购内转8销售非钢材(TYPE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="类型:1为销售钢材 2为内转计重 3为采购水运 4为采购汽运5内转计时 6内转计数7采购内转8销售非钢材",required=false)
+    private BigDecimal type;
+
+    /**
+     * 所属部门: 1:为物流运输部 2:为化产焦炭部(DEPARTMENT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="所属部门: 1:为物流运输部 2:为化产焦炭部",required=false)
+    private BigDecimal department;
+
+    /**
+     * 油价基准(OILPRICE_BASE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油价基准",required=false)
+    private BigDecimal oilpriceBase;
+
+    /**
+     * 油品名称ID(OIL_TYPE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油品名称ID",required=false)
+    private BigDecimal oilTypeId;
+
+    /**
+     * 油价变化率阈值(OILPRICE_CHANGE_THRESHOLD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油价变化率阈值",required=false)
+    private BigDecimal oilpriceChangeThreshold;
+
+    /**
+     * 历史时间(OLD_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="历史时间",required=false)
+    private Date oldDate;
+
+    /**
+     * 运输距离(HAUL_DISTANCE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运输距离",required=false)
+    private BigDecimal haulDistance;
+
+    /**
+     * 中标合同作为参考依据:1参考(REFERENCE_HT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="中标合同作为参考依据:1参考",required=false)
+    private BigDecimal referenceHt;
+
+    /**
+     * 地址为库存(INVENTORY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="地址为库存",required=false)
+    private BigDecimal inventory;
+
+    /**
+     * 1:非标准单价(ISSTANDARD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="1:非标准单价",required=false)
+    private BigDecimal isstandard;
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public BigDecimal getId() {
+        return this.priceId;
+    }
+
+    @Override
+    public void setId(BigDecimal priceId) {
+        this.priceId = priceId;
+    }
+
+    public BigDecimal getPriceId() {
+        return priceId;
+    }
+
+    public void setPriceId(BigDecimal priceId) {
+        this.priceId = priceId;
+    }
+
+    public BigDecimal getShipperId() {
+        return shipperId;
+    }
+
+    public void setShipperId(BigDecimal shipperId) {
+        this.shipperId = shipperId;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
+    public BigDecimal getLineId() {
+        return lineId;
+    }
+
+    public void setLineId(BigDecimal lineId) {
+        this.lineId = lineId;
+    }
+
+    public BigDecimal getCapacityTypeId() {
+        return capacityTypeId;
+    }
+
+    public void setCapacityTypeId(BigDecimal capacityTypeId) {
+        this.capacityTypeId = capacityTypeId;
+    }
+
+    public String getCargonameId() {
+        return cargonameId;
+    }
+
+    public void setCargonameId(String cargonameId) {
+        this.cargonameId = cargonameId == null ? null : cargonameId.trim();
+    }
+
+    public BigDecimal getPriceTonKilometer() {
+        return priceTonKilometer;
+    }
+
+    public void setPriceTonKilometer(BigDecimal priceTonKilometer) {
+        this.priceTonKilometer = priceTonKilometer;
+    }
+
+    public BigDecimal getPriceValue() {
+        return priceValue;
+    }
+
+    public void setPriceValue(BigDecimal priceValue) {
+        this.priceValue = priceValue;
+    }
+
+    public Date getPriceDate() {
+        return priceDate;
+    }
+
+    public void setPriceDate(Date priceDate) {
+        this.priceDate = priceDate;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername == null ? null : insertUsername.trim();
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername == null ? null : updateUsername.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark == null ? null : insertUpdateRemark.trim();
+    }
+
+    public BigDecimal getDeleted() {
+        return deleted;
+    }
+
+    public void setDeleted(BigDecimal deleted) {
+        this.deleted = deleted;
+    }
+
+    public BigDecimal getPlaceId() {
+        return placeId;
+    }
+
+    public void setPlaceId(BigDecimal placeId) {
+        this.placeId = placeId;
+    }
+
+    public BigDecimal getType() {
+        return type;
+    }
+
+    public void setType(BigDecimal type) {
+        this.type = type;
+    }
+
+    public BigDecimal getDepartment() {
+        return department;
+    }
+
+    public void setDepartment(BigDecimal department) {
+        this.department = department;
+    }
+
+    public BigDecimal getOilpriceBase() {
+        return oilpriceBase;
+    }
+
+    public void setOilpriceBase(BigDecimal oilpriceBase) {
+        this.oilpriceBase = oilpriceBase;
+    }
+
+    public BigDecimal getOilTypeId() {
+        return oilTypeId;
+    }
+
+    public void setOilTypeId(BigDecimal oilTypeId) {
+        this.oilTypeId = oilTypeId;
+    }
+
+    public BigDecimal getOilpriceChangeThreshold() {
+        return oilpriceChangeThreshold;
+    }
+
+    public void setOilpriceChangeThreshold(BigDecimal oilpriceChangeThreshold) {
+        this.oilpriceChangeThreshold = oilpriceChangeThreshold;
+    }
+
+    public Date getOldDate() {
+        return oldDate;
+    }
+
+    public void setOldDate(Date oldDate) {
+        this.oldDate = oldDate;
+    }
+
+    public BigDecimal getHaulDistance() {
+        return haulDistance;
+    }
+
+    public void setHaulDistance(BigDecimal haulDistance) {
+        this.haulDistance = haulDistance;
+    }
+
+    public BigDecimal getReferenceHt() {
+        return referenceHt;
+    }
+
+    public void setReferenceHt(BigDecimal referenceHt) {
+        this.referenceHt = referenceHt;
+    }
+
+    public BigDecimal getInventory() {
+        return inventory;
+    }
+
+    public void setInventory(BigDecimal inventory) {
+        this.inventory = inventory;
+    }
+
+    public BigDecimal getIsstandard() {
+        return isstandard;
+    }
+
+    public void setIsstandard(BigDecimal isstandard) {
+        this.isstandard = isstandard;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", priceId=").append(priceId);
+        sb.append(", shipperId=").append(shipperId);
+        sb.append(", carrierId=").append(carrierId);
+        sb.append(", lineId=").append(lineId);
+        sb.append(", capacityTypeId=").append(capacityTypeId);
+        sb.append(", cargonameId=").append(cargonameId);
+        sb.append(", priceTonKilometer=").append(priceTonKilometer);
+        sb.append(", priceValue=").append(priceValue);
+        sb.append(", priceDate=").append(priceDate);
+        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(", placeId=").append(placeId);
+        sb.append(", type=").append(type);
+        sb.append(", department=").append(department);
+        sb.append(", oilpriceBase=").append(oilpriceBase);
+        sb.append(", oilTypeId=").append(oilTypeId);
+        sb.append(", oilpriceChangeThreshold=").append(oilpriceChangeThreshold);
+        sb.append(", oldDate=").append(oldDate);
+        sb.append(", haulDistance=").append(haulDistance);
+        sb.append(", referenceHt=").append(referenceHt);
+        sb.append(", inventory=").append(inventory);
+        sb.append(", isstandard=").append(isstandard);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 23 - 0
src/main/java/com/steerinfo/dil/service/impl/BmstruckDetailsOrderServiceImpl.java

@@ -3,8 +3,10 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.feign.AmsFeign;
 import com.steerinfo.dil.feign.JoinApiFeign;
 import com.steerinfo.dil.feign.OmsFeign;
+import com.steerinfo.dil.mapper.AmsContractTransportPriceMapper;
 import com.steerinfo.dil.mapper.BmstruckDetailsOrderMapper;
 import com.steerinfo.dil.mapper.OmstruckOrderMapper;
+import com.steerinfo.dil.model.AmsContractTransportPrice;
 import com.steerinfo.dil.model.BmstruckDetailsOrder;
 import com.steerinfo.dil.model.OmstruckOrder;
 import com.steerinfo.dil.service.IBmstruckDetailsOrderService;
@@ -59,6 +61,9 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
     @Autowired
     SaleLogUtil saleLogUtil;
 
+    @Autowired
+    AmsContractTransportPriceMapper amsContractTransportPriceMapper;
+
     //以下订单类型是需要算计量实绩的
     final private List<Integer>  inwardTypeList = Arrays.asList(10,11,15,16,23,24,20,25);
     //以下订单类型是需要根据线路去匹配承运起止范围以及物资
@@ -95,6 +100,11 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
     public synchronized int insertSelective(BigDecimal orderId) throws Exception {
         System.out.println(orderId + "生成计费详单");
         List<Map<String,Object>> weightTaskResultIdList = bmstruckDetailsOrderMapper.getSteelWeightTaskResultId(orderId);
+        //根据该id寻找相同的订单号
+        List<BigDecimal> orderIds = bmstruckDetailsOrderMapper.getOrderIds(orderId);
+        for (BigDecimal orderId1 : orderIds) {
+            weightTaskResultIdList.addAll(bmstruckDetailsOrderMapper.getSteelWeightTaskResultId(orderId1));
+        }
         Map<String,Object> priceMap = getPriceId(orderId);
         if (priceMap == null || priceMap.size() == 0) {
             return 0;
@@ -1201,7 +1211,13 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
         }
         String detailRemark = mapValue.get("detailRemark").toString();
         String userId = mapValue.get("userId").toString();
+        String userName = bmstruckDetailsOrderMapper.getUserNameByUserId(userId);
         String url = mapValue.get("url").toString();
+        AmsContractTransportPrice amsContractTransportPrice = new AmsContractTransportPrice();
+        BigDecimal priceId = amsContractTransportPriceMapper.selectMaxId();
+        amsContractTransportPrice.setPriceId(priceId);
+        amsContractTransportPrice.setPriceValue(priceValue);
+        amsContractTransportPrice.setPriceDate(new Date());
         int result = 0;
         for(int i=0;i<orderIds.size();i++){
             BigDecimal orderId = DataChange.dataToBigDecimal(orderIds.get(i));
@@ -1210,6 +1226,11 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
             if(orderType.intValue() != 1){
                 throw new Exception("订单类型错误,不允许生成汽运计费详单");
             }
+            //更新订单表单价
+            bmstruckDetailsOrderMapper.updateOrderPrice(orderId,priceId);
+            //更新车序号表单价
+            bmstruckDetailsOrderMapper.updateAsomPriceIdByOrderId(orderId,priceId);
+            saleLogUtil.logOrder(orderId,"直接修改单价",userName,SaleLogUtil.UPDATE);
             //查询订单计量详情
             List<Map<String,Object>> weightTaskResultIdList = bmstruckDetailsOrderMapper.getSteelWeightTaskResultId(orderId);
             for (Map<String, Object> map : weightTaskResultIdList) {
@@ -1266,6 +1287,7 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
                 }
             }
         }
+        amsContractTransportPriceMapper.insertSelective(amsContractTransportPrice);
         return result;
     }
 
@@ -1276,6 +1298,7 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
         BigDecimal detailsAmount = DataChange.dataToBigDecimal(mapValue.get("detailAmount"));
         String detailRemark = mapValue.get("detailRemark").toString();
         String userId = mapValue.get("userId").toString();
+
         String urls = "" + mapValue.get("urls");
         int result = 0;
         for(int i=0;i<orderIds.size();i++){

+ 755 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.xml

@@ -0,0 +1,755 @@
+<?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.AmsContractTransportPriceMapper">
+  <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsContractTransportPrice">
+    <id column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
+    <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId" />
+    <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
+    <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
+    <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
+    <result column="CARGONAME_ID" jdbcType="CHAR" property="cargonameId" />
+    <result column="PRICE_TON_KILOMETER" jdbcType="DECIMAL" property="priceTonKilometer" />
+    <result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
+    <result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
+    <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+    <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+    <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
+    <result column="PLACE_ID" jdbcType="DECIMAL" property="placeId" />
+    <result column="TYPE" jdbcType="DECIMAL" property="type" />
+    <result column="DEPARTMENT" jdbcType="DECIMAL" property="department" />
+    <result column="OILPRICE_BASE" jdbcType="DECIMAL" property="oilpriceBase" />
+    <result column="OIL_TYPE_ID" jdbcType="DECIMAL" property="oilTypeId" />
+    <result column="OILPRICE_CHANGE_THRESHOLD" jdbcType="DECIMAL" property="oilpriceChangeThreshold" />
+    <result column="OLD_DATE" jdbcType="TIMESTAMP" property="oldDate" />
+    <result column="HAUL_DISTANCE" jdbcType="DECIMAL" property="haulDistance" />
+    <result column="REFERENCE_HT" jdbcType="DECIMAL" property="referenceHt" />
+    <result column="INVENTORY" jdbcType="DECIMAL" property="inventory" />
+    <result column="ISSTANDARD" jdbcType="DECIMAL" property="isstandard" />
+  </resultMap>
+  <sql id="columns">
+    PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER, 
+    PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
+    INSERT_UPDATE_REMARK, DELETED, PLACE_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID, 
+    OILPRICE_CHANGE_THRESHOLD, OLD_DATE, HAUL_DISTANCE, REFERENCE_HT, INVENTORY, ISSTANDARD
+  </sql>
+  <sql id="columns_alias">
+    t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_TYPE_ID, t.CARGONAME_ID, 
+    t.PRICE_TON_KILOMETER, 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.PLACE_ID, 
+    t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD, 
+    t.OLD_DATE, t.HAUL_DISTANCE, t.REFERENCE_HT, t.INVENTORY, t.ISSTANDARD
+  </sql>
+  <sql id="select">
+    SELECT <include refid="columns" /> FROM AMS_CONTRACT_TRANSPORT_PRICE
+  </sql>
+  <sql id="select_alias">
+    SELECT <include refid="columns_alias" /> FROM AMS_CONTRACT_TRANSPORT_PRICE t
+  </sql>
+  <sql id="where">
+    <where> 
+      <if test="priceId != null">
+        and PRICE_ID = #{priceId}
+      </if>
+      <if test="shipperId != null">
+        and SHIPPER_ID = #{shipperId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="lineId != null">
+        and LINE_ID = #{lineId}
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="cargonameId != null">
+        and CARGONAME_ID = #{cargonameId}
+      </if>
+      <if test="priceTonKilometer != null">
+        and PRICE_TON_KILOMETER = #{priceTonKilometer}
+      </if>
+      <if test="priceValue != null">
+        and PRICE_VALUE = #{priceValue}
+      </if>
+      <if test="priceDate != null">
+        and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME = #{insertUsername}
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME = #{updateUsername}
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="placeId != null">
+        and PLACE_ID = #{placeId}
+      </if>
+      <if test="type != null">
+        and TYPE = #{type}
+      </if>
+      <if test="department != null">
+        and DEPARTMENT = #{department}
+      </if>
+      <if test="oilpriceBase != null">
+        and OILPRICE_BASE = #{oilpriceBase}
+      </if>
+      <if test="oilTypeId != null">
+        and OIL_TYPE_ID = #{oilTypeId}
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+      </if>
+      <if test="oldDate != null">
+        and TO_CHAR(OLD_DATE,'yyyy-MM-dd') = #{oldDate}
+      </if>
+      <if test="haulDistance != null">
+        and HAUL_DISTANCE = #{haulDistance}
+      </if>
+      <if test="referenceHt != null">
+        and REFERENCE_HT = #{referenceHt}
+      </if>
+      <if test="inventory != null">
+        and INVENTORY = #{inventory}
+      </if>
+      <if test="isstandard != null">
+        and ISSTANDARD = #{isstandard}
+      </if>
+    </where>
+  </sql>
+  <sql id="whereLike">
+    <where> 
+      <if test="priceId != null">
+        and PRICE_ID = #{priceId}
+      </if>
+      <if test="shipperId != null">
+        and SHIPPER_ID = #{shipperId}
+      </if>
+      <if test="carrierId != null">
+        and CARRIER_ID = #{carrierId}
+      </if>
+      <if test="lineId != null">
+        and LINE_ID = #{lineId}
+      </if>
+      <if test="capacityTypeId != null">
+        and CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="cargonameId != null">
+        and CARGONAME_ID = #{cargonameId}
+      </if>
+      <if test="priceTonKilometer != null">
+        and PRICE_TON_KILOMETER = #{priceTonKilometer}
+      </if>
+      <if test="priceValue != null">
+        and PRICE_VALUE = #{priceValue}
+      </if>
+      <if test="priceDate != null">
+        and TO_CHAR(PRICE_DATE,'yyyy-MM-dd') = #{priceDate}
+      </if>
+      <if test="insertUsername != null and insertUsername != ''">
+        and INSERT_USERNAME LIKE '%${insertUsername}%'
+      </if>
+      <if test="insertTime != null">
+        and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
+      </if>
+      <if test="updateUsername != null and updateUsername != ''">
+        and UPDATE_USERNAME LIKE '%${updateUsername}%'
+      </if>
+      <if test="updateTime != null">
+        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
+      </if>
+      <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+        and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
+      </if>
+      <if test="deleted != null">
+        and DELETED = #{deleted}
+      </if>
+      <if test="placeId != null">
+        and PLACE_ID = #{placeId}
+      </if>
+      <if test="type != null">
+        and TYPE = #{type}
+      </if>
+      <if test="department != null">
+        and DEPARTMENT = #{department}
+      </if>
+      <if test="oilpriceBase != null">
+        and OILPRICE_BASE = #{oilpriceBase}
+      </if>
+      <if test="oilTypeId != null">
+        and OIL_TYPE_ID = #{oilTypeId}
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+      </if>
+      <if test="oldDate != null">
+        and TO_CHAR(OLD_DATE,'yyyy-MM-dd') = #{oldDate}
+      </if>
+      <if test="haulDistance != null">
+        and HAUL_DISTANCE = #{haulDistance}
+      </if>
+      <if test="referenceHt != null">
+        and REFERENCE_HT = #{referenceHt}
+      </if>
+      <if test="inventory != null">
+        and INVENTORY = #{inventory}
+      </if>
+      <if test="isstandard != null">
+        and ISSTANDARD = #{isstandard}
+      </if>
+    </where>
+  </sql>
+  <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
+    delete from AMS_CONTRACT_TRANSPORT_PRICE
+    where PRICE_ID = #{priceId,jdbcType=DECIMAL}
+  </delete>
+  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+    delete from AMS_CONTRACT_TRANSPORT_PRICE
+    where 1!=1 
+      <if test="shipperId != null">
+        or SHIPPER_ID = #{shipperId}
+      </if>
+      <if test="carrierId != null">
+        or CARRIER_ID = #{carrierId}
+      </if>
+      <if test="lineId != null">
+        or LINE_ID = #{lineId}
+      </if>
+      <if test="capacityTypeId != null">
+        or CAPACITY_TYPE_ID = #{capacityTypeId}
+      </if>
+      <if test="cargonameId != null">
+        or CARGONAME_ID = #{cargonameId}
+      </if>
+      <if test="priceTonKilometer != null">
+        or PRICE_TON_KILOMETER = #{priceTonKilometer}
+      </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="placeId != null">
+        or PLACE_ID = #{placeId}
+      </if>
+      <if test="type != null">
+        or TYPE = #{type}
+      </if>
+      <if test="department != null">
+        or DEPARTMENT = #{department}
+      </if>
+      <if test="oilpriceBase != null">
+        or OILPRICE_BASE = #{oilpriceBase}
+      </if>
+      <if test="oilTypeId != null">
+        or OIL_TYPE_ID = #{oilTypeId}
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        or OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+      </if>
+      <if test="oldDate != null">
+        or TO_CHAR(OLD_DATE,'yyyy-MM-dd') = '#{oldDate}'
+      </if>
+      <if test="haulDistance != null">
+        or HAUL_DISTANCE = #{haulDistance}
+      </if>
+      <if test="referenceHt != null">
+        or REFERENCE_HT = #{referenceHt}
+      </if>
+      <if test="inventory != null">
+        or INVENTORY = #{inventory}
+      </if>
+      <if test="isstandard != null">
+        or ISSTANDARD = #{isstandard}
+      </if>
+  </delete>
+  <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
+    insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID, 
+      LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID, 
+      PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE, 
+      INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, 
+      PLACE_ID, TYPE, DEPARTMENT, 
+      OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD, 
+      OLD_DATE, HAUL_DISTANCE, REFERENCE_HT, 
+      INVENTORY, ISSTANDARD)
+    values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
+      #{lineId,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL}, #{cargonameId,jdbcType=CHAR}, 
+      #{priceTonKilometer,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}, 
+      #{placeId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL}, 
+      #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}, 
+      #{oldDate,jdbcType=TIMESTAMP}, #{haulDistance,jdbcType=DECIMAL}, #{referenceHt,jdbcType=DECIMAL}, 
+      #{inventory,jdbcType=DECIMAL}, #{isstandard,jdbcType=DECIMAL})
+  </insert>
+  <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
+    insert into AMS_CONTRACT_TRANSPORT_PRICE
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="priceId != null">
+        PRICE_ID,
+      </if>
+      <if test="shipperId != null">
+        SHIPPER_ID,
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID,
+      </if>
+      <if test="lineId != null">
+        LINE_ID,
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID,
+      </if>
+      <if test="cargonameId != null">
+        CARGONAME_ID,
+      </if>
+      <if test="priceTonKilometer != null">
+        PRICE_TON_KILOMETER,
+      </if>
+      <if test="priceValue != null">
+        PRICE_VALUE,
+      </if>
+      <if test="priceDate != null">
+        PRICE_DATE,
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME,
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME,
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME,
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME,
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK,
+      </if>
+      <if test="deleted != null">
+        DELETED,
+      </if>
+      <if test="placeId != null">
+        PLACE_ID,
+      </if>
+      <if test="type != null">
+        TYPE,
+      </if>
+      <if test="department != null">
+        DEPARTMENT,
+      </if>
+      <if test="oilpriceBase != null">
+        OILPRICE_BASE,
+      </if>
+      <if test="oilTypeId != null">
+        OIL_TYPE_ID,
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        OILPRICE_CHANGE_THRESHOLD,
+      </if>
+      <if test="oldDate != null">
+        OLD_DATE,
+      </if>
+      <if test="haulDistance != null">
+        HAUL_DISTANCE,
+      </if>
+      <if test="referenceHt != null">
+        REFERENCE_HT,
+      </if>
+      <if test="inventory != null">
+        INVENTORY,
+      </if>
+      <if test="isstandard != null">
+        ISSTANDARD,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="priceId != null">
+        #{priceId,jdbcType=DECIMAL},
+      </if>
+      <if test="shipperId != null">
+        #{shipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="lineId != null">
+        #{lineId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityTypeId != null">
+        #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="cargonameId != null">
+        #{cargonameId,jdbcType=CHAR},
+      </if>
+      <if test="priceTonKilometer != null">
+        #{priceTonKilometer,jdbcType=DECIMAL},
+      </if>
+      <if test="priceValue != null">
+        #{priceValue,jdbcType=DECIMAL},
+      </if>
+      <if test="priceDate != null">
+        #{priceDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="placeId != null">
+        #{placeId,jdbcType=DECIMAL},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=DECIMAL},
+      </if>
+      <if test="department != null">
+        #{department,jdbcType=DECIMAL},
+      </if>
+      <if test="oilpriceBase != null">
+        #{oilpriceBase,jdbcType=DECIMAL},
+      </if>
+      <if test="oilTypeId != null">
+        #{oilTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+      </if>
+      <if test="oldDate != null">
+        #{oldDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="haulDistance != null">
+        #{haulDistance,jdbcType=DECIMAL},
+      </if>
+      <if test="referenceHt != null">
+        #{referenceHt,jdbcType=DECIMAL},
+      </if>
+      <if test="inventory != null">
+        #{inventory,jdbcType=DECIMAL},
+      </if>
+      <if test="isstandard != null">
+        #{isstandard,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
+    update AMS_CONTRACT_TRANSPORT_PRICE
+    set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
+      CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      LINE_ID = #{lineId,jdbcType=DECIMAL},
+      CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+      CARGONAME_ID = #{cargonameId,jdbcType=CHAR},
+      PRICE_TON_KILOMETER = #{priceTonKilometer,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},
+      PLACE_ID = #{placeId,jdbcType=DECIMAL},
+      TYPE = #{type,jdbcType=DECIMAL},
+      DEPARTMENT = #{department,jdbcType=DECIMAL},
+      OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
+      OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
+      OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+      OLD_DATE = #{oldDate,jdbcType=TIMESTAMP},
+      HAUL_DISTANCE = #{haulDistance,jdbcType=DECIMAL},
+      REFERENCE_HT = #{referenceHt,jdbcType=DECIMAL},
+      INVENTORY = #{inventory,jdbcType=DECIMAL},
+      ISSTANDARD = #{isstandard,jdbcType=DECIMAL}
+    where PRICE_ID = #{priceId,jdbcType=DECIMAL}
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
+    update AMS_CONTRACT_TRANSPORT_PRICE
+    <set>
+      <if test="shipperId != null">
+        SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
+      </if>
+      <if test="carrierId != null">
+        CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+      </if>
+      <if test="lineId != null">
+        LINE_ID = #{lineId,jdbcType=DECIMAL},
+      </if>
+      <if test="capacityTypeId != null">
+        CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="cargonameId != null">
+        CARGONAME_ID = #{cargonameId,jdbcType=CHAR},
+      </if>
+      <if test="priceTonKilometer != null">
+        PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
+      </if>
+      <if test="priceValue != null">
+        PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
+      </if>
+      <if test="priceDate != null">
+        PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUsername != null">
+        INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="insertTime != null">
+        INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateUsername != null">
+        UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
+      </if>
+      <if test="updateTime != null">
+        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="insertUpdateRemark != null">
+        INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="deleted != null">
+        DELETED = #{deleted,jdbcType=DECIMAL},
+      </if>
+      <if test="placeId != null">
+        PLACE_ID = #{placeId,jdbcType=DECIMAL},
+      </if>
+      <if test="type != null">
+        TYPE = #{type,jdbcType=DECIMAL},
+      </if>
+      <if test="department != null">
+        DEPARTMENT = #{department,jdbcType=DECIMAL},
+      </if>
+      <if test="oilpriceBase != null">
+        OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
+      </if>
+      <if test="oilTypeId != null">
+        OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+      </if>
+      <if test="oldDate != null">
+        OLD_DATE = #{oldDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="haulDistance != null">
+        HAUL_DISTANCE = #{haulDistance,jdbcType=DECIMAL},
+      </if>
+      <if test="referenceHt != null">
+        REFERENCE_HT = #{referenceHt,jdbcType=DECIMAL},
+      </if>
+      <if test="inventory != null">
+        INVENTORY = #{inventory,jdbcType=DECIMAL},
+      </if>
+      <if test="isstandard != null">
+        ISSTANDARD = #{isstandard,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where PRICE_ID = #{priceId,jdbcType=DECIMAL}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="decimal" resultMap="BaseResultMap">
+    <include refid="select" />
+    where PRICE_ID = #{priceId,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 AMS_CONTRACT_TRANSPORT_PRICE 
+      (PRICE_ID, 
+      SHIPPER_ID, CARRIER_ID, LINE_ID, 
+      CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER, 
+      PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, 
+      INSERT_TIME, UPDATE_USERNAME, 
+      UPDATE_TIME, INSERT_UPDATE_REMARK, 
+      DELETED, PLACE_ID, TYPE, 
+      DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID, 
+      OILPRICE_CHANGE_THRESHOLD, OLD_DATE, 
+      HAUL_DISTANCE, REFERENCE_HT, INVENTORY, 
+      ISSTANDARD)
+    ( <foreach collection="list" item="item" separator="union all"> 
+   select  
+      #{item.priceId,jdbcType=DECIMAL}, 
+      #{item.shipperId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.lineId,jdbcType=DECIMAL}, 
+      #{item.capacityTypeId,jdbcType=DECIMAL}, #{item.cargonameId,jdbcType=CHAR}, #{item.priceTonKilometer,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.placeId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL}, 
+      #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL}, 
+      #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}, #{item.oldDate,jdbcType=TIMESTAMP}, 
+      #{item.haulDistance,jdbcType=DECIMAL}, #{item.referenceHt,jdbcType=DECIMAL}, #{item.inventory,jdbcType=DECIMAL}, 
+      #{item.isstandard,jdbcType=DECIMAL} from dual  
+   </foreach> )
+  </insert>
+  <update id="batchUpdate" parameterType="java.util.List">
+     update AMS_CONTRACT_TRANSPORT_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>
+       ,SHIPPER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
+       </foreach>
+       ,CARRIER_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+       </foreach>
+       ,LINE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
+       </foreach>
+       ,CAPACITY_TYPE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
+       </foreach>
+       ,CARGONAME_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.cargonameId,jdbcType=CHAR}
+       </foreach>
+       ,PRICE_TON_KILOMETER=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.priceTonKilometer,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>
+       ,PLACE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.placeId,jdbcType=DECIMAL}
+       </foreach>
+       ,TYPE=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.type,jdbcType=DECIMAL}
+       </foreach>
+       ,DEPARTMENT=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.department,jdbcType=DECIMAL}
+       </foreach>
+       ,OILPRICE_BASE=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceBase,jdbcType=DECIMAL}
+       </foreach>
+       ,OIL_TYPE_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.oilTypeId,jdbcType=DECIMAL}
+       </foreach>
+       ,OILPRICE_CHANGE_THRESHOLD=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}
+       </foreach>
+       ,OLD_DATE=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.oldDate,jdbcType=TIMESTAMP}
+       </foreach>
+       ,HAUL_DISTANCE=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.haulDistance,jdbcType=DECIMAL}
+       </foreach>
+       ,REFERENCE_HT=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.referenceHt,jdbcType=DECIMAL}
+       </foreach>
+       ,INVENTORY=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.inventory,jdbcType=DECIMAL}
+       </foreach>
+       ,ISSTANDARD=
+       <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+          when #{item.priceId,jdbcType=DECIMAL} then #{item.isstandard,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 AMS_CONTRACT_TRANSPORT_PRICE
+    where PRICE_ID in 
+    <foreach close=")" collection="list" item="id" open="(" separator=",">
+      #{id}
+    </foreach>
+  </delete>
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  <!-- 友情提示!!!-->
+  <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+  
+</mapper>

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

@@ -2536,7 +2536,10 @@
        WHERE OO.ORDER_ID=#{orderId}
        fetch first 1 row only
     </select>
-
+    <select id="getUserNameByUserId" resultType="java.lang.String">
+        SELECT USER_NAME FROM SSO.SYS_USER
+        WHERE USER_ID = #{userId}
+    </select>
     <insert id="insertPriceValue">
         insert into AMS_CONTRACT_TRANSPORT_PRICE(PRICE_ID,PRICE_VALUE,PLACE_ID,ISSTANDARD)
         VALUES(#{priceId},#{priceValue},#{placeId},'1')
@@ -2565,7 +2568,8 @@
             BDO.PRICE_VALUE = #{priceValue},
             BDO.PHOTO = #{url},
             BDO.UPDATE_USERNAME = #{userId},
-            BDO.REMARK = #{detailRemark}
+            BDO.REMARK = #{detailRemark},
+            BDO.INSERT_UPDATE_REMARK = '直接修改单价'
         WHERE BDO.ORDER_ID = #{orderId} AND BDO.WEIGHT_TASK_RESULT_ID=#{weightTaskResultId}
     </update>
     <update id="updateConsignee">
@@ -2573,4 +2577,23 @@
         SET BDO.CONSIGNEE_ID = #{consigneeId}
         WHERE BDO.ORDER_ID = #{orderId} AND BDO.DETAILS_ID=#{detailsId}
     </update>
+    <update id="updateOrderPrice">
+        UPDATE OMSTRUCK_ORDER
+        SET PRICE_ID = #{priceId}
+        WHERE ORDER_ID = #{orderId}
+    </update>
+    <update id="updateAsomPriceIdByOrderId">
+        UPDATE AMS_SALE_ORDER_MATERIAL ASOM
+        SET ASOM.PRICE_ID = #{priceId}
+        WHERE ASOM.SALE_ORDER_MATERIAL_ID =
+              (SELECT ORDER_PLAN_ID FROM OMSTRUCK_ORDER
+                  WHERE ORDER_ID = #{orderId})
+    </update>
+    <select id="getOrderIds" resultType="java.math.BigDecimal" parameterType="decimal">
+        SELECT OO.ORDER_ID FROM OMSTRUCK_ORDER OO
+        WHERE OO.ORDER_NUMBER =
+        (SELECT ORDER_NUMBER FROM OMSTRUCK_ORDER
+        WHERE ORDER_ID = #{orderId})
+        AND OO.ORDER_ID != #{orderId}
+    </select>
 </mapper>