|
@@ -2,42 +2,40 @@
|
|
|
<!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_ID" jdbcType="DECIMAL" property="capacityId"/>
|
|
|
- <result column="MATERIAL_ID" jdbcType="CHAR" property="materialId"/>
|
|
|
- <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="ADDRESS_ID" jdbcType="DECIMAL" property="addressId"/>
|
|
|
+ <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_ID" jdbcType="DECIMAL" property="capacityId" />
|
|
|
+ <result column="MATERIAL_ID" jdbcType="CHAR" property="materialId" />
|
|
|
+ <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="ADDRESS_ID" jdbcType="DECIMAL" property="addressId" />
|
|
|
+ <result column="TYPE" jdbcType="DECIMAL" property="type" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_ID, MATERIAL_ID, PRICE_TON_KILOMETER,
|
|
|
PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
|
|
|
- INSERT_UPDATE_REMARK, DELETED, ADDRESS_ID
|
|
|
+ INSERT_UPDATE_REMARK, DELETED, ADDRESS_ID, TYPE
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_ID, t.MATERIAL_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.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.ADDRESS_ID,
|
|
|
+ t.TYPE
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
- SELECT
|
|
|
- <include refid="columns"/>
|
|
|
- FROM AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ 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
|
|
|
+ SELECT <include refid="columns_alias"/> FROM AMS_CONTRACT_TRANSPORT_PRICE t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
<where>
|
|
@@ -89,6 +87,9 @@
|
|
|
<if test="addressId != null">
|
|
|
and ADDRESS_ID = #{addressId}
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ and TYPE = #{type}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
@@ -141,11 +142,13 @@
|
|
|
<if test="addressId != null">
|
|
|
and ADDRESS_ID = #{addressId}
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ and TYPE = #{type}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
- delete
|
|
|
- from AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ delete from AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
</delete>
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
@@ -196,6 +199,9 @@
|
|
|
<if test="addressId != null">
|
|
|
or ADDRESS_ID = #{addressId}
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ or TYPE = #{type}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
|
insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
|
|
@@ -203,14 +209,13 @@
|
|
|
PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
|
|
|
INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
|
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
|
|
|
- ADDRESS_ID)
|
|
|
+ ADDRESS_ID, TYPE)
|
|
|
values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
|
|
|
#{lineId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL}, #{materialId,jdbcType=CHAR},
|
|
|
#{priceTonKilometer,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL}, #{priceDate,jdbcType=TIMESTAMP},
|
|
|
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
- #{updateUsername,jdbcType=VARCHAR},
|
|
|
+ #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
|
|
|
#{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
|
|
|
- #{addressId,jdbcType=DECIMAL})
|
|
|
+ #{addressId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
|
insert into AMS_CONTRACT_TRANSPORT_PRICE
|
|
@@ -263,6 +268,9 @@
|
|
|
<if test="addressId != null">
|
|
|
ADDRESS_ID,
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ TYPE,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="priceId != null">
|
|
@@ -313,25 +321,29 @@
|
|
|
<if test="addressId != null">
|
|
|
#{addressId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,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_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
- MATERIAL_ID = #{materialId,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},
|
|
|
+ set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
|
|
|
+ CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
|
|
|
+ LINE_ID = #{lineId,jdbcType=DECIMAL},
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ MATERIAL_ID = #{materialId,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},
|
|
|
- ADDRESS_ID = #{addressId,jdbcType=DECIMAL}
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
+ ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
|
|
|
+ TYPE = #{type,jdbcType=DECIMAL}
|
|
|
where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
|
|
@@ -382,6 +394,9 @@
|
|
|
<if test="addressId != null">
|
|
|
ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="type != null">
|
|
|
+ TYPE = #{type,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
@@ -405,18 +420,18 @@
|
|
|
PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
|
|
|
INSERT_TIME, UPDATE_USERNAME,
|
|
|
UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
- DELETED, ADDRESS_ID)
|
|
|
+ DELETED, ADDRESS_ID, TYPE
|
|
|
+ )
|
|
|
( <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.capacityId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=CHAR},
|
|
|
- #{item.priceTonKilometer,jdbcType=DECIMAL},
|
|
|
- #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP},
|
|
|
- #{item.insertUsername,jdbcType=VARCHAR},
|
|
|
+ #{item.capacityId,jdbcType=DECIMAL}, #{item.materialId,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.addressId,jdbcType=DECIMAL} from dual
|
|
|
+ #{item.deleted,jdbcType=DECIMAL}, #{item.addressId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL}
|
|
|
+ from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -486,6 +501,10 @@
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
when #{item.priceId,jdbcType=DECIMAL} then #{item.addressId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
+ ,TYPE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.type,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
where PRICE_ID in
|
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
#{item.priceId,jdbcType=DECIMAL}
|
|
@@ -525,11 +544,36 @@
|
|
|
actp.PRICE_VALUE as "priceValue",
|
|
|
actp.PRICE_DATE as "priceDate"
|
|
|
FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
- LEFT JOIN RMS_CAPACITY rc
|
|
|
- ON rc.CAPACITY_ID = actp.CAPACITY_ID
|
|
|
- LEFT JOIN RMS_CAPACITY_TYPE rct
|
|
|
- ON rc.CAPACITY_TYPE_ID = rct.CAPACITY_TYPE_ID
|
|
|
- WHERE rct.CAPACITY_TYPE_NAME = '船运'
|
|
|
+ WHERE actp.TYPE = 3
|
|
|
+ AND actp.DELETED = 0
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="priceValue!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceValue" item="item" open="(" separator="," close=")">
|
|
|
+ "priceValue" in #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="priceDate!= null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceDate" item="item" open="(" separator="," close=")">
|
|
|
+ "priceDate" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderByInsertTime"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTruckPriceList" resultType="java.util.Map">
|
|
|
+ SELECT * FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ actp.INSERT_TIME as "insertTime",
|
|
|
+ actp.PRICE_ID as "priceId",
|
|
|
+ actp.PRICE_VALUE as "priceValue",
|
|
|
+ actp.PRICE_DATE as "priceDate"
|
|
|
+ FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
+ WHERE actp.TYPE = 4
|
|
|
AND actp.DELETED = 0
|
|
|
)
|
|
|
<where>
|