|
@@ -0,0 +1,652 @@
|
|
|
+<?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.AmsContractTruckPriceMapper">
|
|
|
+ <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="DECIMAL" 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" />
|
|
|
+ </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
|
|
|
+ </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
|
|
|
+ </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="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ and MATERIAL_ID = #{materialId}
|
|
|
+ </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="addressId != null">
|
|
|
+ and ADDRESS_ID = #{addressId}
|
|
|
+ </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="capacityId != null">
|
|
|
+ and CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ and MATERIAL_ID = #{materialId}
|
|
|
+ </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="addressId != null">
|
|
|
+ and ADDRESS_ID = #{addressId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
+ 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="capacityId != null">
|
|
|
+ or CAPACITY_ID = #{capacityId}
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ or MATERIAL_ID = #{materialId}
|
|
|
+ </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="addressId != null">
|
|
|
+ or ADDRESS_ID = #{addressId}
|
|
|
+ </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_ID, MATERIAL_ID,
|
|
|
+ PRICE_TON_KILOMETER, PRICE_VALUE, PRICE_DATE,
|
|
|
+ INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
|
|
|
+ UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
|
|
|
+ ADDRESS_ID)
|
|
|
+ values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
|
|
|
+ #{lineId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
|
|
|
+ #{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})
|
|
|
+ </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="capacityId != null">
|
|
|
+ CAPACITY_ID,
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ MATERIAL_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="addressId != null">
|
|
|
+ ADDRESS_ID,
|
|
|
+ </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="capacityId != null">
|
|
|
+ #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ #{materialId,jdbcType=DECIMAL},
|
|
|
+ </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="addressId != null">
|
|
|
+ #{addressId,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=DECIMAL},
|
|
|
+ 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}
|
|
|
+ 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="capacityId != null">
|
|
|
+ CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="materialId != null">
|
|
|
+ MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
|
|
|
+ </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="addressId != null">
|
|
|
+ ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where PRICE_ID = #{priceId,jdbcType=DECIMAL}
|
|
|
+ </update>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" 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_ID, MATERIAL_ID, PRICE_TON_KILOMETER,
|
|
|
+ PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
|
|
|
+ INSERT_TIME, UPDATE_USERNAME,
|
|
|
+ UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
+ DELETED, ADDRESS_ID)
|
|
|
+ ( <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=DECIMAL}, #{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
|
|
|
+ </foreach> )
|
|
|
+ </insert>
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
+ update AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ set
|
|
|
+ PRICE_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,SHIPPER_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.shipperId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CARRIER_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,LINE_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,CAPACITY_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,MATERIAL_ID=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PRICE_TON_KILOMETER=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.priceTonKilometer,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PRICE_VALUE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,PRICE_DATE=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.priceDate,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_USERNAME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_UPDATE_REMARK=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,DELETED=
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case PRICE_ID" close="end">
|
|
|
+ when #{item.priceId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,ADDRESS_ID=
|
|
|
+ <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>
|
|
|
+ where PRICE_ID in
|
|
|
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item.priceId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+ <delete id="batchDelete" parameterType="java.util.List">
|
|
|
+ delete from AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ where PRICE_ID in
|
|
|
+ <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!-- 友情提示!!!-->
|
|
|
+ <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
+
|
|
|
+ <select id="selectMaxId" resultType="java.math.BigDecimal">
|
|
|
+ select max(PRICE_ID) from AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getAmsContractTransportPrice" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
|
|
|
+ select * from(
|
|
|
+ select a_t_price.PRICE_ID "priceId",
|
|
|
+ r_r_address.ADDRESS_PROVINCE "addressProvince",
|
|
|
+ r_r_address.ADDRESS_DISTRICT "addressDistrict",
|
|
|
+ r_r_address.ADDRESS_TOWN "addressTown",
|
|
|
+ r_r_address.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
|
|
|
+ r_line.LINE_PATH_LENGTH "linePathLength",
|
|
|
+ a_t_price.PRICE_VALUE "priceValue",
|
|
|
+ a_t_price.PRICE_TON_KILOMETER "priceTonKilometer",
|
|
|
+ a_t_price.PRICE_DATE "priceDate"
|
|
|
+ from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
|
|
|
+ left join RMS_RECEIVE_ADDRESS r_r_address
|
|
|
+ on a_t_price.ADDRESS_ID=r_r_address.ADDRESS_ID
|
|
|
+ left join RMS_LINE r_line
|
|
|
+ on a_t_price.LINE_ID=r_line.LINE_ID
|
|
|
+ where a_t_price.DELETED = 0)
|
|
|
+ <where>
|
|
|
+ <if test="addressProvince != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressProvince" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressProvince" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDistrict != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDistrict" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDistrict" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressTown != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressTown" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressTown" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="addressDeliveryAddress != null">
|
|
|
+ and
|
|
|
+ <foreach collection="addressDeliveryAddress" item="item" open="(" separator="or" close=")">
|
|
|
+ "addressDeliveryAddress" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="linePathLength != null">
|
|
|
+ and
|
|
|
+ <foreach collection="linePathLength" item="item" open="(" separator="or" close=")">
|
|
|
+ "linePathLength" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="priceValue != null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
|
|
|
+ "priceValue" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="priceTonKilometer != null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceTonKilometer" item="item" open="(" separator="or" close=")">
|
|
|
+ "priceTonKilometer" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="priceDate != null">
|
|
|
+ and
|
|
|
+ <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
|
|
|
+ "priceDate" like '%${item}%'
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="orderBy"></include>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="orderBy">
|
|
|
+ <if test="orderField != null and orderField != ''">
|
|
|
+ order by "${orderField}"
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
+ ${orderType}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="getCarrierName" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ CARRIER_ID "id",
|
|
|
+ CARRIER_ID "value",
|
|
|
+ CARRIER_NAME "label"
|
|
|
+ from RMS_CARRIER
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLineNo" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ LINE_ID "id",
|
|
|
+ LINE_ID "value",
|
|
|
+ LINE_NO "label"
|
|
|
+ from RMS_LINE
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getCapacityNumber" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ CAPACITY_ID "id",
|
|
|
+ CAPACITY_ID "value",
|
|
|
+ CAPACITY_NUMBER "label"
|
|
|
+ from RMS_CAPACITY
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getAddressDeliveryAddress" resultType="java.util.LinkedHashMap">
|
|
|
+ select
|
|
|
+ ADDRESS_ID "id",
|
|
|
+ ADDRESS_ID "value",
|
|
|
+ ADDRESS_DELIVERY_ADDRESS "label"
|
|
|
+ from RMS_RECEIVE_ADDRESS
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByPriceId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">
|
|
|
+ select a_t_price.SHIPPER_ID "shipperId",
|
|
|
+ a_t_price.CARRIER_ID "carrierId",
|
|
|
+ a_t_price.LINE_ID "lineId",
|
|
|
+ a_t_price.CAPACITY_ID "capacityId",
|
|
|
+ a_t_price.MATERIAL_ID "materialId",
|
|
|
+ a_t_price.ADDRESS_ID "addressId",
|
|
|
+ a_t_price.PRICE_VALUE "priceValue",
|
|
|
+ a_t_price.PRICE_DATE "priceDate"
|
|
|
+ from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
|
|
|
+ where a_t_price.PRICE_ID = #{priceId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getOriginAndNowOilPrice" resultType="java.util.LinkedHashMap">
|
|
|
+ select rownum "rownum",
|
|
|
+ r_o_price.PRICE_VALUE "priceValue"
|
|
|
+ from RMS_OIL_PRICE r_o_price where r_o_price.PRICE_OIL_NAME='0号柴油'
|
|
|
+ order by r_o_price.PRICE_DATE desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="batchUpdateTransportPriceByOilPrice" parameterType="double">
|
|
|
+ update AMS_CONTRACT_TRANSPORT_PRICE
|
|
|
+ set PRICE_VALUE = ROUND(PRICE_VALUE * 0.65 + PRICE_VALUE * 0.35 * (1 + #{updateOilPrice}),2)
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="getLinePathLength" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
|
|
|
+ select LINE_PATH_LENGTH "linePathLength" from RMS_LINE where LINE_ID = #{lineId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getPriceValueAndPriceTonKilometer" resultType="java.util.LinkedHashMap">
|
|
|
+ select a_t_price.PRICE_ID "priceId",
|
|
|
+ a_t_price.PRICE_VALUE "priceValue",
|
|
|
+ a_t_price.PRICE_TON_KILOMETER "priceTonKilometer"
|
|
|
+ from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="updatePriceTonKilometer" parameterType="java.math.BigDecimal">
|
|
|
+ update AMS_CONTRACT_TRANSPORT_PRICE set PRICE_TON_KILOMETER = #{priceTonKilometer}
|
|
|
+ where PRICE_ID = #{priceId}
|
|
|
+ </update>
|
|
|
+</mapper>
|