|
@@ -20,17 +20,21 @@
|
|
|
<result column="ADDRESS_ID" jdbcType="DECIMAL" property="addressId" />
|
|
|
<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" />
|
|
|
</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, ADDRESS_ID, TYPE, DEPARTMENT
|
|
|
+ INSERT_UPDATE_REMARK, DELETED, ADDRESS_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
|
|
|
+ OILPRICE_CHANGE_THRESHOLD
|
|
|
</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.ADDRESS_ID,
|
|
|
- t.TYPE, t.DEPARTMENT
|
|
|
+ t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns" /> FROM AMS_CONTRACT_TRANSPORT_PRICE
|
|
@@ -94,6 +98,15 @@
|
|
|
<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>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
@@ -152,6 +165,15 @@
|
|
|
<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>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
@@ -212,6 +234,15 @@
|
|
|
<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>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
|
insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
|
|
@@ -219,14 +250,16 @@
|
|
|
PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
|
|
|
INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
|
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
|
|
|
- ADDRESS_ID, TYPE, DEPARTMENT
|
|
|
+ ADDRESS_ID, TYPE, DEPARTMENT,
|
|
|
+ OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD
|
|
|
)
|
|
|
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},
|
|
|
- #{addressId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL}
|
|
|
+ #{addressId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL},
|
|
|
+ #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}
|
|
|
)
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
@@ -286,6 +319,15 @@
|
|
|
<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>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="priceId != null">
|
|
@@ -342,6 +384,15 @@
|
|
|
<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>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
@@ -362,7 +413,10 @@
|
|
|
DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
|
|
|
TYPE = #{type,jdbcType=DECIMAL},
|
|
|
- DEPARTMENT = #{department,jdbcType=DECIMAL}
|
|
|
+ DEPARTMENT = #{department,jdbcType=DECIMAL},
|
|
|
+ OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
|
|
|
+ OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
|
|
|
+ OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL}
|
|
|
where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
@@ -419,6 +473,15 @@
|
|
|
<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>
|
|
|
</set>
|
|
|
where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
@@ -443,7 +506,8 @@
|
|
|
INSERT_TIME, UPDATE_USERNAME,
|
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
DELETED, ADDRESS_ID, TYPE,
|
|
|
- DEPARTMENT)
|
|
|
+ DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
|
|
|
+ OILPRICE_CHANGE_THRESHOLD)
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.priceId,jdbcType=DECIMAL},
|
|
@@ -453,7 +517,8 @@
|
|
|
#{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
|
|
|
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
#{item.deleted,jdbcType=DECIMAL}, #{item.addressId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
|
|
|
- #{item.department,jdbcType=DECIMAL} from dual
|
|
|
+ #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL},
|
|
|
+ #{item.oilpriceChangeThreshold,jdbcType=DECIMAL} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -531,6 +596,18 @@
|
|
|
<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>
|
|
|
where PRICE_ID in
|
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
#{item.priceId,jdbcType=DECIMAL}
|
|
@@ -555,10 +632,12 @@
|
|
|
r_r_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
r_carrier.CARRIER_NAME "carrierName",
|
|
|
r_line.LINE_PATH_LENGTH "linePathLength",
|
|
|
+ r_o_type.OIL_TYPE_NAME "oilTypeName",
|
|
|
r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
|
|
|
a_t_price.PRICE_VALUE "priceValue",
|
|
|
a_t_price.PRICE_TON_KILOMETER "priceTonKilometer",
|
|
|
a_t_price.PRICE_DATE "priceDate",
|
|
|
+ a_t_price.OILPRICE_BASE "oilpriceBase",
|
|
|
a_t_price.INSERT_TIME "insertTime"
|
|
|
from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
|
|
|
left join RMS_RECEIVE_ADDRESS r_r_address
|
|
@@ -569,8 +648,11 @@
|
|
|
on a_t_price.CARRIER_ID=r_carrier.CARRIER_ID
|
|
|
left join RMS_LINE r_line
|
|
|
on a_t_price.LINE_ID=r_line.LINE_ID
|
|
|
- where a_t_price.DELETED = 0
|
|
|
- and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2)
|
|
|
+ left join RMS_OIL_TYPE r_o_type
|
|
|
+ on a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
|
|
|
+-- where a_t_price.DELETED = 0
|
|
|
+-- and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2
|
|
|
+ )
|
|
|
|
|
|
<where>
|
|
|
<if test="addressProvince != null">
|
|
@@ -637,7 +719,7 @@
|
|
|
</where>
|
|
|
<include refid="orderBy"></include>
|
|
|
<if test="orderField == null ">
|
|
|
- order by "insertTime" desc
|
|
|
+ order by "priceDate" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
@@ -716,10 +798,11 @@
|
|
|
<select id="getPriceValueList" resultType="java.util.LinkedHashMap">
|
|
|
select a_t_price.PRICE_ID "priceId",
|
|
|
a_t_price.PRICE_VALUE "priceValue",
|
|
|
- a_t_price.CARRIER_ID "carrierId",
|
|
|
+ a_t_price.OILPRICE_BASE "oilpriceBase",
|
|
|
+ a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
|
|
|
a_t_price.CARGONAME_ID "cargonameId"
|
|
|
from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
|
|
|
- where a_t_price.DEPARTMENT = 2 and a_t_price.DELETED = 0
|
|
|
+ where a_t_price.OIL_TYPE_ID = #{oilTypeId} and a_t_price.DELETED = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="getPriceValueAndPriceTonKilometer" resultType="java.util.LinkedHashMap">
|
|
@@ -745,4 +828,19 @@
|
|
|
from RMS_CARGONAME where CARGONAME_ID = #{cargonameId}
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getCargoName" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ CARGONAME_ID "id",
|
|
|
+ CARGONAME_ID "value",
|
|
|
+ CARGONAME_VALUE "label"
|
|
|
+ from RMS_CARGONAME
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getOilTypeName" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ OIL_TYPE_ID "id",
|
|
|
+ OIL_TYPE_ID "value",
|
|
|
+ OIL_TYPE_NAME "label"
|
|
|
+ from RMS_OIL_TYPE
|
|
|
+ </select>
|
|
|
</mapper>
|