12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306 |
- <?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.OmstruckOrderMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.OmstruckOrder">
- <id column="ORDER_ID" jdbcType="DECIMAL" property="orderId"/>
- <result column="ORDER_PLAN_ID" jdbcType="DECIMAL" property="orderPlanId"/>
- <result column="ORDER_NUMBER" jdbcType="VARCHAR" property="orderNumber"/>
- <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId"/>
- <result column="ORDER_ISSUE_TIME" jdbcType="TIMESTAMP" property="orderIssueTime"/>
- <result column="ORDER_RECEIVE_STATUS" jdbcType="DECIMAL" property="orderReceiveStatus"/>
- <result column="ORDER_RECEIVE_REFUSE_TIME" jdbcType="TIMESTAMP" property="orderReceiveRefuseTime"/>
- <result column="ORDER_COMMUNICATION_DURATION" jdbcType="DECIMAL" property="orderCommunicationDuration"/>
- <result column="ORDER_STATUS" jdbcType="DECIMAL" property="orderStatus"/>
- <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="ORDER_TYPE" jdbcType="DECIMAL" property="orderType"/>
- <result column="ORDER_LINE_SEQUENCE" jdbcType="DECIMAL" property="orderLineSequence"/>
- <result column="LINE_ID" jdbcType="DECIMAL" property="lineId"/>
- <result column="ORDER_ENTRY_TIME" jdbcType="TIMESTAMP" property="orderEntryTime"/>
- <result column="DRIVER_CAPACITY_ID" jdbcType="DECIMAL" property="driverCapacityId"/>
- <result column="UNLOAD_POINT_ID" jdbcType="DECIMAL" property="unloadPointId"/>
- </resultMap>
- <sql id="columns">
- ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
- ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION, ORDER_STATUS, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ORDER_TYPE,
- ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID, UNLOAD_POINT_ID
- </sql>
- <sql id="columns_alias">
- t.ORDER_ID, t.ORDER_PLAN_ID, t.ORDER_NUMBER, t.CAPACITY_ID, t.ORDER_ISSUE_TIME, t.ORDER_RECEIVE_STATUS,
- t.ORDER_RECEIVE_REFUSE_TIME, t.ORDER_COMMUNICATION_DURATION, t.ORDER_STATUS, t.INSERT_USERNAME,
- t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
- t.ORDER_TYPE, t.ORDER_LINE_SEQUENCE, t.LINE_ID, t.ORDER_ENTRY_TIME, t.DRIVER_CAPACITY_ID,
- t.UNLOAD_POINT_ID
- </sql>
- <sql id="select">
- SELECT
- <include refid="columns"/>
- FROM OMSTRUCK_ORDER
- </sql>
- <sql id="select_alias">
- SELECT
- <include refid="columns_alias"/>
- FROM OMSTRUCK_ORDER t
- </sql>
- <sql id="where">
- <where>
- <if test="orderId != null">
- and ORDER_ID = #{orderId}
- </if>
- <if test="orderPlanId != null">
- and ORDER_PLAN_ID = #{orderPlanId}
- </if>
- <if test="orderNumber != null and orderNumber != ''">
- and ORDER_NUMBER = #{orderNumber}
- </if>
- <if test="capacityId != null">
- and CAPACITY_ID = #{capacityId}
- </if>
- <if test="orderIssueTime != null">
- and TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = #{orderIssueTime}
- </if>
- <if test="orderReceiveStatus != null">
- and ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- </if>
- <if test="orderReceiveRefuseTime != null">
- and TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = #{orderReceiveRefuseTime}
- </if>
- <if test="orderCommunicationDuration != null">
- and ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
- </if>
- <if test="orderStatus != null">
- and ORDER_STATUS = #{orderStatus}
- </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="orderType != null">
- and ORDER_TYPE = #{orderType}
- </if>
- <if test="orderLineSequence != null">
- and ORDER_LINE_SEQUENCE = #{orderLineSequence}
- </if>
- <if test="lineId != null">
- and LINE_ID = #{lineId}
- </if>
- <if test="orderEntryTime != null">
- and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
- </if>
- <if test="driverCapacityId != null">
- and DRIVER_CAPACITY_ID = #{driverCapacityId}
- </if>
- <if test="unloadPointId != null">
- and UNLOAD_POINT_ID = #{unloadPointId}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="orderId != null">
- and ORDER_ID = #{orderId}
- </if>
- <if test="orderPlanId != null">
- and ORDER_PLAN_ID = #{orderPlanId}
- </if>
- <if test="orderNumber != null and orderNumber != ''">
- and ORDER_NUMBER LIKE '%${orderNumber}%'
- </if>
- <if test="capacityId != null">
- and CAPACITY_ID = #{capacityId}
- </if>
- <if test="orderIssueTime != null">
- and TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = #{orderIssueTime}
- </if>
- <if test="orderReceiveStatus != null">
- and ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- </if>
- <if test="orderReceiveRefuseTime != null">
- and TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = #{orderReceiveRefuseTime}
- </if>
- <if test="orderCommunicationDuration != null">
- and ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
- </if>
- <if test="orderStatus != null">
- and ORDER_STATUS = #{orderStatus}
- </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="orderType != null">
- and ORDER_TYPE = #{orderType}
- </if>
- <if test="orderLineSequence != null">
- and ORDER_LINE_SEQUENCE = #{orderLineSequence}
- </if>
- <if test="lineId != null">
- and LINE_ID = #{lineId}
- </if>
- <if test="orderEntryTime != null">
- and TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = #{orderEntryTime}
- </if>
- <if test="driverCapacityId != null">
- and DRIVER_CAPACITY_ID = #{driverCapacityId}
- </if>
- <if test="unloadPointId != null">
- and UNLOAD_POINT_ID = #{unloadPointId}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete
- from OMSTRUCK_ORDER
- where ORDER_ID = #{orderId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from OMSTRUCK_ORDER
- where 1!=1
- <if test="orderPlanId != null">
- or ORDER_PLAN_ID = #{orderPlanId}
- </if>
- <if test="orderNumber != null and orderNumber != ''">
- or ORDER_NUMBER = #{orderNumber}
- </if>
- <if test="capacityId != null">
- or CAPACITY_ID = #{capacityId}
- </if>
- <if test="orderIssueTime != null">
- or TO_CHAR(ORDER_ISSUE_TIME,'yyyy-MM-dd') = '#{orderIssueTime}'
- </if>
- <if test="orderReceiveStatus != null">
- or ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- </if>
- <if test="orderReceiveRefuseTime != null">
- or TO_CHAR(ORDER_RECEIVE_REFUSE_TIME,'yyyy-MM-dd') = '#{orderReceiveRefuseTime}'
- </if>
- <if test="orderCommunicationDuration != null">
- or ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration}
- </if>
- <if test="orderStatus != null">
- or ORDER_STATUS = #{orderStatus}
- </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="orderType != null">
- or ORDER_TYPE = #{orderType}
- </if>
- <if test="orderLineSequence != null">
- or ORDER_LINE_SEQUENCE = #{orderLineSequence}
- </if>
- <if test="lineId != null">
- or LINE_ID = #{lineId}
- </if>
- <if test="orderEntryTime != null">
- or TO_CHAR(ORDER_ENTRY_TIME,'yyyy-MM-dd') = '#{orderEntryTime}'
- </if>
- <if test="driverCapacityId != null">
- or DRIVER_CAPACITY_ID = #{driverCapacityId}
- </if>
- <if test="unloadPointId != null">
- or UNLOAD_POINT_ID = #{unloadPointId}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.OmstruckOrder">
- insert into OMSTRUCK_ORDER (ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER,
- CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
- ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION,
- ORDER_STATUS, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
- LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
- UNLOAD_POINT_ID)
- values (#{orderId,jdbcType=DECIMAL}, #{orderPlanId,jdbcType=DECIMAL}, #{orderNumber,jdbcType=VARCHAR},
- #{capacityId,jdbcType=DECIMAL}, #{orderIssueTime,jdbcType=TIMESTAMP},
- #{orderReceiveStatus,jdbcType=DECIMAL},
- #{orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{orderCommunicationDuration,jdbcType=DECIMAL},
- #{orderStatus,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
- #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleted,jdbcType=DECIMAL}, #{orderType,jdbcType=DECIMAL}, #{orderLineSequence,jdbcType=DECIMAL},
- #{lineId,jdbcType=DECIMAL}, #{orderEntryTime,jdbcType=TIMESTAMP}, #{driverCapacityId,jdbcType=DECIMAL},
- #{unloadPointId,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
- insert into OMSTRUCK_ORDER
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderId != null">
- ORDER_ID,
- </if>
- <if test="orderPlanId != null">
- ORDER_PLAN_ID,
- </if>
- <if test="orderNumber != null">
- ORDER_NUMBER,
- </if>
- <if test="capacityId != null">
- CAPACITY_ID,
- </if>
- <if test="orderIssueTime != null">
- ORDER_ISSUE_TIME,
- </if>
- <if test="orderReceiveStatus != null">
- ORDER_RECEIVE_STATUS,
- </if>
- <if test="orderReceiveRefuseTime != null">
- ORDER_RECEIVE_REFUSE_TIME,
- </if>
- <if test="orderCommunicationDuration != null">
- ORDER_COMMUNICATION_DURATION,
- </if>
- <if test="orderStatus != null">
- ORDER_STATUS,
- </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="orderType != null">
- ORDER_TYPE,
- </if>
- <if test="orderLineSequence != null">
- ORDER_LINE_SEQUENCE,
- </if>
- <if test="lineId != null">
- LINE_ID,
- </if>
- <if test="orderEntryTime != null">
- ORDER_ENTRY_TIME,
- </if>
- <if test="driverCapacityId != null">
- DRIVER_CAPACITY_ID,
- </if>
- <if test="unloadPointId != null">
- UNLOAD_POINT_ID,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderId != null">
- #{orderId,jdbcType=DECIMAL},
- </if>
- <if test="orderPlanId != null">
- #{orderPlanId,jdbcType=DECIMAL},
- </if>
- <if test="orderNumber != null">
- #{orderNumber,jdbcType=VARCHAR},
- </if>
- <if test="capacityId != null">
- #{capacityId,jdbcType=DECIMAL},
- </if>
- <if test="orderIssueTime != null">
- #{orderIssueTime,jdbcType=TIMESTAMP},
- </if>
- <if test="orderReceiveStatus != null">
- #{orderReceiveStatus,jdbcType=DECIMAL},
- </if>
- <if test="orderReceiveRefuseTime != null">
- #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="orderCommunicationDuration != null">
- #{orderCommunicationDuration,jdbcType=DECIMAL},
- </if>
- <if test="orderStatus != null">
- #{orderStatus,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="deleted != null">
- #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="orderType != null">
- #{orderType,jdbcType=DECIMAL},
- </if>
- <if test="orderLineSequence != null">
- #{orderLineSequence,jdbcType=DECIMAL},
- </if>
- <if test="lineId != null">
- #{lineId,jdbcType=DECIMAL},
- </if>
- <if test="orderEntryTime != null">
- #{orderEntryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="driverCapacityId != null">
- #{driverCapacityId,jdbcType=DECIMAL},
- </if>
- <if test="unloadPointId != null">
- #{unloadPointId,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstruckOrder">
- update OMSTRUCK_ORDER
- set ORDER_PLAN_ID = #{orderPlanId,jdbcType=DECIMAL},
- ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
- CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
- ORDER_ISSUE_TIME = #{orderIssueTime,jdbcType=TIMESTAMP},
- ORDER_RECEIVE_STATUS = #{orderReceiveStatus,jdbcType=DECIMAL},
- ORDER_RECEIVE_REFUSE_TIME = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
- ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration,jdbcType=DECIMAL},
- ORDER_STATUS = #{orderStatus,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},
- DELETED = #{deleted,jdbcType=DECIMAL},
- ORDER_TYPE = #{orderType,jdbcType=DECIMAL},
- ORDER_LINE_SEQUENCE = #{orderLineSequence,jdbcType=DECIMAL},
- LINE_ID = #{lineId,jdbcType=DECIMAL},
- ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
- DRIVER_CAPACITY_ID = #{driverCapacityId,jdbcType=DECIMAL},
- UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL}
- where ORDER_ID = #{orderId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
- update OMSTRUCK_ORDER
- <set>
- <if test="orderPlanId != null">
- ORDER_PLAN_ID = #{orderPlanId,jdbcType=DECIMAL},
- </if>
- <if test="orderNumber != null">
- ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR},
- </if>
- <if test="capacityId != null">
- CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
- </if>
- <if test="orderIssueTime != null">
- ORDER_ISSUE_TIME = #{orderIssueTime,jdbcType=TIMESTAMP},
- </if>
- <if test="orderReceiveStatus != null">
- ORDER_RECEIVE_STATUS = #{orderReceiveStatus,jdbcType=DECIMAL},
- </if>
- <if test="orderReceiveRefuseTime != null">
- ORDER_RECEIVE_REFUSE_TIME = #{orderReceiveRefuseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="orderCommunicationDuration != null">
- ORDER_COMMUNICATION_DURATION = #{orderCommunicationDuration,jdbcType=DECIMAL},
- </if>
- <if test="orderStatus != null">
- ORDER_STATUS = #{orderStatus,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="deleted != null">
- DELETED = #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="orderType != null">
- ORDER_TYPE = #{orderType,jdbcType=DECIMAL},
- </if>
- <if test="orderLineSequence != null">
- ORDER_LINE_SEQUENCE = #{orderLineSequence,jdbcType=DECIMAL},
- </if>
- <if test="lineId != null">
- LINE_ID = #{lineId,jdbcType=DECIMAL},
- </if>
- <if test="orderEntryTime != null">
- ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
- </if>
- <if test="driverCapacityId != null">
- DRIVER_CAPACITY_ID = #{driverCapacityId,jdbcType=DECIMAL},
- </if>
- <if test="unloadPointId != null">
- UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL},
- </if>
- </set>
- where ORDER_ID = #{orderId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where ORDER_ID = #{orderId,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 OMSTRUCK_ORDER
- (ORDER_ID,
- ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID,
- ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
- ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION,
- ORDER_STATUS, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
- LINE_ID, ORDER_ENTRY_TIME, DRIVER_CAPACITY_ID,
- UNLOAD_POINT_ID)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.orderId,jdbcType=DECIMAL},
- #{item.orderPlanId,jdbcType=DECIMAL}, #{item.orderNumber,jdbcType=VARCHAR}, #{item.capacityId,jdbcType=DECIMAL},
- #{item.orderIssueTime,jdbcType=TIMESTAMP}, #{item.orderReceiveStatus,jdbcType=DECIMAL},
- #{item.orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{item.orderCommunicationDuration,jdbcType=DECIMAL},
- #{item.orderStatus,jdbcType=DECIMAL}, #{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.orderType,jdbcType=DECIMAL},
- #{item.orderLineSequence,jdbcType=DECIMAL},
- #{item.lineId,jdbcType=DECIMAL}, #{item.orderEntryTime,jdbcType=TIMESTAMP},
- #{item.driverCapacityId,jdbcType=DECIMAL},
- #{item.unloadPointId,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update OMSTRUCK_ORDER
- set
- ORDER_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_PLAN_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderPlanId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNumber,jdbcType=VARCHAR}
- </foreach>
- ,CAPACITY_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_ISSUE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderIssueTime,jdbcType=TIMESTAMP}
- </foreach>
- ,ORDER_RECEIVE_STATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveStatus,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_RECEIVE_REFUSE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveRefuseTime,jdbcType=TIMESTAMP}
- </foreach>
- ,ORDER_COMMUNICATION_DURATION=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderCommunicationDuration,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_STATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderStatus,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_TYPE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderType,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_LINE_SEQUENCE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderLineSequence,jdbcType=DECIMAL}
- </foreach>
- ,LINE_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
- </foreach>
- ,ORDER_ENTRY_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.orderEntryTime,jdbcType=TIMESTAMP}
- </foreach>
- ,DRIVER_CAPACITY_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.driverCapacityId,jdbcType=DECIMAL}
- </foreach>
- ,UNLOAD_POINT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
- when #{item.orderId,jdbcType=DECIMAL} then #{item.unloadPointId,jdbcType=DECIMAL}
- </foreach>
- where ORDER_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.orderId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from OMSTRUCK_ORDER
- where ORDER_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 根据插入时间排序 -->
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- </sql>
- <!-- 查询运输订单 -->
- <select id="getAllTruckOrder" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from
- (
- select
- OO.ORDER_ID "orderId",
- APO.PURCHASE_ORDER_ID "purchaseOrderId",
- AP.PLAN_ID "planId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- AP.PLAN_NO "planNo",
- RC.CAPACITY_NUMBER "capacityNumber",
- RC.CAPACITY_ID "capacityId",
- RCD.DRIVER_NAME "driverName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- AP.PLAN_TRUCK_TIME "planTruckTime",
- AP.PLAN_INCOMING_TIME "planIncomingTime",
- OO.INSERT_USERNAME "insertUsername",
- OO.INSERT_TIME "insertTime",
- OO.ORDER_NUMBER "orderNumber",
- RW.WAREHOUSE_NAME "warehouseName",
- OO.ORDER_ENTRY_TIME "orderEntryTime",
- RS.SUPPLIER_NAME "supplierName",
- RCSE.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
- from OMSTRUCK_ORDER OO
- left join AMS_PURCHASE_ORDER APO
- on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
- left join AMSTRUCK_PURPLAN AP
- on AP.BATCH_ID = APO.BATCH_ID and AP.PLAN_STATUS != 3
- left join RMS_DRIVER_CAPACITY RDC
- on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = RDC.CAPACITY_ID
- left join RMS_CAR_DRIVER RCD
- on RCD.DRIVER_ID = RDC.DRIVER_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_WAREHOUSE RW
- on OO.UNLOAD_POINT_ID = RW.WAREHOUSE_ID
- left join RMS_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCSE
- on APO.RECEIVE_UNIT_ID = RCSE.CONSIGNEE_ID
- <where>
- <choose>
- <when test="orderStatus != 8">
- and OO.ORDER_STATUS = #{orderStatus}
- </when>
- <otherwise>
- and OO.ORDER_STATUS in (1, 2, 4, 5, 6)
- </otherwise>
- </choose>
- <if test="planId != null ">
- and AP.PLAN_ID = #{planId}
- </if>
- <if test="orderType != null">
- and OO.ORDER_TYPE = #{orderType}
- </if>
- <if test="fuelOrder != null">
- and OO.ORDER_TYPE in (6, 7)
- </if>
- </where>
- )
- <where>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="planNo != null">
- and
- <foreach collection="planNo" item="item" open="(" separator="or" close=")">
- "planNo" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="driverName != null">
- and
- <foreach collection="driverName" item="item" open="(" separator="or" close=")">
- "driverName" like '%${item}%'
- </foreach>
- </if>
- <if test="planTruckTime != null">
- and
- <foreach collection="planTruckTime" item="item" open="(" separator="or" close=")">
- "planTruckTime" like '%${item}%'
- </foreach>
- </if>
- <if test="planIncomingTime != null">
- and
- <foreach collection="planIncomingTime" item="item" open="(" separator="or" close=")">
- "planIncomingTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- and
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- <if test="insertTime != null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
- "insertTime" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderEntryTime != null">
- and
- <foreach collection="orderEntryTime" item="item" open="(" separator="or" close=")">
- "orderEntryTime" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </select>
- <!-- 通过运输订单Id查询运输订单号 -->
- <select id="getOrderNumberByOrderId" parameterType="int" resultType="string">
- select OO.ORDER_NUMBER "orderNumber"
- from OMSTRUCK_ORDER OO
- where OO.ORDER_ID = #{orderId}
- </select>
- <!-- 获取所有的运力信息 -->
- <select id="getAllCapacity" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from
- (
- select
- RDC.DRIVER_CAPACITY_ID "driverCapacityId",
- RC.CAPACITY_NUMBER "capacityNumber",
- RCD.DRIVER_NAME "driverName",
- RC.CAPACITY_VIP "capacityVip",
- RCA.CARRIER_NAME "carrierName",
- RCT.CAPACITY_TYPE_NAME "capacityTypeName",
- RC.CAPACITY_BLACKLIST "capacityBlacklist",
- RDC.INSERT_TIME "insertTime"
- from RMS_DRIVER_CAPACITY RDC
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = RDC.CAPACITY_ID
- left join RMS_CARRIER RCA
- on RC.CARRIER_ID = RCA.CARRIER_ID
- left join RMS_CAR_DRIVER RCD
- on RCD.DRIVER_ID = RDC.DRIVER_ID
- left join RMS_CAPACITY_TYPE RCT
- on RCT.CAPACITY_TYPE_ID = RC.CAPACITY_TYPE_ID
- <where>
- <if test="capacityTypeId != null">
- RC.CAPACITY_TYPE_ID = #{capacityTypeId}
- </if>
- <if test="capacityStatus != null">
- and RC.CAPACITY_STATUS = #{capacityStatus}
- </if>
- <if test="carrierId != null">
- and RC.CARRIER_ID = #{carrierId}
- </if>
- </where>
- )
- <where>
- <if test="capacityTypeName != null">
- <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
- "capacityTypeName" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="driverName != null">
- and
- <foreach collection="driverName" item="item" open="(" separator="or" close=")">
- "driverName" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityVip != null">
- and
- <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">
- "capacityVip" 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="capacityBlacklist != null">
- and
- <foreach collection="capacityBlacklist" item="item" open="(" separator="or" close=")">
- "capacityBlacklist" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </select>
- <!-- 通过Id查询派发时间 -->
- <select id="getInsertTimeById" parameterType="int" resultType="java.util.Date">
- select ORDER_ISSUE_TIME
- from OMSTRUCK_ORDER
- where ORDER_ID = #{orderId}
- </select>
- <!-- 通过车牌号匹配运力Id -->
- <select id="getCapacityIdByCapacityNum" parameterType="string" resultType="java.math.BigDecimal">
- select CAPACITY_ID
- from RMS_CAPACITY
- where CAPACITY_NUMBER = #{capacityNumber}
- </select>
- <!-- 通过运输订单ID 或运输订单号 查询 运力ID -->
- <select id="getCapacityIdByOrderOrNum" parameterType="java.util.Map" resultType="java.math.BigDecimal">
- select CAPACITY_ID
- from OMSTRUCK_ORDER
- <where>
- <if test="orderId != null">
- ORDER_ID = #{orderId}
- </if>
- <if test="orderNumber != null">
- and ORDER_NUMBER = #{orderNumber}
- </if>
- </where>
- </select>
- <!-- 通过运力ID 或车牌号 修改 运力状态 -->
- <update id="updateCapacityByCarIdOrNum" parameterType="java.util.Map">
- update RMS_CAPACITY RC
- set RC.CAPACITY_STATUS = #{capacityStatus}
- where
- <if test="capacityId != null">
- RC.CAPACITY_ID = #{capacityId}
- </if>
- <if test="capacityNumber != null">
- RC.CAPACITY_NUMBER = #{capacityNumber}
- </if>
- </update>
- <!-- 销售物流,通过运力id修改运力状态 -->
- <update id="updateCapacityById" parameterType="java.util.Map">
- update RMS_CAPACITY RC
- set RC.CAPACITY_STATUS = #{capacityStatus}
- where
- <if test="driverCapacityId != null">
- RC.CAPACITY_ID = #{driverCapacityId}
- </if>
- <if test="capacityNumber != null">
- RC.CAPACITY_NUMBER = #{capacityNumber}
- </if>
- </update>
- <!-- 通过运力ID 查询采购司机接单数据 、通过运单号查询所有运单信息-->
- <select id="getTruckOrderByCapacityNum" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select OO.ORDER_NUMBER "orderNumber",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
- RW.WAREHOUSE_NAME "warehouseName",
- RM.MATERIAL_NAME "materialName",
- RC.CAPACITY_NUMBER "capacityNumber",
- RW2.WAREHOUSE_NAME "warehouseName2"
- from OMSTRUCK_ORDER OO
- left join RMS_DRIVER_CAPACITY RDC on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
- left join RMS_CAPACITY RC on RC.CAPACITY_ID = RDC.CAPACITY_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_WAREHOUSE RW on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
- left join TMSTRUCK_TOTAL_RESULT TTR on TTR.ORDER_ID = OO.ORDER_ID
- left join TMSTRUCK_LOAD_RESULT TLR on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_WAREHOUSE RW2 on RW2.WAREHOUSE_ID = TLR.LOADING_ID
- where OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="orderReceiveRefuseTime != null">
- and
- <foreach collection="orderReceiveRefuseTime" item="item" open="(" separator="or" close=")">
- "orderReceiveRefuseTime" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName2 != null">
- and
- <foreach collection="warehouseName2" item="item" open="(" separator="or" close=")">
- "warehouseName2" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "orderReceiveRefuseTime" desc
- </if>
- </select>
- <!-- 通过运力ID 查询销售司机接单数据 、通过运单号查询所有运单信息-->
- <select id="getSaleTruckOrderByCapacityNum" parameterType="java.util.Map" resultType="java.util.Map">
- select
- distinct *
- from(
- select
- OO.INSERT_TIME "insertTime",
- OO.ORDER_ID "orderId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "carNumber",
- ASO.SALE_NUMBER "saleNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- RS.SHIPPER_NAME "shipperName",
- RCO.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt"
- from OMSTRUCK_ORDER OO
- left join AMS_SALE_ORDER_MATERIAL ASOM
- on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_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_RECEIVE_ADDRESS RRA
- on RRA.ADDRESS_ID = ASOM.SALE_SHIPPING_ADDRESS_ID
- left join RMS_CAPACITY RC --车牌号
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM --物资重量
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM --物资名称
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- <where>
- <if test="capacityId != null">
- and OO.CAPACITY_ID = #{capacityId}
- </if>
- <if test="orderStatus != null">
- and OO.ORDER_STATUS = #{orderStatus}
- </if>
- <if test="orderId != null">
- and OO.ORDER_ID = #{orderId}
- </if>
- <if test="orderType != null">
- and OO.ORDER_TYPE = #{orderType}
- </if>
- <if test="orderReceiveStatus != null">
- and OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- </if>
- </where>
- )
- <where>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="carNumber != null">
- <foreach collection="carNumber" item="item" open="(" separator="or" close=")">
- "carNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="saleNumber != null">
- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
- "saleNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" 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="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" 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="saleDateOfReceipt != null">
- and
- <foreach collection="saleDateOfReceipt" item="item" open="(" separator="or" close=")">
- "saleDateOfReceipt" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </select>
- <!-- 查询五个作业点名称sql片段 -->
- <sql id="columnSql">
- RG1.GATEPOST_NAME "gatepostName1",
- RG2.GATEPOST_NAME "gatepostName2",
- RTC1.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- RW.WAREHOUSE_NAME "warehouseName",
- RTC2.TRUCK_CALCULATE_NUMBER "truckCalculateNum",
- </sql>
- <sql id="placeSql">
- left join RMS_GATEPOST RG1 --进厂门岗
- on RG1.GATEPOST_ID = RL.LINE_START_NODE_ID
- left join RMS_GATEPOST RG2 --出厂门岗
- on RG2.GATEPOST_ID = RL.LINE_END_NODE_ID
- left join RMS_LINE_SEGEMNT RLS1
- on RL.LINE_ID = RLS1.LINE_ID and RLS1.SEGMENT_END_NODE_TYPE = 1
- left join RMS_TRUCK_CALCULATE RTC1 -- 计毛汽车衡
- on RLS1.SEGMENT_END_NODE_ID = RTC1.TRUCK_CALCULATE_ID
- left join RMS_LINE_SEGEMNT RLS2
- on RL.LINE_ID = RLS2.LINE_ID and RLS2.SEGMENT_END_NODE_TYPE = 3
- left join RMS_WAREHOUSE RW -- 卸货仓库
- on RW.WAREHOUSE_ID = RLS2.SEGMENT_END_NODE_ID
- left join RMS_LINE_SEGEMNT RLS3
- on RL.LINE_ID = RLS3.LINE_ID and RLS3.SEGMENT_END_NODE_TYPE = 2
- left join RMS_TRUCK_CALCULATE RTC2 -- 计皮汽车衡
- on RLS3.SEGMENT_END_NODE_ID = RTC2.TRUCK_CALCULATE_ID
- </sql>
- <!-- 通过运力ID 查询司机所有已拒绝已接收的订单 -->
- <select id="getReceiveRefuseOrderByCapacityId" parameterType="java.util.Map" resultType="java.util.Map">
- select OO.ORDER_ID "orderId",
- OO.ORDER_NUMBER "orderNumber"
- from OMSTRUCK_ORDER OO
- where CAPACITY_ID = #{capacityId}
- and ORDER_RECEIVE_STATUS = 0
- </select>
- <!-- 查询实绩流程 -->
- <select id="selectPlaceAndTime" parameterType="DECIMAL" resultType="java.util.Map">
- SELECT ERG.GATEPOST_NAME as "entryGatepost",
- TER.RESULT_ENTRY_GATE_TIME as "entryTime",
- GRTC.TRUCK_CALCULATE_NUMBER as "grossCalculate",
- TWR.RESULT_GROSS_WEIGHT_TIME as "grossTime",
- RW.WAREHOUSE_NAME as "unloadWarhouse",
- TUR.RESULT_START_TIME as "unloadTime",
- TRTC.TRUCK_CALCULATE_NUMBER as "tareCalculate",
- TWR.RESULT_TARE_WEIGHT_TIME as "tareTime",
- LRG.GATEPOST_NAME as "leaveGatepost",
- TLFR.RESULT_OUT_GATE_TIME as "outTime",
- RWR.WAREHOUSE_NAME as "receiptWarhouse",
- TRR.INSERT_TIME as "receiptTime",
- OO.ORDER_LINE_SEQUENCE as "orderLineSequence",
- OO.ORDER_TYPE as "orderType"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
- ON TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST ERG --进厂门岗
- ON ERG.GATEPOST_ID = TER.GATEPOST_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE GRTC --毛重汽车衡
- ON TWR.RESULT_GROSS_PLACE_ID = GRTC.TRUCK_CALCULATE_ID
- LEFT JOIN RMS_TRUCK_CALCULATE TRTC --皮重汽车衡
- ON TWR.RESULT_TARE_PLACE_ID = TRTC.TRUCK_CALCULATE_ID
- LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR
- ON TTR.RESULT_TOTAL_ID = TUR.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE RW --卸货点
- ON RW.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
- LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
- ON TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
- LEFT JOIN RMS_GATEPOST LRG --出厂门岗
- ON LRG.GATEPOST_ID = TLFR.GATEPOST_ID
- LEFT JOIN TMSTRUCK_RECEIPT_RESULT TRR
- ON TRR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_WAREHOUSE RWR --异地库
- ON TRR.WAREHOUSE_ID = RWR.WAREHOUSE_ID
- WHERE OO.ORDER_ID = #{orderId}
- </select>
- <!-- 通过运输订单ID查询运输订单相关信息 -->
- <select id="getOrderByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- SELECT APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_ID "materialId",
- OO.ORDER_ENTRY_TIME "orderEntryTime",
- OO.ORDER_TYPE "orderType",
- OO.UNLOAD_POINT_ID "unloadPointId"
- FROM OMSTRUCK_ORDER OO
- left join RMS_DRIVER_CAPACITY RDC
- on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RDC.CAPACITY_ID = RC.CAPACITY_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- WHERE OO.ORDER_ID = #{orderId}
- </select>
- <!-- 通过运输订单号查询各路段预设作业点 以及总实绩ID -->
- <select id="getPointIdByOrderNum" parameterType="java.util.Map" resultType="java.util.Map">
- select
- RL.LINE_START_NODE_ID "lineStartNodeId",
- RL.LINE_END_NODE_ID "lineEndNodeId",
- RLS1.SEGMENT_END_NODE_ID "truckCalculateIdMao",
- RLS2.SEGMENT_END_NODE_ID "truckCalculateIdPi",
- RLS3.SEGMENT_END_NODE_ID "resultUnloadPlaceId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- OO.ORDER_TYPE "orderType"
- from OMSTRUCK_ORDER OO
- left join RMS_LINE RL
- on RL.LINE_ID = OO.LINE_ID
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID = OO.ORDER_ID
- left join RMS_LINE_SEGEMNT RLS1 --查询计毛汽车衡
- on RL.LINE_ID = RLS1.LINE_ID and RLS1.SEGMENT_END_NODE_TYPE = 1
- left join RMS_LINE_SEGEMNT RLS2 --查询计皮汽车衡
- on RL.LINE_ID = RLS2.LINE_ID and RLS2.SEGMENT_END_NODE_TYPE = 2
- left join RMS_LINE_SEGEMNT RLS3 --查询卸货点
- on RL.LINE_ID = RLS3.LINE_ID and RLS3.SEGMENT_END_NODE_TYPE = 3
- <where>
- <if test="orderNumber != null">
- OO.ORDER_NUMBER = #{orderNumber}
- </if>
- <if test="orderId != null">
- and OO.ORDER_ID = #{orderId}
- </if>
- </where>
- </select>
- <!-- 查询运输派单信息 -->
- <select id="getTransportDispatch" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select
- *
- from(
- select
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RS.SUPPLIER_NAME "supplierName",
- RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RW.WAREHOUSE_NAME "warehouseName",
- RCON.CONSIGNEE_CONTACT_NAME "consigneeContactName",
- RCON.CONSIGNEE_CONTACT_TEL "consigneeContactTel",
- APO.PUCHASE_ORDER_DELIVERY_DATE "puchaseOrderDeliveryDate",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- OO.ORDER_ISSUE_TIME "orderIssueTime",
- OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
- RC.CAPACITY_NUMBER "capacityNumber",
- RCD.DRIVER_NAME "driverName"
- from OMSTRUCK_ORDER OO
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_SUPPLIER RS
- on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
- left join RMS_DRIVER_CAPACITY RDC
- on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = RDC.CAPACITY_ID
- left join RMS_CAR_DRIVER RCD
- on RCD.DRIVER_ID = RDC.DRIVER_ID
- <where>
- <if test="orderStatus != null">
- OO.ORDER_STATUS = #{orderStatus}
- </if>
- <if test="orderTypee != null">
- and OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderReceiveStatus != null">
- and OO.ORDER_RECEIVE_STATUS = #{orderReceiveStatus}
- </if>
- <if test="fuelOrder != null">
- and OO.ORDER_TYPE in (6, 7)
- </if>
- </where>
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" like '%${item}%'
- </foreach>
- </if>
- <if test="supplierName != null">
- and
- <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
- "supplierName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- <if test="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeContactName != null">
- and
- <foreach collection="consigneeContactName" item="item" open="(" separator="or" close=")">
- "consigneeContactName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeContactTel != null">
- and
- <foreach collection="consigneeContactTel" item="item" open="(" separator="or" close=")">
- "consigneeContactTel" like '%${item}%'
- </foreach>
- </if>
- <if test="puchaseOrderDeliveryDate != null">
- and
- <foreach collection="puchaseOrderDeliveryDate" item="item" open="(" separator="or" close=")">
- "puchaseOrderDeliveryDate" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialWeight != null">
- and
- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
- "orderMaterialWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="orderReceiveRefuseTime != null">
- and
- <foreach collection="orderReceiveRefuseTime" item="item" open="(" separator="or" close=")">
- "orderReceiveRefuseTime" like '%${item}%'
- </foreach>
- </if>
- <if test="orderIssueTime != null">
- and
- <foreach collection="orderIssueTime" item="item" open="(" separator="or" close=")">
- "orderIssueTime" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="driverName != null">
- and
- <foreach collection="driverName" item="item" open="(" separator="or" close=")">
- "driverName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "orderReceiveRefuseTime" desc
- </if>
- </select>
- <!-- 查询已下发已接受的销售订单信息 -->
- <select id="getOrderReceived" parameterType="DECIMAL" resultType="java.util.Map">
- SELECT aso.SALE_NUMBER as "saleNumber",
- oo.ORDER_NUMBER as "orderNumber",
- oo.INSERT_USERNAME as "insertUsername",
- rc.CAPACITY_NUMBER as "capacityNumber"
- FROM OMSTRUCK_ORDER oo
- LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
- ON asom.SALE_ORDER_MATERIAL_ID = oo.ORDER_PLAN_ID
- LEFT JOIN AMS_SALE_ORDER aso
- ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
- LEFT JOIN RMS_CAPACITY rc
- ON rc.CAPACITY_ID = oo.CAPACITY_ID
- WHERE oo.ORDER_ISSUE_TIME IS NOT NULL
- AND oo.ORDER_RECEIVE_STATUS = 1
- AND oo.ORDER_TYPE = #{orderType}
- <where>
- <if test="saleNumber != null">
- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
- "saleNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderNumber != null">
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUsername != null">
- <foreach collection="insertUsername" item="item" open="(" separator="or" close=")">
- "insertUsername" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- <!--查询司机排班信息-->
- <select id="selectCapacityAndDriver" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT
- RDC.CAPACITY_ID "capacityId",
- RDC.DRIVER_CAPACITY_ID "driverCapacityId",
- RC.CAPACITY_NUMBER "number",
- RCT.CAPACITY_TYPE_NAME "capacityTypeName",
- RCD.DRIVER_NAME "name"
- FROM
- RMS_DRIVER_CAPACITY RDC
- LEFT JOIN RMS_CAPACITY RC ON RDC.CAPACITY_ID = RC.CAPACITY_ID
- LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCT.CAPACITY_TYPE_ID = RC.CAPACITY_TYPE_ID
- LEFT JOIN RMS_CAR_DRIVER RCD ON RCD.DRIVER_ID = RDC.DRIVER_ID
- WHERE
- RC.CAPACITY_STATUS =0 and RC.CARRIER_ID=#{carrierId}
- <where>
- <if test="capacityId != null">
- <foreach collection="capacityId" item="item" open="(" separator="or" close=")">
- "capacityId" like '%${item}%'
- </foreach>
- </if>
- <if test="number != null">
- <foreach collection="number" item="item" open="(" separator="or" close=")">
- "number" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityTypeName != null">
- <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
- "capacityTypeName" like '%${item}%'
- </foreach>
- </if>
- <if test="name != null">
- <foreach collection="name" item="item" open="(" separator="or" close=")">
- "name" like '%${item}%'
- </foreach>
- </if>
- </where>
- </select>
- <!--根据id查找用户名 -->
- <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
- select RP.PERSONNEL_NAME "personnelName"
- from RMS_PERSONNEL RP
- where RP.PERSONNEL_ID = #{personnelId}
- </select>
- <!-- 通过车牌号、承运商匹配最新的运力id-->
- <select id="selectCapacityId" parameterType="java.util.Map" resultType="java.math.BigDecimal">
- select t.CAPACITY_ID
- from RMS_CAPACITY t
- where t.CAPACITY_ID = #{capacityId}
- and t.CAPACITY_NUMBER = #{capacityNumber}
- </select>
- <!-- 通过运输订单号或运输订单ID查询总实绩ID和订单类型 -->
- <select id="getResultTotalIdByOrderNumAndId" parameterType="java.util.Map" resultType="java.util.Map">
- select
- TTR.RESULT_TOTAL_ID "resultTotalId",
- OO.ORDER_TYPE "orderType"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID = OO.ORDER_ID
- <where>
- <if test="orderId != null">
- OO.ORDER_ID= #{orderId}
- </if>
- <if test="orderNumber != null">
- and OO.ORDER_NUMBER = #{orderNumber}
- </if>
- </where>
- </select>
- <!--通过运输订单ID查询数据 用于websocket推送数据 如果订单实绩中有卸货点 没有卸货点通过传入的卸货点进行查询-->
- <select id="pushMesToWebsocket" parameterType="java.util.Map" resultType="java.util.Map">
- select OO.ORDER_NUMBER "orderNumber",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- RM.MATERIAL_NAME "materialName",
- RC.CAPACITY_NUMBER "capacityNumber"
- from OMSTRUCK_ORDER OO
- left join RMS_DRIVER_CAPACITY RDC
- on OO.DRIVER_CAPACITY_ID = RDC.DRIVER_CAPACITY_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = RDC.CAPACITY_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_WAREHOUSE RW
- on RW.WAREHOUSE_ID = OO.UNLOAD_POINT_ID
- where OO.ORDER_ID = #{orderId}
- </select>
- <!-- //通过物资id查询批次表匹配最新的批次,关联最新的采购订单号 -->
- <select id="selectNewOrderId" parameterType="java.math.BigDecimal" resultType="string">
- select *
- from (select apo.PURCHASE_ORDER_NO
- from DIL_BATCH db
- join AMS_PURCHASE_ORDER apo on apo.BATCH_ID = db.BATCH_ID
- where db.MATERIAL_ID = #{materialId}
- order by db.INSERT_TIME desc)
- where rownum = 1
- </select>
- <!--通过运输订单Id查询运输订单子表有几种物资 :物资ID-->
- <select id="getMaterialIdListByOrderId" parameterType="int" resultType="java.lang.Integer">
- select OOM.MATERIAL_ID
- from OMSTRUCK_ORDER OO
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- </select>
- <!-- 通过采购订单号查找采购订单ID -->
- <select id="getPurchaseOrderIdByNo" parameterType="string" resultType="java.math.BigDecimal">
- select APO.PURCHASE_ORDER_ID
- from AMS_PURCHASE_ORDER APO
- where APO.PURCHASE_ORDER_NO = #{purchaseOrderNo}
- </select>
- <select id="getSaleTruckOrderByCapacityId" resultType="java.util.Map">
- select oo.ORDER_ID "orderId",
- oo.order_number "orderNumber",
- rc.capacity_number "capacityNumber",
- aso.sale_number "saleOrderNumber",
- rs.shipper_name "shipperUnit",
- rce.consignee_company_name "receiveUnit",
- to_char(oo.order_issue_time, 'yyyy-mm-dd') "shipperDate",
- rca.address_delivery_address "receiveAddress",
- asom.sale_date_of_receipt "receiveDate"
- from omstruck_order oo
- left join rms_driver_capacity rdc
- on rdc.driver_capacity_id = oo.driver_capacity_id
- left join rms_capacity rc
- on rc.capacity_id = rdc.capacity_id
- left join omstruck_order_material oom
- on oom.order_id = oo.order_id
- left join ams_sale_order_material asom
- on asom.sale_order_material_id = oo.order_plan_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 rce
- on rce.consignee_id = aso.receive_id
- left join rms_receive_address rca
- on rca.address_id = asom.sale_shipping_address_id
- where rdc.capacity_id = #{capacityId}
- and oo.order_status = #{orderStatus}
- and oo.order_type = #{orderType}
- </select>
- <select id="getSaleTruckOrderByCapacityNumMaterial" resultType="java.util.Map">
- select rm.material_name "materialName",
- oom.order_material_weight "materialWeight"
- from omstruck_order oo
- left join rms_driver_capacity rdc
- on rdc.driver_capacity_id = oo.driver_capacity_id
- left join rms_capacity rc
- on rc.capacity_id = rdc.capacity_id
- left join omstruck_order_material oom
- on oom.order_id = oo.order_id
- left join rms_material rm
- on rm.material_id = oom.material_id
- where rdc.capacity_id = #{capacityId}
- and oo.order_status = #{orderStatus}
- and oo.order_type = #{orderType}
- </select>
- <!-- 通过车序号查找物资id -->
- <select id="selectMaterialIdBysaleOrderMaterialId" resultType="java.util.Map" parameterType="java.lang.Integer">
- SELECT ASTM.MATERIAL_ID "materialId"
- FROM AMS_SALE_ORDER_MATERIAL ASOM
- LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.TRUCKNO_MATERIAL_ID
- WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
- </select>
- <!--通过销售订单物资ID查找物资理重和物资件数-->
- <select id="selectTheoreticalWeightAndMaterialNumber" resultType="java.util.Map" parameterType="java.lang.Integer">
- SELECT ASTM.SALE_ORDER_MATERIAL_NUMBER "materialNumber",
- ASTM.MATERIAL_THEORETICAL_WEIGHT "weight"
- from AMS_SALE_ORDER_MATERIAL ASOM
- LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
- ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- WHERE ASTM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
- </select>
- <!--销售,查看运输订单(钢材销售订单)并根据司机接受或者拒绝时间进行排序 -->
- <select id="selectTransportOrderForSale" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- from(
- select
- OO.ORDER_NUMBER "orderNumber",
- ASO.SALE_NUMBER "saleNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialweight",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RC2.CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- ASOM.SALE_DATE_OF_RECEIPT "saleDateOfReceipt",
- OO.ORDER_RECEIVE_REFUSE_TIME "orderReceiveRefuseTime",
- RS.SHIPPER_NAME "shipperName"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID=OOM.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ASOM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
- LEFT JOIN AMS_SALE_ORDER ASO
- ON ASO.SALE_ORDER_ID=ASOM.SALE_ORDER_ID
- LEFT JOIN RMS_CONSIGNEE RC2
- ON RC2.CONSIGNEE_ID=ASO.RECEIVE_ID
- LEFT JOIN RMS_DRIVER_CAPACITY RDC
- ON RDC.DRIVER_CAPACITY_ID=OO.DRIVER_CAPACITY_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RDC.CAPACITY_ID=RC.CAPACITY_ID
- LEFT JOIN RMS_MATERIAL RM
- ON OOM.MATERIAL_ID=RM.MATERIAL_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID=ASO.SHIPPER_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID=ASOM.SALE_SHIPPING_ADDRESS_ID
- <where>
- <if test="orderStatus!=null">
- AND OO.ORDER_STATUS = #{orderStatus}
- </if>
- <if test="carrierId!=null">
- and RDC.CARRIER_ID = #{carrierId}
- </if>
- <if test="orderType!=null">
- and OO.ORDER_TYPE=#{orderType}
- </if>
- </where>
- )
- <where>
- <if test="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="saleNumber != null">
- and
- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
- "saleNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialName != null">
- and
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialweight != null">
- and
- <foreach collection="orderMaterialweight" item="item" open="(" separator="or" close=")">
- "orderMaterialweight" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialweight != null">
- and
- <foreach collection="orderMaterialweight" item="item" open="(" separator="or" close=")">
- "orderMaterialweight" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- <if test="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy">
- </include>
- <if test="orderField == null ">
- order by "orderReceiveRefuseTime" desc
- </if>
- </select>
- <!--根据车序号查找销售订单 -->
- <select id="selectSaleBySaleOrderMaterialId" parameterType="java.lang.Integer" resultType="java.util.Map">
- SELECT
- ASO.SALE_NUMBER "saleNumber",
- RS.SHIPPER_NAME "shipperName",
- RC.CONSIGNEE_COMPANY_NAME "consigneeName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "truckNo",
- ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
- ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
- ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
- ASOM.INSERT_UPDATE_REMARK "insertUpdateRemark",
- ASOM.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId",
- (
- SELECT
- ASTM.SALE_ORDER_MATERIAL_NUMBER
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "saleOrderMaterialNumber",
- (
- SELECT
- ASTM.MATERIAL_THEORETICAL_WEIGHT
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialTheoreticalWeight",
- (
- SELECT
- RM.MATERIAL_NAME "materialName"
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialName",
- (
- SELECT
- ASTM.MATERIAL_ID "materialId"
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialId"
- FROM
- AMS_SALE_ORDER_MATERIAL ASOM
- LEFT JOIN AMS_SALE_ORDER ASO ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID = RRA.ADDRESS_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID=#{saleOrderMaterialId}
- <include refid="orderBy"></include>
- </select>
- <!-- 根据承运商查找销售订单 -->
- <select id="selectSaleMaterialIdByCarrierId" resultType="java.util.Map" parameterType="java.lang.Integer">
- select ADSO.SALE_ORDER_MATERIAL_ID "saleOrderMaterialId"
- from AMS_DISPATCH_SALE_ORDER ADSO
- where ADSO.CARRIER_ID = #{carrierId}
- </select>
- <!-- 查询所有下发的销售订单,根据下发状态进行筛选-->
- <select id="selectSaleNumberForCarrier" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT ASO.SALE_NUMBER "saleNumber",
- RC.CONSIGNEE_COMPANY_NAME "companyName",
- RS.SHIPPER_NAME "shipperName"
- FROM AMS_SALE_ORDER ASO
- LEFT JOIN RMS_CONSIGNEE RC
- ON ASO.RECEIVE_ID = RC.CONSIGNEE_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = ASO.SHIPPER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
- WHERE ASOM.SALE_ORDER_MATERIAL_ID = #{saleMaterialId}
- </select>
- <!-- 查询所有已接收的焦炭发运计划 -->
- <select id="selectCokeDayPlanAndRecived" resultType="java.util.Map" parameterType="java.lang.Integer">
- select * from (
- select
- ARD.DAYPLAN_ID "dayPlanId",
- ARD.DAYPLAN_NO "No",
- RS.SHIPPER_NAME "shipperName",
- ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
- ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
- ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
- ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
- ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
- RM.MATERIAL_NAME "materialName",
- ARD.INSERT_UPDATE_REMARK "remark",
- ARD.INSERT_TIME "insertTime"
- FROM AMSTRUCK_RAIL_DAYPLAN ARD
- left join RMS_SHIPPER RS
- on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID=ARD.MATERIAL_ID
- left Join RMS_MATERIAL_TYPE RMT
- on RMT.MATERIAL_TYPE_ID=RM.MATERIAL_TYPE_ID
- where ARD.DAYPLAN_RECEIVE_STATUS=1 and ARD.CARRIER_ID=#{carrierId}
- )
- <!-- <where>-->
- <!-- <if test="shipperName != null">-->
- <!-- and-->
- <!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
- <!-- "shipperName" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="TruckNumber != null">-->
- <!-- and-->
- <!-- <foreach collection="TruckNumber" item="item" open="(" separator="or" close=")">-->
- <!-- "TruckNumber" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="DayPlanDeliveryPlace != null">-->
- <!-- and-->
- <!-- <foreach collection="DayPlanDeliveryPlace" item="item" open="(" separator="or" close=")">-->
- <!-- "DayPlanDeliveryPlace" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- <if test="receiveUnit != null">-->
- <!-- and-->
- <!-- <foreach collection="receiveUnit" item="item" open="(" separator="or" close=")">-->
- <!-- "receiveUnit" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="materialName != null">-->
- <!-- and-->
- <!-- <foreach collection="materialName" item="item" open="(" separator="or" close=")">-->
- <!-- "materialName" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="remark != null">-->
- <!-- and-->
- <!-- <foreach collection="remark" item="item" open="(" separator="or" close=")">-->
- <!-- "remark" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- </if>-->
- <!--</where>-->
- <!-- <include refid="orderBy">-->
- <!-- </include>-->
- <!-- <if test="orderField == null ">-->
- <!-- order by "insertTime" desc-->
- <!-- </if>-->
- </select>
- <!--查询所有已接收的水渣发运计划-->
- <select id="selectWaterSlagDayPlanAndRecived" resultType="java.util.Map" parameterType="java.lang.Integer">
- SELECT *
- FROM (
- SELECT
- ARD.DAYPLAN_ID "dayPlanId",
- ARD.DAYPLAN_NO "No",
- RS.SHIPPER_NAME "shipperName",
- ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
- ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
- ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
- RM.MATERIAL_NAME "materialName",
- ARD.INSERT_UPDATE_REMARK "remark",
- ARD.INSERT_TIME "insertTime"
- FROM AMSTRUCK_RAIL_DAYPLAN ARD
- LEFT JOIN RMS_SHIPPER RS
- ON ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID=ARD.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL_TYPE RMT
- ON RMT.MATERIAL_TYPE_ID=RM.MATERIAL_TYPE_ID
- where ARD.DAYPLAN_RECEIVE_STATUS=1 AND ARD.CARRIER_ID=#{carrierId}
- )
- <!--<where>-->
- <!-- <if test="shipperName != null">-->
- <!-- and-->
- <!-- <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
- <!-- "shipperName" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="DayPlanDeliveryPlace != null">-->
- <!-- and-->
- <!-- <foreach collection="DayPlanDeliveryPlace" item="item" open="(" separator="or" close=")">-->
- <!-- "DayPlanDeliveryPlace" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- <if test="receiveUnit != null">-->
- <!-- and-->
- <!-- <foreach collection="receiveUnit" item="item" open="(" separator="or" close=")">-->
- <!-- "receiveUnit" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="materialName != null">-->
- <!-- and-->
- <!-- <foreach collection="materialName" item="item" open="(" separator="or" close=")">-->
- <!-- "materialName" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- <if test="remark != null">-->
- <!-- and-->
- <!-- <foreach collection="remark" item="item" open="(" separator="or" close=")">-->
- <!-- "remark" like '%${item}%'-->
- <!-- </foreach>-->
- <!-- </if>-->
- <!-- </if>-->
- <!--</where>-->
- <include refid="orderBy"></include>
- </select>
- <!--根据发运计划id查找物资id -->
- <select id="selectMaterialIdAndWeightByDayPlanId" resultType="java.util.Map" parameterType="java.lang.Integer">
- select APM.MATERIAL_ID "materialId",
- APM.DAYPLAN_MATERIAL_WEIGHT "materialWeight"
- from AMSTRUCK_RAIL_DAYPLAN APM
- WHERE APM.DAYPLAN_ID = #{dayPlanId}
- </select>
- <!--查询根据销售订单生成的运输订单 -->
- <select id="selectAllOrderForSale" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
- SELECT
- ASO.SALE_NUMBER "saleNumber",
- RS.SHIPPER_NAME "shipperName",
- RC.CONSIGNEE_COMPANY_NAME "consigneeName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "truckNo",
- ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
- ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
- ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
- ASOM.INSERT_UPDATE_REMARK "insertUpdateRemark",
- RC2.CAPACITY_NUMBER "capacityNumber",
- OO.ORDER_ID "orderId",
- (
- SELECT
- ASTM.SALE_ORDER_MATERIAL_NUMBER
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "saleOrderMaterialNumber",
- (
- SELECT
- ASTM.MATERIAL_THEORETICAL_WEIGHT
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialTheoreticalWeight",
- (
- SELECT
- RM.MATERIAL_NAME "materialName"
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialName",
- (
- SELECT
- ASTM.MATERIAL_ID "materialId"
- FROM
- AMS_SALE_TRUCKNO_MATERIAL ASTM
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM2 ON ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- WHERE
- ASOM.SALE_ORDER_MATERIAL_ID = ASOM2.SALE_ORDER_MATERIAL_ID
- ) "materialId"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
- LEFT JOIN AMS_SALE_ORDER ASO ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID = RRA.ADDRESS_ID
- LEFT JOIN RMS_CAPACITY RC2 ON RC2.CAPACITY_ID=OO.CAPACITY_ID
- <where>
- <if test="saleOrderMaterialId != null">
- and ASOM.SALE_ORDER_MATERIAL_ID = #{saleOrderMaterialId}
- </if>
- <if test="orderStatus!=null">
- and OO.ORDER_STATUS = #{orderStatus}
- </if>
- <if test="orderTypee != null">
- and OO.ORDER_TYPE = #{orderTypee}
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <!--销售查询已经形成水渣日计划 -->
- <select id="selectWaterSlagForOrder" resultType="java.util.Map" parameterType="java.util.Map">
- select *
- from (
- SELECT ARD.DAYPLAN_NO "No",
- RS.SHIPPER_NAME "shipperName",
- ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
- ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
- ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
- ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
- ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
- ARD.INSERT_UPDATE_REMARK "remark",
- ARD.INSERT_TIME "insertTime",
- OO.ORDER_ID "orderId",
- RM.MATERIAL_NAME "materialName"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN AMSTRUCK_RAIL_DAYPLAN ARD
- ON ARD.DAYPLAN_ID=OO.ORDER_PLAN_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID=ARD.MATERIAL_ID
- left join RMS_SHIPPER RS
- on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
- <where>
- <if test="carrierId!=null">
- and ARD.CARRIER_ID=#{carrierId}
- </if>
- <if test="dayPlanId!=null">
- and ARD.DAYPLAN_ID=#{dayPlanId}
- </if>
- <if test="orderType!=null">
- and OO.ORDER_TYPE=#{orderType}
- </if>
- <if test="orderStatus!=null">
- and OO.ORDER_STATUS=#{orderStatus}
- </if>
- <if test="materialId!=null">
- and RM.MATERIAL_ID=#{materialId}
- </if>
- </where>
- )
- <include refid="orderBy"></include>
- </select>
- <!--销售查询已经形成订单得水渣日计划-->
- <select id="selectCokeRailPlanForOrder" resultType="java.util.Map" parameterType="java.util.Map">
- select *
- from (
- SELECT ARD.DAYPLAN_NO "No",
- ARD.DAYPLAN_ID "dayPlanId",
- RS.SHIPPER_NAME "shipperName",
- ARD.DAYPLAN_TRUCK_NUMBER "TruckNumber",
- ARD.DAYPLAN_DELIVERY_PLACE "DayPlanDeliveryPlace",
- ARD.DAYPLAN_RECEIVE_UNIT "receiveUnit",
- ARD.DAYPLAN_DELIVERY_DATE "deliveryDate",
- ARD.DAYPLAN_MATERIAL_WEIGHT "weight",
- RM.MATERIAL_NAME "materialName",
- ARD.INSERT_UPDATE_REMARK "remark",
- ARD.INSERT_TIME "insertTime",
- OO.ORDER_ID "orderId"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN AMSTRUCK_RAIL_DAYPLAN ARD
- ON ARD.DAYPLAN_ID=OO.ORDER_PLAN_ID
- left join RMS_SHIPPER RS
- on ARD.SHIPMENT_UNIT_ID =RS.SHIPPER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID=ARD.MATERIAL_ID
- left join OMSTRUCK_ORDER OO
- ON OO.ORDER_PLAN_ID=ARD.DAYPLAN_ID
- <where>
- <if test="carrierId!=null">
- and ARD.CARRIER_ID=#{carrierId}
- </if>
- <if test="dayPlanId!=null">
- and ARD.DAYPLAN_ID=#{dayPlanId}
- </if>
- <if test="orderType!=null">
- and OO.ORDER_TYPE=#{orderType}
- </if>
- <if test="orderStatus!=null">
- and OO.ORDER_STATUS=#{orderStatus}
- </if>
- <if test="materialId!=null">
- and RM.MATERIAL_ID=#{materialId}
- </if>
- </where>
- )
- <include refid="orderBy"></include>
- </select>
- <!-- 根据承运商查找销售订单-->
- <select id="selectSteelSaleForCarrier" resultType="java.util.LinkedHashMap" parameterType="java.lang.Integer">
- select ASO.SALE_NUMBER "saleNumber",
- RS.SHIPPER_NAME "shipperName",
- RC.CONSIGNEE_COMPANY_NAME "consigneeName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDeliveryAddress",
- ASOM.SALE_DATE_OF_RECEIPT "receiptOfdate",
- ASOM.SALE_ORDER_CONSIGNEE "saleOrderConsignee",
- ASOM.SALE_ORDER_CONSIGNEE_TEL "saleOrderConsigneeTel",
- RC2.CARRIER_NAME "carrierName",
- ASO.SALE_ORDER_ID "saleOderId"
- from AMS_SALE_ORDER ASO
- left join AMS_SALE_ORDER_MATERIAL ASOM
- on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
- LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
- ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_PLAN_ID = ASTM.SALE_ORDER_MATERIAL_ID
- left join RMS_DRIVER_CAPACITY RDC
- on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- LEFT JOIN RMS_SHIPPER RS ON ASO.SHIPPER_ID = RS.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON ASOM.SALE_SHIPPING_ADDRESS_ID = RRA.ADDRESS_ID
- left join RMS_CARRIER RC2 ON RC2.CARRIER_ID = RDC.CARRIER_ID
- WHERE RDC.CARRIER_ID = #{carrierId}
- and OO.ORDER_TYPE = 1
- AND OO.ORDER_STATUS = 4
- </select>
- <select id="selectInfoBySaleOrderId" resultType="java.util.Map" parameterType="java.lang.Integer">
- select OO.ORDER_NUMBER "orderNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RM.MATERIAL_THEORETICAL_WEIGHT "orderTheoreticalWeight",
- ASOM.SALE_ORDER_MATERIAL_TRUCK_NO "saleOrderMaterialTruckNo",
- OO.INSERT_UPDATE_REMARK "remark",
- RC.CAPACITY_NUMBER "capacityNumber"
- from AMS_SALE_ORDER ASO
- left join AMS_SALE_ORDER_MATERIAL ASOM
- on asom.SALE_ORDER_ID = ASO.SALE_ORDER_ID
- left join OMSTRUCK_ORDER OO
- ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID = OO.ORDER_ID
- LEFT JOIN RMS_DRIVER_CAPACITY RDC
- ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = RDC.CAPACITY_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- WHERE ASO.SALE_ORDER_ID = #{saleOrderId}
- and OO.ORDER_TYPE = 1
- AND OO.ORDER_STATUS = 4
- </select>
- <!--根据承运商查找发运计划-->
- <select id="selectCokeRailPlan" resultType="java.util.Map" parameterType="java.util.Map">
- select ARD.DAYPLAN_NO "dayPlanNo",
- ARD.DAYPLAN_DELIVERY_DATE "dayPlanDeliverydate",
- ARD.DAYPLAN_TRUCK_NUMBER "dayTruckNumber",
- ARD.DAYPLAN_DELIVERY_PLACE "dayPlanDeliveryPlace",
- ARD.DAYPLAN_RECEIVE_UNIT "dayPlanReceiveUnit",
- RS.SHIPPER_NAME "shipperName",
- ARD.DAYPLAN_ID "dayPlanId"
- from AMSTRUCK_RAIL_DAYPLAN ARD
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = ARD.SHIPMENT_UNIT_ID
- LEFT JOIN RMS_DRIVER_CAPACITY RDC
- ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- WHERE RDC.CARRIER_ID = #{carrierId}
- and OO.ORDER_TYPE = #{orderType}
- AND OO.ORDER_STATUS = 4
- </select>
- <!-- 根据发运计划id查找信息 -->
- <select id="selectInfoByDayPlanId" parameterType="java.lang.Integer" resultType="java.util.Map">
- select OO.ORDER_NUMBER "orderNumber",
- RM.MATERIAL_NAME "materialName",
- ARD.DAYPLAN_MATERIAL_WEIGHT "materialWeight",
- RC.CAPACITY_NUMBER "capacityNumber",
- OO.INSERT_UPDATE_REMARK "remark"
- from AMSTRUCK_RAIL_DAYPLAN ARD
- left join OMSTRUCK_ORDER OO
- ON OO.ORDER_PLAN_ID = ARD.DAYPLAN_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = ARD.MATERIAL_ID
- LEFT JOIN RMS_DRIVER_CAPACITY RDC
- ON RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_TYPE = #{orderType}
- and ARD.DAYPLAN_ID = #{dayPlanId}
- AND OO.ORDER_STATUS = 4
- </select>
- <select id="getOrderUnReceive" resultType="java.util.Map"></select>
- <!-- 车牌号下拉 -->
- <select id="getDriverCapacity" resultType="java.util.Map">
- SELECT RCA.CAPACITY_NUMBER AS "label",
- RDC.DRIVER_CAPACITY_ID AS "value"
- FROM RMS_DRIVER_CAPACITY RDC
- LEFT JOIN RMS_CAPACITY RCA
- ON RDC.CAPACITY_ID = RCA.CAPACITY_ID
- WHERE RCA.CAPACITY_STATUS = 0
- </select>
- <!-- 派单信息 -->
- <select id="getTruckNoDispatchMap" parameterType="DECIMAL" resultType="java.util.Map">
- SELECT ADSO.DISPATCH_ID AS "dispatchId",
- ASOM.SALE_ORDER_MATERIAL_TRUCK_NO AS "saleOrderMaterialTruckNo",
- ASO.SALE_NUMBER AS "saleNumber",
- ADSO.DISPATCH_DEAL_TIME AS "dispatchDealTime",
- RSH.SHIPPER_NAME AS "shipperName",
- RC.CONSIGNEE_COMPANY_NAME AS "consigneeCompanyName",
- RRA.ADDRESS_DELIVERY_ADDRESS AS "addressDeliveryAddress",
- ASOM.SALE_ORDER_CONSIGNEE AS "saleOrderConsignee",
- ASOM.SALE_ORDER_CONSIGNEE_TEL AS "saleOrderConsigneeTel",
- RCA.CARRIER_NAME AS "carrierName"
- FROM AMS_DISPATCH_SALE_ORDER ADSO
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER ASO
- ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER RSH
- ON RSH.SHIPPER_ID = ASO.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE RC
- ON RC.CONSIGNEE_ID = ASO.RECEIVE_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON ASOM.SALE_SHIPPING_ADDRESS_ID = RRA.ADDRESS_ID
- LEFT JOIN RMS_CARRIER RCA
- ON RCA.CARRIER_ID = ADSO.CARRIER_ID
- WHERE ADSO.DISPATCH_STATUS = 0
- AND ADSO.DISPATCH_ID = #{dispatchId}
- </select>
- <select id="getMaterialMessages" parameterType="DECIMAL" resultType="java.util.Map">
- SELECT RM.MATERIAL_NAME AS "materialName",
- RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL AS "specificationModel",
- ASTM.MATERIAL_THEORETICAL_WEIGHT AS "materialTheoreticalWeight",
- ASTM.SALE_ORDER_MATERIAL_NUMBER AS "saleOrderMaterialNumber",
- ASTM.MATERIAL_ID AS "materialId"
- FROM AMS_DISPATCH_SALE_ORDER ADSO
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
- ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = ASTM.MATERIAL_ID
- WHERE ADSO.DISPATCH_ID = #{dispatchId}
- </select>
- <!--得到销售订单与物资中间表id-->
- <select id="getSaleMaterialId" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT ASOM.SALE_ORDER_MATERIAL_ID AS "saleOrderMaterialId"
- FROM AMS_DISPATCH_SALE_ORDER ADSO
- LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
- ON ADSO.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
- WHERE ADSO.DISPATCH_ID = #{dispatchId}
- </select>
- <select id="getCapacityId" parameterType="DECIMAL" resultType="DECIMAL">
- SELECT *
- FROM (SELECT RDC.CAPACITY_ID AS "capacityId"
- FROM RMS_DRIVER_CAPACITY RDC
- WHERE RDC.DRIVER_CAPACITY_ID = #{driverCapacityId}
- ORDER BY RDC.INSERT_TIME)
- WHERE ROWNUM = 1
- </select>
- </mapper>
|