123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701 |
- <?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="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, 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.TYPE
- </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>
- <if test="type != null">
- and TYPE = #{type}
- </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>
- <if test="type != null">
- and TYPE = #{type}
- </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>
- <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,
- 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, 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},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
- #{addressId,jdbcType=DECIMAL}, #{type,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>
- <if test="type != null">
- TYPE,
- </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=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="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},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- 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">
- 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=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="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>
- <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, 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.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}
- 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=CHAR}
- </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>
- ,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}
- </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="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_carrier.CARRIER_NAME "carrierName",
- r_line.LINE_PATH_LENGTH "linePathLength",
- 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.INSERT_TIME "insertTime"
- 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_CAPACITY_TYPE r_c_type
- on a_t_price.CAPACITY_TYPE_ID=r_c_type.CAPACITY_TYPE_ID
- left join RMS_CARRIER r_carrier
- 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)
- <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="carrierName != null">
- and
- <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
- "carrierName" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityTypeName != null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
- "capacityTypeName" 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>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </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 * FROM
- (SELECT RRA.ADDRESS_ID "addressId",
- CONCAT(CONCAT(CONCAT(RRA.ADDRESS_PROVINCE, RRA.ADDRESS_DISTRICT), RRA.ADDRESS_TOWN), RRA.ADDRESS_DELIVERY_ADDRESS) "address"
- FROM RMS_RECEIVE_ADDRESS RRA) RRRA
- <if test="con != null" >
- WHERE RRRA."address" LIKE #{con}
- </if>
- </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>
|