1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090 |
- <?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>
- <sql id="whereLikeForeach">
- <where>
- <if test="priceId != null">
- <foreach collection="priceId" item="item" open="(" separator="or" close=")">
- "priceId" = '${item}'
- </foreach>
- </if>
- <if test="oilTypeName != null">
- and
- <foreach collection="oilTypeName" item="item" open="(" separator="or" close=")">
- "oilTypeName" = '${item}'
- </foreach>
- </if>
- <if test="capacityTypeName != null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
- "capacityTypeName" = '${item}'
- </foreach>
- </if>
- <if test="priceValue != null">
- and
- <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
- "priceValue" = '${item}'
- </foreach>
- </if>
- <if test="priceDate != null">
- and
- <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
- TO_CHAR("priceDate",'yyyy-mm-dd hh24:mi:ss') = '${item}'
- </foreach>
- </if>
- <if test="oilpriceBase != null">
- and
- <foreach collection="oilpriceBase" item="item" open="(" separator="or" close=")">
- "oilpriceBase" = '${item}'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- TO_CHAR("insertTime",'yyyy-mm-dd hh24:mi:ss') = '${item}'
- </foreach>
- </if>
- <if test="oilpriceChangeThreshold != null">
- and
- <foreach collection="oilpriceChangeThreshold" item="item" open="(" separator="or" close=")">
- "oilpriceChangeThreshold" = '${item}'
- </foreach>
- </if>
- <if test="transRange != null">
- and
- <foreach collection="transRange" item="item" open="(" separator="or" close=")">
- "transRange" = '${item}'
- </foreach>
- </if>
- <if test="type != null">
- and
- <foreach collection="type" item="item" open="(" separator="or" close=")">
- <if test="item=='元/吨'">
- "type" = '2'
- </if>
- <if test="item=='元/小时'">
- "type" = '5'
- </if>
- <if test="item=='元/趟'">
- "type" = '6'
- </if>
- </foreach>
- </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>
- <if test="con !=null and con != ''.toString()">
- and
- r_r_address.ADDRESS_PROVINCE || r_r_address.ADDRESS_DISTRICT || r_r_address.ADDRESS_TOWN
- || rrp.ADDRESS_DELIVERY_ADDRESS || r_carrier.CARRIER_NAME || r_c_type.CAPACITY_TYPE_NAME
- like CONCAT('%',CONCAT(#{con},'%'))
- </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
- distinct
- RRA.ADDRESS_ID "addressId",
- RRA.ADDRESS_PROVINCE "province",
- RRA.ADDRESS_DISTRICT "district",
- RRA.ADDRESS_TOWN "town",
- RRP.ADDRESS_DELIVERY_ADDRESS "address1",
- RRA.ADDRESS_PROVINCE ||RRA.ADDRESS_DISTRICT|| RRA.ADDRESS_TOWN||RRP.ADDRESS_DELIVERY_ADDRESS "address",
- ACTP.PRICE_VALUE "pricevalue",
- ACTP.PRICE_ID "priceid"
- FROM RMS_RECEIVE_ADDRESS RRA
- LEFT JOIN RMS_RECEIVE_PLACE RRP
- ON RRP.ADDRESS_ID=RRA.ADDRESS_ID
- LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE ACTP
- ON ACTP.PLACE_ID=RRP.PLACE_ID
- ) RRRA
- <if test="con != null" >
- WHERE RRRA."address" LIKE #{con}
- </if>
- order by RRRA."pricevalue" asc nulls last
- </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>
- <if test="con != null" >
- and RGR.TRANS_RANGE_VALUE LIKE #{con}
- </if>)
- <include refid="whereLikeForeach"/>
- <include refid="orderBy"></include>
- </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
- and acpm.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>
- <select id="selectwz" resultType="java.util.Map">
- select
- RMT.MATERIAL_TYPE_NAME "materialName",
- RMT.MATERIAL_TYPE_ID "materialId"
- from AMS_CONTAACT_PRICE_MATERIAL acpr
- left join RMS_MATERIAL_TYPE RMT
- on RMT.MATERIAL_TYPE_ID = acpr.MATERIAL_ID
- where
- RMT.MATERIAL_ISINWARD = 1
- AND
- PRICE_ID = #{priceId}
- AND ACPR.DELETED = 0
- </select>
- <select id="getcargonameId" resultType="java.util.Map">
- select
- BF.FORMULA_ID AS "formulaId",
- BF.FORMULA_NAME AS "formulaName",
- BF.FORMULA_STRING AS "formulaString"
- from AMS_CONTRACT_TRANSPORT_PRICE t
- left join BMSTRUCK_FORMULA bf on t.cargoname_id=bf.formula_id
- where price_id=#{priceId}
- </select>
- </mapper>
|