12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277 |
- <?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.BmstruckDetailsOrderMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmstruckDetailsOrder">
- <id column="DETAILS_ID" jdbcType="DECIMAL" property="detailsId" />
- <result column="PURCHASE_ORDER_ID" jdbcType="DECIMAL" property="purchaseOrderId" />
- <result column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
- <result column="DETAILS_NO" jdbcType="VARCHAR" property="detailsNo" />
- <result column="DETAILS_TIME" jdbcType="TIMESTAMP" property="detailsTime" />
- <result column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
- <result column="DETAILS_AMOUNT" jdbcType="DECIMAL" property="detailsAmount" />
- <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="WETHER_TO_STATEMENT" jdbcType="DECIMAL" property="wetherToStatement" />
- <result column="EAS_AMOUNT" jdbcType="DECIMAL" property="easAmount" />
- </resultMap>
- <sql id="columns">
- DETAILS_ID, PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID,
- DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- WETHER_TO_STATEMENT, EAS_AMOUNT
- </sql>
- <sql id="columns_alias">
- t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.WEIGHT_TASK_RESULT_ID, t.DETAILS_NO, t.DETAILS_TIME,
- t.PRICE_ID, t.DETAILS_AMOUNT, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
- t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.WETHER_TO_STATEMENT, t.EAS_AMOUNT
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM BMSTRUCK_DETAILS_ORDER
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM BMSTRUCK_DETAILS_ORDER t
- </sql>
- <sql id="where">
- <where>
- <if test="detailsId != null">
- and DETAILS_ID = #{detailsId}
- </if>
- <if test="purchaseOrderId != null">
- and PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- and DETAILS_NO = #{detailsNo}
- </if>
- <if test="detailsTime != null">
- and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
- </if>
- <if test="priceId != null">
- and PRICE_ID = #{priceId}
- </if>
- <if test="detailsAmount != null">
- and DETAILS_AMOUNT = #{detailsAmount}
- </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="wetherToStatement != null">
- and WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="easAmount != null">
- and EAS_AMOUNT = #{easAmount}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="detailsId != null">
- and DETAILS_ID = #{detailsId}
- </if>
- <if test="purchaseOrderId != null">
- and PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- and DETAILS_NO LIKE '%${detailsNo}%'
- </if>
- <if test="detailsTime != null">
- and TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = #{detailsTime}
- </if>
- <if test="priceId != null">
- and PRICE_ID = #{priceId}
- </if>
- <if test="detailsAmount != null">
- and DETAILS_AMOUNT = #{detailsAmount}
- </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="wetherToStatement != null">
- and WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="easAmount != null">
- and EAS_AMOUNT = #{easAmount}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
- delete from BMSTRUCK_DETAILS_ORDER
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from BMSTRUCK_DETAILS_ORDER
- where 1!=1
- <if test="purchaseOrderId != null">
- or PURCHASE_ORDER_ID = #{purchaseOrderId}
- </if>
- <if test="weightTaskResultId != null">
- or WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="detailsNo != null and detailsNo != ''">
- or DETAILS_NO = #{detailsNo}
- </if>
- <if test="detailsTime != null">
- or TO_CHAR(DETAILS_TIME,'yyyy-MM-dd') = '#{detailsTime}'
- </if>
- <if test="priceId != null">
- or PRICE_ID = #{priceId}
- </if>
- <if test="detailsAmount != null">
- or DETAILS_AMOUNT = #{detailsAmount}
- </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="wetherToStatement != null">
- or WETHER_TO_STATEMENT = #{wetherToStatement}
- </if>
- <if test="easAmount != null">
- or EAS_AMOUNT = #{easAmount}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
- insert into BMSTRUCK_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID,
- DETAILS_NO, DETAILS_TIME, PRICE_ID,
- DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- WETHER_TO_STATEMENT, EAS_AMOUNT)
- values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{weightTaskResultId,jdbcType=DECIMAL},
- #{detailsNo,jdbcType=VARCHAR}, #{detailsTime,jdbcType=TIMESTAMP}, #{priceId,jdbcType=DECIMAL},
- #{detailsAmount,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{wetherToStatement,jdbcType=DECIMAL}, #{easAmount,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
- insert into BMSTRUCK_DETAILS_ORDER
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="detailsId != null">
- DETAILS_ID,
- </if>
- <if test="purchaseOrderId != null">
- PURCHASE_ORDER_ID,
- </if>
- <if test="weightTaskResultId != null">
- WEIGHT_TASK_RESULT_ID,
- </if>
- <if test="detailsNo != null">
- DETAILS_NO,
- </if>
- <if test="detailsTime != null">
- DETAILS_TIME,
- </if>
- <if test="priceId != null">
- PRICE_ID,
- </if>
- <if test="detailsAmount != null">
- DETAILS_AMOUNT,
- </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="wetherToStatement != null">
- WETHER_TO_STATEMENT,
- </if>
- <if test="easAmount != null">
- EAS_AMOUNT,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="detailsId != null">
- #{detailsId,jdbcType=DECIMAL},
- </if>
- <if test="purchaseOrderId != null">
- #{purchaseOrderId,jdbcType=DECIMAL},
- </if>
- <if test="weightTaskResultId != null">
- #{weightTaskResultId,jdbcType=DECIMAL},
- </if>
- <if test="detailsNo != null">
- #{detailsNo,jdbcType=VARCHAR},
- </if>
- <if test="detailsTime != null">
- #{detailsTime,jdbcType=TIMESTAMP},
- </if>
- <if test="priceId != null">
- #{priceId,jdbcType=DECIMAL},
- </if>
- <if test="detailsAmount != null">
- #{detailsAmount,jdbcType=DECIMAL},
- </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="wetherToStatement != null">
- #{wetherToStatement,jdbcType=DECIMAL},
- </if>
- <if test="easAmount != null">
- #{easAmount,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
- update BMSTRUCK_DETAILS_ORDER
- set PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
- WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL},
- DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
- DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
- PRICE_ID = #{priceId,jdbcType=DECIMAL},
- DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
- 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},
- WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL},
- EAS_AMOUNT = #{easAmount,jdbcType=DECIMAL}
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
- update BMSTRUCK_DETAILS_ORDER
- <set>
- <if test="purchaseOrderId != null">
- PURCHASE_ORDER_ID = #{purchaseOrderId,jdbcType=DECIMAL},
- </if>
- <if test="weightTaskResultId != null">
- WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL},
- </if>
- <if test="detailsNo != null">
- DETAILS_NO = #{detailsNo,jdbcType=VARCHAR},
- </if>
- <if test="detailsTime != null">
- DETAILS_TIME = #{detailsTime,jdbcType=TIMESTAMP},
- </if>
- <if test="priceId != null">
- PRICE_ID = #{priceId,jdbcType=DECIMAL},
- </if>
- <if test="detailsAmount != null">
- DETAILS_AMOUNT = #{detailsAmount,jdbcType=DECIMAL},
- </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="wetherToStatement != null">
- WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL},
- </if>
- <if test="easAmount != null">
- EAS_AMOUNT = #{easAmount,jdbcType=DECIMAL},
- </if>
- </set>
- where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
- <include refid="select" />
- where DETAILS_ID = #{detailsId,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 BMSTRUCK_DETAILS_ORDER
- (DETAILS_ID,
- PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID,
- DETAILS_NO, DETAILS_TIME, PRICE_ID,
- DETAILS_AMOUNT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- WETHER_TO_STATEMENT, EAS_AMOUNT)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.detailsId,jdbcType=DECIMAL},
- #{item.purchaseOrderId,jdbcType=DECIMAL}, #{item.weightTaskResultId,jdbcType=DECIMAL},
- #{item.detailsNo,jdbcType=VARCHAR}, #{item.detailsTime,jdbcType=TIMESTAMP}, #{item.priceId,jdbcType=DECIMAL},
- #{item.detailsAmount,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.wetherToStatement,jdbcType=DECIMAL}, #{item.easAmount,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update BMSTRUCK_DETAILS_ORDER
- set
- DETAILS_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsId,jdbcType=DECIMAL}
- </foreach>
- ,PURCHASE_ORDER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.purchaseOrderId,jdbcType=DECIMAL}
- </foreach>
- ,WEIGHT_TASK_RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
- </foreach>
- ,DETAILS_NO=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsNo,jdbcType=VARCHAR}
- </foreach>
- ,DETAILS_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsTime,jdbcType=TIMESTAMP}
- </foreach>
- ,PRICE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
- </foreach>
- ,DETAILS_AMOUNT=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.detailsAmount,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,WETHER_TO_STATEMENT=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.wetherToStatement,jdbcType=DECIMAL}
- </foreach>
- ,EAS_AMOUNT=
- <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
- when #{item.detailsId,jdbcType=DECIMAL} then #{item.easAmount,jdbcType=DECIMAL}
- </foreach>
- where DETAILS_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.detailsId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from BMSTRUCK_DETAILS_ORDER
- where DETAILS_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 销售汽运结算详单 -->
- <select id="getTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- apo.RECEIVE_UNIT_ID as "statementShipperId",
- db.BATCH_ID as "batchId",
- oo.ORDER_ID as "orderId",
- apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
- rm.MATERIAL_NAME as "materialName",
- db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
- bdo.DETAILS_NO as "detailsNo",
- bdo.DETAILS_TIME as "detailsTime",
- rc.CAPACITY_NUMBER as "capacityNumber",
- twr.RESULT_NET_WEIGHT as "resultNetWeight",
- actp.PRICE_VALUE as "priceValue",
- bdo.DETAILS_AMOUNT as "detailsAmount"
- FROM BMSTRUCK_DETAILS_ORDER bdo
- LEFT JOIN AMS_PURCHASE_ORDER apo
- ON apo.PURCHASE_ORDER_ID = bdo.PURCHASE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = apo.RECEIVE_UNIT_ID
- LEFT JOIN DIL_BATCH db
- ON db.BATCH_ID = apo.BATCH_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = db.MATERIAL_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.WEIGHT_TASK_RESULT_ID = bdo.WEIGHT_TASK_RESULT_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttl
- ON ttl.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER oo
- ON oo.ORDER_ID = ttl.ORDER_ID
- LEFT JOIN RMS_CAPACITY rc
- ON oo.CAPACITY_ID = rc.CAPACITY_ID
- LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
- ON actp.PRICE_ID = bdo.PRICE_ID
- WHERE oo.ORDER_TYPE = #{orderType}
- )
- <where>
- <if test="purchaseOrderNo!= null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
- "purchaseOrderNo" in #{item}
- </foreach>
- </if>
- <if test="materialName!= null">
- and
- <foreach collection="materialName" item="item" open="(" separator="," close=")">
- "materialName" in #{item}
- </foreach>
- </if>
- <if test="resultForeignShipName!= null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
- "resultForeignShipName" in #{item}
- </foreach>
- </if>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="resultNetWeight!= null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
- "resultNetWeight" in #{item}
- </foreach>
- </if>
- <if test="priceValue!= null">
- and
- <foreach collection="priceValue" item="item" open="(" separator="," close=")">
- "priceValue" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 未转账单的销售详单 -->
- <select id="getUnFinishedTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- oo.ORDER_ID as "orderId",
- bdo.DETAILS_NO as "detailsNo",
- oo.ORDER_NUMBER as "orderNumber",
- bdo.DETAILS_TIME as "detailsTime",
- rc.CAPACITY_NUMBER as "capacityNumber",
- rct.CAPACITY_TYPE_NAME as "capacityTypeName",
- RC2.CARRIER_NAME as "carrierName",
- rs.SHIPPER_NAME as "shipperName",
- rco.CONSIGNEE_COMPANY_NAME as "consigneeReceiveAddress",
- actp.PRICE_VALUE as "priceValue",
- bdo.DETAILS_AMOUNT as "detailsAmount",
- RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "realAddress",
- ter.RESULT_ENTRY_GATE_TIME as "resultEntryGateTime",
- rge.GATEPOST_NAME as "enGatepostName",
- twr.RESULT_TARE_WEIGHT_TIME as "resultTareWeightTime",
- twr.RESULT_TARE_WEIGHT as "resultTareWeight",
- rtct.TRUCK_CALCULATE_NUMBER as "tareCalculateNumber",
- tlr.RESULT_LOAD_START_TIME as "resultLoadStartTime",
- rw.WAREHOUSE_NAME as "warehouseName",
- twr.RESULT_GROSS_WEIGHT_TIME as "resultGrossWeightTime",
- twr.RESULT_GROSS_WEIGHT as "resultGrossWeight",
- rtcg.TRUCK_CALCULATE_NUMBER as "grossCalculateNumber",
- tlfr.RESULT_OUT_GATE_TIME as "resultOutGateTime",
- rgl.GATEPOST_NAME as "leaveGatepostName",
- twr.RESULT_NET_WEIGHT as "resultNetWeight"
- FROM BMSTRUCK_DETAILS_ORDER bdo
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.WEIGHT_TASK_RESULT_ID = bdo.WEIGHT_TASK_RESULT_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttl
- ON ttl.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT ter
- ON ter.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rge
- ON rge.GATEPOST_ID = ter.GATEPOST_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtct
- ON rtct.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT tlr
- ON tlr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE rw
- ON rw.WAREHOUSE_ID = tlr.LOADING_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtcg
- ON rtcg.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
- ON tlfr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rgl
- ON rgl.GATEPOST_ID = ter.GATEPOST_ID
- LEFT JOIN OMSTRUCK_ORDER oo
- ON oo.ORDER_ID = ttl.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
- ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
- ON ADSO.SALE_ORDER_MATERIAL_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN RMS_CARRIER RC2
- ON RC2.CARRIER_ID = ADSO.CARRIER_ID
- LEFT JOIN AMS_SALE_ORDER aso
- ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = aso.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE rco
- ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
- LEFT JOIN RMS_CAPACITY rc
- ON oo.CAPACITY_ID = rc.CAPACITY_ID
- LEFT JOIN RMS_CAPACITY_TYPE rct
- ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
- LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
- ON actp.PRICE_ID = bdo.PRICE_ID
- LEFT JOIN RMS_RECEIVE_PLACE RRP
- ON RRP.PLACE_ID = asom.SALE_SHIPPING_ADDRESS_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
- WHERE oo.ORDER_TYPE in (1,2)
- AND bdo.WETHER_TO_STATEMENT = 0
- <if test="carrierId != null" >
- AND RC2.CARRIER_ID = #{carrierId}
- </if>
- )
- <where>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="orderNumber!= null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
- "orderNumber" in #{item}
- </foreach>
- </if>
- <if test="carrierName!= null">
- and
- <foreach collection="carrierName" item="item" open="(" separator="," close=")">
- "carrierName" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="capacityTypeName!= null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
- "capacityTypeName" in #{item}
- </foreach>
- </if>
- <if test="shipperName!= null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="," close=")">
- "shipperName" in #{item}
- </foreach>
- </if>
- <if test="consigneeReceiveAddress!= null">
- and
- <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
- "consigneeReceiveAddress" in #{item}
- </foreach>
- </if>
- <if test="priceValue!= null">
- and
- <foreach collection="priceValue" item="item" open="(" separator="," close=")">
- "priceValue" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 销售汽运结算详单 -->
- <select id="getSaleTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- oo.ORDER_ID as "orderId",
- bdo.DETAILS_NO as "detailsNo",
- oo.ORDER_NUMBER as "orderNumber",
- bdo.DETAILS_TIME as "detailsTime",
- rc.CAPACITY_NUMBER as "capacityNumber",
- rct.CAPACITY_TYPE_NAME as "capacityTypeName",
- rs.SHIPPER_NAME as "shipperName",
- rco.CONSIGNEE_COMPANY_NAME as "consigneeReceiveAddress",
- rc2.CARRIER_NAME as "carrierName",
- actp.PRICE_VALUE as "priceValue",
- bdo.DETAILS_AMOUNT as "detailsAmount",
- bdo.WETHER_TO_STATEMENT as "wetherToStatement",
- RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "realAddress",
- ter.RESULT_ENTRY_GATE_TIME as "resultEntryGateTime",
- rge.GATEPOST_NAME as "enGatepostName",
- twr.RESULT_TARE_WEIGHT_TIME as "resultTareWeightTime",
- twr.RESULT_TARE_WEIGHT as "resultTareWeight",
- rtct.TRUCK_CALCULATE_NUMBER as "tareCalculateNumber",
- tlr.RESULT_LOAD_START_TIME as "resultLoadStartTime",
- rw.WAREHOUSE_NAME as "warehouseName",
- twr.RESULT_GROSS_WEIGHT_TIME as "resultGrossWeightTime",
- twr.RESULT_GROSS_WEIGHT as "resultGrossWeight",
- rtcg.TRUCK_CALCULATE_NUMBER as "grossCalculateNumber",
- tlfr.RESULT_OUT_GATE_TIME as "resultOutGateTime",
- rgl.GATEPOST_NAME as "leaveGatepostName",
- twr.RESULT_NET_WEIGHT as "resultNetWeight"
- FROM BMSTRUCK_DETAILS_ORDER bdo
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.WEIGHT_TASK_RESULT_ID = bdo.WEIGHT_TASK_RESULT_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttl
- ON ttl.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT ter
- ON ter.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rge
- ON rge.GATEPOST_ID = ter.GATEPOST_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtct
- ON rtct.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT tlr
- ON tlr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE rw
- ON rw.WAREHOUSE_ID = tlr.LOADING_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtcg
- ON rtcg.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
- ON tlfr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rgl
- ON rgl.GATEPOST_ID = ter.GATEPOST_ID
- LEFT JOIN OMSTRUCK_ORDER oo
- ON oo.ORDER_ID = ttl.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
- ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN AMS_DISPATCH_SALE_ORDER adso
- ON adso.SALE_ORDER_MATERIAL_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN RMS_CARRIER rc2
- ON rc2.CARRIER_ID = adso.CARRIER_ID
- LEFT JOIN AMS_SALE_ORDER aso
- ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = aso.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE rco
- ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
- LEFT JOIN RMS_CAPACITY rc
- ON oo.CAPACITY_ID = rc.CAPACITY_ID
- LEFT JOIN RMS_CAPACITY_TYPE rct
- ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
- LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
- ON actp.PRICE_ID = bdo.PRICE_ID
- LEFT JOIN RMS_RECEIVE_PLACE RRP
- ON RRP.PLACE_ID = asom.SALE_SHIPPING_ADDRESS_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
- WHERE oo.ORDER_TYPE in (1,2)
- AND bdo.WETHER_TO_STATEMENT = 1
- <if test="carrierId != null" >
- AND rc2.CARRIER_ID = #{carrierId}
- </if>
- )
- <where>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="orderNumber!= null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
- "orderNumber" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="capacityTypeName!= null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
- "capacityTypeName" in #{item}
- </foreach>
- </if>
- <if test="shipperName!= null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="," close=")">
- "shipperName" in #{item}
- </foreach>
- </if>
- <if test="consigneeReceiveAddress!= null">
- and
- <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
- "consigneeReceiveAddress" in #{item}
- </foreach>
- </if>
- <if test="priceValue!= null">
- and
- <foreach collection="priceValue" item="item" open="(" separator="," close=")">
- "priceValue" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 得到最大id -->
- <select id="selectMaxId" resultType="DECIMAL">
- SELECT MAX(DETAILS_ID)
- FROM BMSTRUCK_DETAILS_ORDER
- </select>
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </sql>
- <!-- 根据运单id查询运单类型 -->
- <select id="getOrderType" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT ORDER_TYPE
- FROM OMSTRUCK_ORDER
- WHERE ORDER_ID = #{orderId}
- </select>
- <!-- 展示采购汽运实绩列表 -->
- <select id="getTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT oo.INSERT_TIME as "insertTime",
- apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
- rm.MATERIAL_NAME as "materialName",
- db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
- oo.ORDER_ISSUE_TIME as "orderIssueTime",
- rc.CONSIGNEE_COMPANY_NAME as "consigneeCompanyName",
- rsu.SUPPLIER_NAME as "supplierName",
- rca.CAPACITY_NUMBER as "capacityNumber",
- twr.RESULT_NET_WEIGHT as "resultNetWeight"
- FROM OMSTRUCK_ORDER oo
- LEFT JOIN RMS_CAPACITY rca
- ON rca.CAPACITY_ID = oo.CAPACITY_ID
- LEFT JOIN AMS_PURCHASE_ORDER apo
- ON apo.PURCHASE_ORDER_ID = oo.ORDER_PLAN_ID
- LEFT JOIN RMS_SUPPLIER rsu
- ON rsu.SUPPLIER_ID = apo.SUPPLIER_UNIT_ID
- LEFT JOIN RMS_CONSIGNEE rc
- ON rc.CONSIGNEE_ID = apo.RECEIVE_UNIT_ID
- LEFT JOIN DIL_BATCH db
- ON db.BATCH_ID = apo.BATCH_ID
- LEFT JOIN RMS_MATERIAL rm
- ON rm.MATERIAL_ID = db.MATERIAL_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
- ON oo.ORDER_ID = ttr.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
- WHERE oo.ORDER_ID = #{orderId}
- )
- <where>
- <if test="purchaseOrderNo!= null">
- and
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="," close=")">
- "purchaseOrderNo" in #{item}
- </foreach>
- </if>
- <if test="materialName!= null">
- and
- <foreach collection="materialName" item="item" open="(" separator="," close=")">
- "materialName" in #{item}
- </foreach>
- </if>
- <if test="resultForeignShipName!= null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="," close=")">
- "resultForeignShipName" in #{item}
- </foreach>
- </if>
- <if test="orderIssueTime!= null">
- and
- <foreach collection="orderIssueTime" item="item" open="(" separator="," close=")">
- "orderIssueTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="consigneeCompanyName!= null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="," close=")">
- "consigneeCompanyName" in #{item}
- </foreach>
- </if>
- <if test="supplierName!= null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="," close=")">
- "supplierName" in #{item}
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="resultNetWeight!= null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="," close=")">
- "resultNetWeight" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 得到销售汽运实绩 -->
- <select id="getSaleTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT oo.INSERT_TIME as "insertTime",
- oo.ORDER_NUMBER as "orderNumber",
- rca.CAPACITY_NUMBER as "capacityNumber",
- rc.CARRIER_NAME as "carrierName",
- rl.LINE_NAME as "lineNo",
- ter.RESULT_ENTRY_GATE_TIME as "resultEntryGateTime",
- rge.GATEPOST_NAME as "enGatepostName",
- twr.RESULT_TARE_WEIGHT_TIME as "resultTareWeightTime",
- twr.RESULT_TARE_WEIGHT as "resultTareWeight",
- rtct.TRUCK_CALCULATE_NUMBER as "tareCalculateNumber",
- tlr.RESULT_LOAD_START_TIME as "resultLoadStartTime",
- rw.WAREHOUSE_NAME as "warehouseName",
- twr.RESULT_GROSS_WEIGHT_TIME as "resultGrossWeightTime",
- twr.RESULT_GROSS_WEIGHT as "resultGrossWeight",
- rtcg.TRUCK_CALCULATE_NUMBER as "grossCalculateNumber",
- tlfr.RESULT_OUT_GATE_TIME as "resultOutGateTime",
- rgl.GATEPOST_NAME as "leaveGatepostName",
- twr.RESULT_NET_WEIGHT as "resultNetWeight"
- FROM OMSTRUCK_ORDER oo
- LEFT JOIN RMS_CAPACITY rca
- ON rca.CAPACITY_ID = oo.CAPACITY_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
- ON asom.SALE_ORDER_MATERIAL_ID = oo.ORDER_PLAN_ID
- LEFT JOIN AMS_DISPATCH_SALE_ORDER adso
- ON adso.SALE_ORDER_MATERIAL_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN RMS_CARRIER rc
- ON rc.CARRIER_ID = adso.CARRIER_ID
- LEFT JOIN RMS_LINE rl
- ON oo.LINE_ID = rl.LINE_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
- ON oo.ORDER_ID = ttr.ORDER_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT ter
- ON ter.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rge
- ON rge.GATEPOST_ID = ter.GATEPOST_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
- ON twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtct
- ON rtct.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LOAD_RESULT tlr
- ON tlr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE rw
- ON rw.WAREHOUSE_ID = tlr.LOADING_ID
- LEFT JOIN RMS_TRUCK_CALCULATE rtcg
- ON rtcg.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
- LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
- ON tlfr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST rgl
- ON rgl.GATEPOST_ID = ter.GATEPOST_ID
- WHERE oo.ORDER_ID = #{orderId}
- )
- <where>
- <if test="orderNumber!= null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
- "orderNumber" in #{item}
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="driverName!= null">
- and
- <foreach collection="driverName" item="item" open="(" separator="," close=")">
- "driverName" in #{item}
- </foreach>
- </if>
- <if test="carrierName!= null">
- and
- <foreach collection="carrierName" item="item" open="(" separator="," close=")">
- "carrierName" in #{item}
- </foreach>
- </if>
- <if test="lineNo!= null">
- and
- <foreach collection="lineNo" item="item" open="(" separator="," close=")">
- "lineNo" in #{item}
- </foreach>
- </if>
- <if test="resultEntryGateTime!= null">
- and
- <foreach collection="resultEntryGateTime" item="item" open="(" separator="," close=")">
- "resultEntryGateTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="enGatepostName!= null">
- and
- <foreach collection="enGatepostName" item="item" open="(" separator="," close=")">
- "enGatepostName" in #{item}
- </foreach>
- </if>
- <if test="resultTareWeightTime!= null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="," close=")">
- "resultTareWeightTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="resultTareWeight!= null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="," close=")">
- "resultTareWeight" in #{item}
- </foreach>
- </if>
- <if test="tareCalculateNumber!= null">
- and
- <foreach collection="tareCalculateNumber" item="item" open="(" separator="," close=")">
- "tareCalculateNumber" in #{item}
- </foreach>
- </if>
- <if test="resultLoadStartTime!= null">
- and
- <foreach collection="resultLoadStartTime" item="item" open="(" separator="," close=")">
- "resultLoadStartTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="resultMeasuredTonnage!= null">
- and
- <foreach collection="resultMeasuredTonnage" item="item" open="(" separator="," close=")">
- "resultMeasuredTonnage" in #{item}
- </foreach>
- </if>
- <if test="warehouseName!= null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="," close=")">
- "warehouseName" in #{item}
- </foreach>
- </if>
- <if test="resultGrossWeightTime!= null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="," close=")">
- "resultGrossWeightTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="resultGrossWeight!= null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="," close=")">
- "resultGrossWeight" in #{item}
- </foreach>
- </if>
- <if test="grossCalculateNumber!= null">
- and
- <foreach collection="grossCalculateNumber" item="item" open="(" separator="," close=")">
- "grossCalculateNumber" in #{item}
- </foreach>
- </if>
- <if test="resultOutGateTime!= null">
- and
- <foreach collection="resultOutGateTime" item="item" open="(" separator="," close=")">
- "resultOutGateTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="leaveGatepostName!= null">
- and
- <foreach collection="leaveGatepostName" item="item" open="(" separator="," close=")">
- "leaveGatepostName" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!-- 得到计算因子 -->
- <select id="getFormulaMembers" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT apo.PURCHASE_ORDER_ID
- FROM OMSTRUCK_ORDER oo
- LEFT JOIN AMS_PURCHASE_ORDER apo
- ON apo.PURCHASE_ORDER_ID = oo.ORDER_PLAN_ID
- WHERE oo.ORDER_ID = #{orderId}
- </select>
- <!-- 得到单价id -->
- <select id="getPriceId" resultType="java.util.Map" parameterType="DECIMAL">
- SELECT OO.PRICE_ID AS "priceId"
- FROM OMSTRUCK_ORDER OO
- WHERE OO.ORDER_ID = #{orderId}
- </select>
- <select id="getPriceValue" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT actp.PRICE_VALUE as "priceValue"
- FROM AMS_CONTRACT_TRANSPORT_PRICE actp
- WHERE PRICE_ID = #{priceId}
- </select>
- <select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT SUM(twr.RESULT_NET_WEIGHT) as "weightTaskResultId"
- FROM TMSTRUCK_WEIGHT_RESULT twr
- WHERE twr.WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </select>
- <select id="getOrderId" parameterType="DECIMAL" resultType="DECIMAL" >
- SELECT OO.ORDER_ID AS "orderId"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- WHERE TWR.WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </select>
- <!-- 查询未生成账单的计时详单 -->
- <!--计时-->
- <select id="getUnFinishedTimeTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
- select bdo.details_no as "detailsNo",
- bdo.order_id as "orderId",
- bdo.details_time as "detailsTime",
- rc.capacity_number as "capacityNumber",
- rct.capacity_type_name as "capacityType",
- air.requirement_type as "requirementType",
- bdo.price_id as "priceId",
- bdo.details_amount as "detailsAmount"
- from bmstruck_details_order bdo
- join omstruck_order oo on bdo.order_id = oo.order_id
- join rms_capacity rc on oo.capacity_id = rc.capacity_id
- join rms_capacity_type rct on rc.capacity_type_id = rct.capacity_type_id
- join amstruck_inward_plan aip on oo.order_plan_id = aip.plan_id
- join amstruck_requirement_plan arp on aip.plan_id = arp.plan_id
- join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
- join rms_line rl on air.line_id = rl.line_id
- where air.requirement_type = 1
- and bdo.wether_to_statement = 0
- and oo.order_type = 4
- </select>
- <!--计数-->
- <select id="getUnFinishedNumTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
- select bdo.details_no as "detailsNo",
- bdo.order_id as "orderId",
- bdo.details_time as "detailsTime",
- rc.capacity_number as "capacityNumber",
- rct.capacity_type_name as "capacityType",
- air.requirement_type as "requirementType",
- bdo.price_id as "priceId",
- bdo.details_amount as "detailsAmount"
- from bmstruck_details_order bdo
- join omstruck_order oo on bdo.order_id = oo.order_id
- join rms_capacity rc on oo.capacity_id = rc.capacity_id
- join rms_capacity_type rct on rc.capacity_type_id = rct.capacity_type_id
- join amstruck_inward_plan aip on oo.order_plan_id = aip.plan_id
- join amstruck_requirement_plan arp on aip.plan_id = arp.plan_id
- join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
- join rms_line rl on air.line_id = rl.line_id
- where air.requirement_type = 2
- and bdo.wether_to_statement = 0
- and oo.order_type = 4
- </select>
- <!--计重-->
- <select id="getUnFinishedWeightTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
- select bdo.details_no as "detailsNo",
- bdo.order_id as "orderId",
- bdo.details_time as "detailsTime",
- rc.capacity_number as "capacityNumber",
- rct.capacity_type_name as "capacityType",
- air.requirement_type as "requirementType",
- bdo.price_id as "priceId",
- bdo.details_amount as "detailsAmount"
- from bmstruck_details_order bdo
- join omstruck_order oo on bdo.order_id = oo.order_id
- join rms_capacity rc on oo.capacity_id = rc.capacity_id
- join rms_capacity_type rct on rc.capacity_type_id = rct.capacity_type_id
- join amstruck_inward_plan aip on oo.order_plan_id = aip.plan_id
- join amstruck_requirement_plan arp on aip.plan_id = arp.plan_id
- join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
- join rms_line rl on air.line_id = rl.line_id
- where air.requirement_type = 0
- and bdo.wether_to_statement = 0
- and oo.order_type = 4
- </select>
- <!--包月-->
- <select id="getUnFinishedMonthTruckDetailsOrderList" parameterType="java.util.Map" resultType="java.util.Map">
- select bdo.details_no as "detailsNo",
- bdo.order_id as "orderId",
- bdo.details_time as "detailsTime",
- rc.capacity_number as "capacityNumber",
- rct.capacity_type_name as "capacityType",
- air.requirement_type as "requirementType",
- bdo.price_id as "priceId",
- bdo.details_amount as "detailsAmount"
- from bmstruck_details_order bdo
- join omstruck_order oo on bdo.order_id = oo.order_id
- join rms_capacity rc on oo.capacity_id = rc.capacity_id
- join rms_capacity_type rct on rc.capacity_type_id = rct.capacity_type_id
- join amstruck_inward_plan aip on oo.order_plan_id = aip.plan_id
- join amstruck_requirement_plan arp on aip.plan_id = arp.plan_id
- join amstruck_inward_requirement air on arp.requirement_plan_id = air.requirement_id
- join rms_line rl on air.line_id = rl.line_id
- where air.requirement_type = 3
- and bdo.wether_to_statement = 0
- and oo.order_type = 4
- </select>
- <!-- 通过运单id获取需求类型(需求类型(0:计重;1:计时;2:计次;3:包月))-->
- <select id="getSettlement" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- select air.requirement_type as "requirementType",
- oom.material_id as "materialId"
- from omstruck_order oo
- left join omstruck_order_material oom on oo.order_id = oom.order_id
- left join amstruck_inward_plan aip on oo.order_plan_id = aip.plan_id
- left join amstruck_requirement_plan arp on arp.plan_id = aip.plan_id
- left join amstruck_inward_requirement air on arp.requirement_id = air.requirement_id
- where oo.order_id = #{orderId}
- </select>
- <select id="getCarrierIdBySSO" parameterType="java.lang.String" resultType="DECIMAL" >
- SELECT
- RC.CARRIER_ID AS "carrierId"
- FROM RMS_CARRIER RC
- WHERE RC.CARRIER_SSO_ID = #{carrierSsoId}
- </select>
- <select id="findAddressAndPrice" parameterType="DECIMAL" resultType="java.util.Map" >
- SELECT ACTP.PRICE_VALUE AS "priceValue",
- RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT || RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS ""
- FROM AMS_CONTRACT_TRANSPORT_PRICE ACTP
- LEFT JOIN RMS_RECEIVE_PLACE RRP
- ON ACTP.PLACE_ID = RRP.PLACE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID = RRP.ADDRESS_ID
- WHERE ACTP.PRICE_ID = #{priceId}
- </select>
- <select id="getWeightTaskResultId" parameterType="DECIMAL" resultType="java.util.Map" >
- SELECT TWR.WEIGHT_TASK_RESULT_ID AS "weightTaskResultId"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- WHERE OO.ORDER_ID = #{orderId}
- </select>
- </mapper>
|