123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969 |
- <?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_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
- <result column="CARGONAME_ID" jdbcType="DECIMAL" 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" />
- </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
- </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
- </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>
- </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>
- </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="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>
- </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
- )
- values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
- #{lineId,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL}, #{cargonameId,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},
- #{placeId,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">
- 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>
- </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=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="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>
- </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=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},
- 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}
- 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=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="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>
- </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_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)
- ( <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=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.placeId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
- #{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">
- 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=DECIMAL}
- </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>
- 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>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <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",
- rrp.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",
- rs.SHIPPER_NAME "shipperName",
- a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold"
- from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
- left join RMS_RECEIVE_PLACE rrp
- on a_t_price.PLACE_ID=rrp.PLACE_ID
- left join RMS_RECEIVE_ADDRESS r_r_address
- on rrp.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
- left join RMS_OIL_TYPE r_o_type
- on a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
- left join RMS_SHIPPER rs
- on rs.SHIPPER_ID = a_t_price.SHIPPER_ID
- -- where a_t_price.DELETED = 0
- -- and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2
- <where>
- <if test="deleted != null">
- and a_t_price.DELETED = #{deleted}
- </if>
- </where>
- )
- <where>
- <if test="addressProvince != null">
- and
- <foreach collection="addressProvince" item="item" open="(" separator="or" close=")">
- "addressProvince" like '%${item}%'
- </foreach>
- </if>
- <if test="shipperName != null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
- "shipperName" 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 "priceDate" 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.PLACE_ID "placeId",
- 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="getPriceValueList" resultType="java.util.LinkedHashMap">
- select a_t_price.PRICE_ID "priceId",
- a_t_price.PRICE_VALUE "priceValue",
- 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.OIL_TYPE_ID = #{oilTypeId} and a_t_price.DELETED = 0
- </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>
- <select id="getTruckFormula" parameterType="DECIMAL" resultType="java.lang.String">
- SELECT FORMULA_STRING
- FROM BMSTRUCK_FORMULA
- WHERE FORMULA_ID = #{formulaId}
- </select>
- <select id="getCargonameValue" parameterType="java.math.BigDecimal" resultType="java.lang.String">
- select CARGONAME_VALUE "cargonameValue"
- 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>
- <select id="getRealAddressByLike" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- RRP.PLACE_ID AS "placeId",
- RRP.ADDRESS_DELIVERY_ADDRESS AS "value",
- RRP.ADDRESS_DELIVERY_ADDRESS AS "placeName"
- FROM RMS_RECEIVE_PLACE RRP
- WHERE RRP.ADDRESS_ID = #{addressId}
- <if test="index != null">
- AND RRP.ADDRESS_DELIVERY_ADDRESS LIKE #{index}
- </if>
- </select>
- <select id="selectFormulaId" parameterType="DECIMAL" resultType="DECIMAL" >
- SELECT ACTP.CARGONAME_ID AS "formulaId"
- FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
- WHERE ACTP.PRICE_ID = #{priceId}
- </select>
- <select id="getInwardContractPrice" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT *
- FROM (SELECT a_t_price.PRICE_ID "priceId",
- r_o_type.OIL_TYPE_NAME "oilTypeName",
- r_c_type.CAPACITY_TYPE_NAME "capacityTypeName",
- a_t_price.PRICE_VALUE "priceValue",
- a_t_price.PRICE_DATE "priceDate",
- a_t_price.OILPRICE_BASE "oilpriceBase",
- a_t_price.INSERT_TIME "insertTime",
- a_t_price.OILPRICE_CHANGE_THRESHOLD "oilpriceChangeThreshold",
- RGR.TRANS_RANGE_VALUE "transRange",
- a_t_price.TYPE "type"
- FROM AMS_CONTRACT_TRANSPORT_PRICE a_t_price
- LEFT JOIN RMS_RECEIVE_PLACE rrp
- ON a_t_price.PLACE_ID = rrp.PLACE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS r_r_address
- ON rrp.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_TRANS_RANGE RGR
- ON a_t_price.LINE_ID = RGR.TRANS_RANGE_ID
- LEFT JOIN RMS_OIL_TYPE r_o_type
- ON a_t_price.OIL_TYPE_ID = r_o_type.OIL_TYPE_ID
- where TYPE in (2,5,6)
- <if test="deleted != null">
- and a_t_price.DELETED = #{deleted}
- </if> )
- </select>
- <select id="selectInwardPrice" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
- select * from (select
- distinct
- actp.price_id "priceId", actp.price_value "priceValue" ,actp.PRICE_DATE "priceDate"
- from ams_contract_transport_price actp
- left join ams_contaact_price_material acpm
- on acpm.price_id = actp.price_id
- left join rms_trans_range rtr
- on rtr.trans_range_id = actp.line_id
- where type = #{type}
- and actp.DELETED = 0
- <if test="rangeId != null">
- and actp.LINE_ID = #{rangeId}
- </if>
- <if test="materialId != null">
- and acpm.MATERIAL_ID = #{materialTypeId}
- </if>
- <if test="capacityTypeId != null">
- and actp.CAPACITY_TYPE_ID = #{capacityTypeId}
- </if>
- )
- Order by "priceDate" desc
- </select>
- <select id="getRangePoint" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM
- (SELECT RTR.TRANS_RANGE_VALUE "transRangeValue" ,
- RLNP.LOAD_POINT_NAME "loadPointName" ,
- RLNP.UNLOAD_POINT_NAME "unloadPointName",
- RTR.TRANS_RANGE_ID "transRangeId",
- RLNP.LINE_NODE_ID "lineNodeId" FROM RMS_TRANS_RANGE RTR
- LEFT JOIN RMS_LINE_NODE_POINT RLNP on RTR.TRANS_RANGE_ID = RLNP.TRANS_RANGE_ID
- where RLNP.DELETED = 0
- <if test="con != null">
- AND
- RTR.TRANS_RANGE_VALUE||RLNP.LOAD_POINT_NAME||RLNP.UNLOAD_POINT_NAME like #{con}
- </if>
- )
- <where>
- <if test="transRangeValue != null">
- and
- <foreach collection="transRangeValue" item="item" open="(" separator="or" close=")">
- "transRangeValue" like '%${item}%'
- </foreach>
- </if>
- <if test="loadPointName != null">
- and
- <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
- "loadPointName" like '%${item}%'
- </foreach>
- </if>
- <if test="loadPointName != null">
- and
- <foreach collection="loadPointName" item="item" open="(" separator="or" close=")">
- "loadPointName" like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- </mapper>
|