12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801 |
- <?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.TmstruckWeightResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
- <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
- <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
- <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
- <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
- <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
- <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
- <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="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
- <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
- <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
- <result column="ISQUALITY" jdbcType="DECIMAL" property="isquality" />
- <result column="GROSS_SEGMENT_SQE" jdbcType="DECIMAL" property="grossSegmentSqe" />
- <result column="TARE_SEGMENT_SQE" jdbcType="DECIMAL" property="tareSegmentSqe" />
- </resultMap>
- <sql id="columns">
- WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME,
- RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
- TARE_SEGMENT_SQE
- </sql>
- <sql id="columns_alias">
- t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
- t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
- t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
- t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID,
- t.ISDEDUCT, t.ISQUALITY, t.GROSS_SEGMENT_SQE, t.TARE_SEGMENT_SQE
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM TMSTRUCK_WEIGHT_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM TMSTRUCK_WEIGHT_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- and RESULT_POUND_NO = #{resultPoundNo}
- </if>
- <if test="resultGrossWeight != null">
- and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
- </if>
- <if test="resultTareWeight != null">
- and RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
- </if>
- <if test="resultNetWeight != null">
- and RESULT_NET_WEIGHT = #{resultNetWeight}
- </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="deleteName != null and deleteName != ''">
- and DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultGrossPlaceId != null">
- and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- and ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- and TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
- </if>
- <if test="resultGrossWeight != null">
- and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
- </if>
- <if test="resultTareWeight != null">
- and RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
- </if>
- <if test="resultNetWeight != null">
- and RESULT_NET_WEIGHT = #{resultNetWeight}
- </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="deleteName != null and deleteName != ''">
- and DELETE_NAME LIKE '%${deleteName}%'
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultGrossPlaceId != null">
- and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- and ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- and TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from TMSTRUCK_WEIGHT_RESULT
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_WEIGHT_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- or RESULT_POUND_NO = #{resultPoundNo}
- </if>
- <if test="resultGrossWeight != null">
- or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
- </if>
- <if test="resultTareWeight != null">
- or RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
- </if>
- <if test="resultNetWeight != null">
- or RESULT_NET_WEIGHT = #{resultNetWeight}
- </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="deleteName != null and deleteName != ''">
- or DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
- </if>
- <if test="resultGrossPlaceId != null">
- or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- or ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- or ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- or GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- or TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
- RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
- RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
- RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
- ISQUALITY, GROSS_SEGMENT_SQE, TARE_SEGMENT_SQE
- )
- values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
- #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
- #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
- #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
- #{isquality,jdbcType=DECIMAL}, #{grossSegmentSqe,jdbcType=DECIMAL}, #{tareSegmentSqe,jdbcType=DECIMAL}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- insert into TMSTRUCK_WEIGHT_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="weightTaskResultId != null">
- WEIGHT_TASK_RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultPoundNo != null">
- RESULT_POUND_NO,
- </if>
- <if test="resultGrossWeight != null">
- RESULT_GROSS_WEIGHT,
- </if>
- <if test="resultGrossWeightTime != null">
- RESULT_GROSS_WEIGHT_TIME,
- </if>
- <if test="resultTareWeight != null">
- RESULT_TARE_WEIGHT,
- </if>
- <if test="resultTareWeightTime != null">
- RESULT_TARE_WEIGHT_TIME,
- </if>
- <if test="resultNetWeight != null">
- RESULT_NET_WEIGHT,
- </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="deleteName != null">
- DELETE_NAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </if>
- <if test="resultGrossPlaceId != null">
- RESULT_GROSS_PLACE_ID,
- </if>
- <if test="resultTarePlaceId != null">
- RESULT_TARE_PLACE_ID,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="isdeduct != null">
- ISDEDUCT,
- </if>
- <if test="isquality != null">
- ISQUALITY,
- </if>
- <if test="grossSegmentSqe != null">
- GROSS_SEGMENT_SQE,
- </if>
- <if test="tareSegmentSqe != null">
- TARE_SEGMENT_SQE,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="weightTaskResultId != null">
- #{weightTaskResultId,jdbcType=DECIMAL},
- </if>
- <if test="resultTotalId != null">
- #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultPoundNo != null">
- #{resultPoundNo,jdbcType=VARCHAR},
- </if>
- <if test="resultGrossWeight != null">
- #{resultGrossWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultGrossWeightTime != null">
- #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultTareWeight != null">
- #{resultTareWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultTareWeightTime != null">
- #{resultTareWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultNetWeight != null">
- #{resultNetWeight,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="deleteName != null">
- #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultGrossPlaceId != null">
- #{resultGrossPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="resultTarePlaceId != null">
- #{resultTarePlaceId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="isquality != null">
- #{isquality,jdbcType=DECIMAL},
- </if>
- <if test="grossSegmentSqe != null">
- #{grossSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="tareSegmentSqe != null">
- #{tareSegmentSqe,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- update TMSTRUCK_WEIGHT_RESULT
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
- RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
- RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
- RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
- RESULT_NET_WEIGHT = #{resultNetWeight,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},
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
- RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- ISQUALITY = #{isquality,jdbcType=DECIMAL},
- GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
- TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL}
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- update TMSTRUCK_WEIGHT_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultPoundNo != null">
- RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
- </if>
- <if test="resultGrossWeight != null">
- RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultGrossWeightTime != null">
- RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultTareWeight != null">
- RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultTareWeightTime != null">
- RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultNetWeight != null">
- RESULT_NET_WEIGHT = #{resultNetWeight,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="deleteName != null">
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultGrossPlaceId != null">
- RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="resultTarePlaceId != null">
- RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="isquality != null">
- ISQUALITY = #{isquality,jdbcType=DECIMAL},
- </if>
- <if test="grossSegmentSqe != null">
- GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="tareSegmentSqe != null">
- TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
- </if>
- </set>
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
- <include refid="select"/>
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,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 TMSTRUCK_WEIGHT_RESULT
- (WEIGHT_TASK_RESULT_ID,
- RESULT_TOTAL_ID, RESULT_POUND_NO,
- RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
- RESULT_NET_WEIGHT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
- RESULT_TARE_PLACE_ID, MATERIAL_ID,
- ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
- TARE_SEGMENT_SQE)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.weightTaskResultId,jdbcType=DECIMAL},
- #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
- #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
- #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
- #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
- #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
- #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL}, #{item.grossSegmentSqe,jdbcType=DECIMAL},
- #{item.tareSegmentSqe,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_WEIGHT_RESULT
- set
- WEIGHT_TASK_RESULT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_POUND_NO=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_GROSS_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_GROSS_WEIGHT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_TARE_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TARE_WEIGHT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_NET_WEIGHT=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_NAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_GROSS_PLACE_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TARE_PLACE_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
- </foreach>
- ,ISDEDUCT=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
- </foreach>
- ,ISQUALITY=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
- </foreach>
- ,GROSS_SEGMENT_SQE=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.grossSegmentSqe,jdbcType=DECIMAL}
- </foreach>
- ,TARE_SEGMENT_SQE=
- <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.tareSegmentSqe,jdbcType=DECIMAL}
- </foreach>
- where WEIGHT_TASK_RESULT_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.weightTaskResultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_WEIGHT_RESULT
- where WEIGHT_TASK_RESULT_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>
- <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
- <select id="selectTotalIdByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
- select
- OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee",
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber"
- from OMSTRUCK_ORDER OO
- 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
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- <if test="materialId != null">
- and TWR.MATERIAL_ID = #{materialId}
- </if>
- </select>
- <!-- 通过汽车衡编号查询对应的汽车衡ID -->
- <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
- select TRUCK_CALCULATE_ID
- from RMS_TRUCK_CALCULATE
- where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
- </select>
- <!-- 查询所有的采购计毛实绩 -->
- <select id="getCGAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- RS.SUPPLIER_NAME "supplierName",
- RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- OO.ORDER_ID "orderId",
- OO.ORDER_STATUS "orderStatus"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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
- where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" 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="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 查询所有采购的计皮实绩 -->
- <select id="getCGAllJiPiResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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 RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 通过订单Id查询订单下所有的物资理重及件数 -->
- <select id="getMaterialMes" parameterType="int" resultType="java.util.Map">
- select OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight"
- from OMSTRUCK_ORDER OO
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OO.ORDER_ID = OOM.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_MATERIAL_STEEL RMS
- on RMS.MATERIAL_ID = RM.MATERIAL_ID
- where OO.ORDER_ID = #{orderId}
- </select>
- <!--计量委托查询所需数据-->
- <!--销售查询计毛 -->
- <select id="selectMakesureGrossForSaleByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
- SELECT OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- ASO.SALE_NUMBER "saleNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
- RM.MATERIAL_NAME "materialName",
- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
- RS.SHIPPER_NAME "shipperName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_GROSS_PLACE_ID = RTC.TRUCK_CALCULATE_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and OO.ORDER_TYPE = 1
- </select>
- <!--销售物流查询计皮作业 -->
- <select id="selectMakesureTareForSaleByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
- SELECT OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- ASO.SALE_NUMBER "saleNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
- RM.MATERIAL_NAME "materialName",
- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
- RS.SHIPPER_NAME "shipperName",
- RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_TARE_PLACE_ID = RTC.TRUCK_CALCULATE_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and OO.ORDER_TYPE = 1
- </select>
- <!--内转物流查询计皮作业 -->
- <select id="selectMakesureTareForConvertedByOrderNumber" resultType="java.util.Map"
- parameterType="java.lang.String">
- SELECT OO.ORDER_NUMBER "orderNumber",
- ARP.REQUIREMENT_NUMBER "requirementNumber",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
- RL.LINE_START_NODE_DESC "startNode",
- RL.LINE_END_NODE_DESC "endNode",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
- LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC
- ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and OO.ORDER_TYPE = 11
- </select>
- <!-- 内转物流查询计毛作业 -->
- <select id="selectMakesureGrossForConvertedByOrderNumber" resultType="java.util.Map"
- parameterType="java.lang.String">
- SELECT OO.ORDER_NUMBER "orderNumber",
- ARP.REQUIREMENT_NUMBER "requirementNumber",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
- RL.LINE_START_NODE_DESC "startNode",
- RL.LINE_END_NODE_DESC "endNode",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
- LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
- LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
- LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- and OO.ORDER_TYPE = 11
- </select>
- <!-- 采购查询计皮 -->
- <select id="selectMakesureGrossForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
- SELECT OO.ORDER_NUMBER "orderNumber",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
- RS.SHIPPER_NAME "shipperName",
- RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
- RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
- RC.CAPACITY_NUMBER "capacityNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN AMS_PURCHASE_ORDER APO
- ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID = OOM.ORDER_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
- LEFT JOIN RMS_TRUCK_CALCULATE RTC
- ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS
- ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!-- 采购查询计皮 -->
- <select id="selectMakesureTareForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
- SELECT OO.ORDER_NUMBER "orderNumber",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
- OOM.ORDER_MATERIAL_NUMBER "materialNumber",
- RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
- RS.SHIPPER_NAME "shipperName",
- RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
- RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
- RC.CAPACITY_NUMBER "capacityNumber"
- FROM OMSTRUCK_ORDER OO
- LEFT JOIN AMS_PURCHASE_ORDER APO
- ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID = OOM.ORDER_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
- LEFT JOIN RMS_TRUCK_CALCULATE RTC
- ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
- LEFT JOIN RMS_RECEIVE_ADDRESS RRA
- ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
- LEFT JOIN RMS_MATERIAL_STEEL RMS
- ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!-- //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
- Map<BigDecimal, String> selectByOrderId(BigDecimal orderId);-->
- <select id="selectByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- select oo.ORDER_LINE_SEQUENCE as "orderLineSequence",
- oo.LINE_ID as "lineId",
- rm.material_type_id as "materialTypeId",
- twr.weight_task_result_id as "weightTaskResultId"
- from omstruck_order oo
- join omstruck_order_material oom on oom.order_id = oo.order_id
- left join rms_material rm on oom.material_id = rm.material_id
- left join tmstruck_total_result ttr on oo.order_id = ttr.order_id
- left join tmstruck_weight_result twr on ttr.result_total_id = twr.result_total_id
- where oo.order_id = #{orderId}
- and rownum = 1
- order by twr.weight_task_result_id desc
- </select>
- <!-- 查询销售所有计皮实绩 -->
- <select id="getXSAllJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- ASO.SALE_NUMBER "saleNumber",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_POUND_NO "resultPoundNo",
- RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RS.SHIPPER_NAME "shipperName"
- 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 TTR.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_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- -- left join RMS_MATERIAL_STEEL RMS
- -- on OOM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_SHIPPER RS
- on RS.SHIPPER_ID = ASO.SHIPPER_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
- where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 查询销售计毛实绩 -->
- <select id="getXSAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- ASO.SALE_NUMBER "saleNumber",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo",
- TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
- -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
- RS.SHIPPER_NAME "shipperName"
- 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 TTR.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_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- -- left join RMS_MATERIAL_STEEL RMS
- -- on RMS.MATERIAL_STEEL_ID = OOM.MATERIAL_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID = OOM.MATERIAL_ID
- left join RMS_SHIPPER RS
- on RS.SHIPPER_ID = ASO.SHIPPER_ID
- left join RMS_CONSIGNEE RCON
- on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
- where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
- )
- <where>
- <if test="saleNumber != null">
- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
- "saleNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" 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="consigneeCompanyName != null">
- and
- <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
- "consigneeCompanyName" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" 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="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 通过物资名称和物资规格查询物资ID -->
- <select id="getMaterialIdByMaterialNameAndSpe" parameterType="java.util.Map" resultType="java.lang.Integer">
- select RM.MATERIAL_ID
- from RMS_MATERIAL RM
- <where>
- <if test="materialName != null">
- RM.MATERIAL_NAME = #{materialName}
- </if>
- <if test="materialSpecification != null">
- and RM.MATERIAL_SPECIFICATION = #{materialSpecification}
- </if>
- <if test="materialModel != null">
- and RM.MATERIAL_MODEL = #{materialModel}
- </if>
- </where>
- </select>
- <!-- 通过物资Id和运输订单id 查询计量实绩Id -->
- <select id="getWeightIdBySQEAndOrderId" parameterType="java.util.Map" resultType="DECIMAL">
- select *
- from (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId"
- from OMSTRUCK_ORDER OO
- 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}
- and TWR.RESULT_NET_WEIGHT is null
- order by TWR.TARE_SEGMENT_SQE
- )
- where rownum = 1
- </select>
- <!-- 通过运输订单号和查询订单Id 和物资ID (针对单拼) -->
- <select id="getOrderIdAndMaterialIdByOrderNum" parameterType="string" resultType="java.util.Map">
- select OO.ORDER_ID "orderId",
- OOM.MATERIAL_ID "materialId"
- from OMSTRUCK_ORDER OO
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OOM.ORDER_ID = OO.ORDER_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <!-- 查询内转到钢材到异地库计量实绩 -->
- <select id="getSteelNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- AROD.DAYPLAN_NO "dayplanNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RS.SHIPPER_NAME "shipperName",
- RW.WAREHOUSE_NAME "warehouseName",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC
- ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_TARE_WEIGHT IS NOT NULL
- )
- <where>
- <if test="dayplanNo != null">
- <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
- "dayplanNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" 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="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" 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="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 查询内转钢材到异地库计毛实绩 -->
- <select id="getSteelNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- AROD.DAYPLAN_NO "dayplanNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- RM.MATERIAL_NAME "materialName",
- OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
- RS.SHIPPER_NAME "shipperName",
- RW.WAREHOUSE_NAME "warehouseName",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.INSERT_UPDATE_REMARK "insertUpdateRemark"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
- ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
- LEFT JOIN RMS_MATERIAL RM
- ON RM.MATERIAL_ID = OOM.MATERIAL_ID
- LEFT JOIN RMS_SHIPPER RS
- ON RS.SHIPPER_ID = AROD.SHIPPER_ID
- LEFT JOIN RMS_WAREHOUSE RW
- ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
- LEFT JOIN RMS_TRUCK_CALCULATE RTC
- ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- LEFT JOIN RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_GROSS_WEIGHT IS NOT NULL
- )
- <where>
- <if test="dayplanNo != null">
- <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
- "dayplanNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" 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="orderMaterialNumber != null">
- and
- <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
- "orderMaterialNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="materialTheoreticalWeight != null">
- and
- <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
- "materialTheoreticalWeight" 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="warehouseName != null">
- and
- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
- "warehouseName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="insertUpdateRemark != null">
- and
- <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
- "insertUpdateRemark" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 查询国产矿进口矿计毛实绩 -->
- <select id="getImportedDomesticNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- RS.SUPPLIER_NAME "supplierName",
- RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- ON DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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
- where RESULT_GROSS_WEIGHT_TIME is not null
- and OO.ORDER_TYPE = 9
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" 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="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 查询国产矿进口矿计皮实绩 -->
- <select id="getImportedDomesticNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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 RESULT_TARE_WEIGHT_TIME is not null
- and OO.ORDER_TYPE = 9
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 查询国产矿进口矿计皮实绩(老区-厂内) -->
- <select id="getImportedDomesticNzJiPi2Result" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo",
- TWR.RESULT_NET_WEIGHT "netWeight"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join amstruck_inward_plan aip
- on aip.plan_id = oo.order_plan_id
- left join amstruck_requirement_plan arp
- on arp.plan_id = aip.plan_id
- left join amstruck_inward_requirement air
- on air.requirement_id = arp.requirement_id
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = air.purchase_order_id
- left join DIL_BATCH DB
- on DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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 RESULT_TARE_WEIGHT_TIME is not null
- and OO.ORDER_TYPE in (10,20)
- <if test="userId!=null">
- AND air.INSERT_USERNAME =#{userId}
- </if>
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 查询国产矿进口矿计毛实绩(老区-厂内) -->
- <select id="getImportedDomesticNzJiMao2Result" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.PURCHASE_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- RS.SUPPLIER_NAME "supplierName",
- rsr.shipper_name "consigneeCompanyName"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMSTRUCK_INWARD_PLAN AIP
- on AIP.PLAN_ID = OO.ORDER_PLAN_ID
- left join AMSTRUCK_REQUIREMENT_PLAN ARP
- on ARP.PLAN_ID = AIP.PLAN_ID
- left join AMSTRUCK_INWARD_REQUIREMENT AIR
- on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
- left join AMS_PURCHASE_ORDER APO
- on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
- left join DIL_BATCH DB
- ON DB.BATCH_ID = APO.BATCH_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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_shipper rsr
- on rsr.shipper_id = APO.RECEIVE_UNIT_ID
- where RESULT_GROSS_WEIGHT_TIME is not null
- and OO.ORDER_TYPE in (10,20)
- <if test="userId !=null">
- AND AIR.INSERT_USERNAME = #{userId}
- </if>
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" 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="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 查询内转厂内物资计量实绩 -->
- <select id="getInFactoryJiLiangResult" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- RTC1.TRUCK_CALCULATE_NUMBER "grossCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME) "netWeightTime",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo",
- TWR.INSERT_UPDATE_REMARK "insertUpdateRemark"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- left join RMS_TRUCK_CALCULATE RTC1
- on RTC1.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_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 TWR.RESULT_NET_WEIGHT IS NOT NULL
- and OO.ORDER_TYPE = #{orderTypee}
- )
- <where>
- <if test="materialName != null">
- <foreach collection="materialName" item="item" open="(" separator="or" close=")">
- "materialName" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="netWeightTime != null">
- and
- <foreach collection="netWeightTime" item="item" open="(" separator="or" close=")">
- to_char("netWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "netWeightTime" desc
- </if>
- </select>
- <!-- 根据运输订单Id获取计毛实绩-->
- <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
- select *
- from (
- select distinct
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.RESULT_NET_WEIGHT "netWeight",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_ID "orderId",
- OO.ORDER_STATUS "orderStatus"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMSTRUCK_SPORADIC_ORDER ASO
- on ASO.SPORADIC_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_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- where RESULT_GROSS_WEIGHT_TIME is not null
- <if test="orderTypee != 100">
- AND OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderTypee == 100">
- AND OO.ORDER_TYPE in (12, 13 ,14,19)
- </if>
- <if test="userId!=null">
- and ASO.INSERT_USERNAME=#{userId}
- </if>
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 根据运输订单Id获取零星物资计皮实绩-->
- <select id="getSporadicSuppliesJiPiResult" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- APO.SPORADIC_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMSTRUCK_SPORADIC_ORDER APO
- on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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 RESULT_TARE_WEIGHT_TIME is not null
- and OO.ORDER_TYPE = 12
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 一车多趟获取计重实绩(零星物资) -->
- <select id="getFactorySkinSporadicWeight" resultType="java.util.Map">
- select *
- from (
- select distinct
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
- RM.MATERIAL_NAME "materialName",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_POUND_NO "resultPoundNo"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join AMSTRUCK_SPORADIC_ORDER ASO
- on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_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 RESULT_TARE_WEIGHT_TIME is not null
- <if test="orderTypee != 100">
- AND OO.ORDER_TYPE = #{orderTypee}
- </if>
- <if test="orderTypee == 100">
- AND OO.ORDER_TYPE in (12, 13 ,14,19)
- </if>
- <if test="userId!=null">
- and ASO.INSERT_USERNAME=#{userId}
- </if>
- <if test="userIds!=null">
- and ASO.UPDATE_USERNAME=#{userIds}
- </if>
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="orderNumber != null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
- "orderNumber" 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="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultForeignShipName != null">
- and
- <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
- "resultForeignShipName" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 根据运输订单Id获取计毛实绩-->
- <select id="getFactorySkinSporadicJiMiao" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- RM.MATERIAL_NAME "materialName"
- 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 TTR.ORDER_ID = OO.ORDER_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 AMSTRUCK_SPORADIC_ORDER ASO
- on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- where RESULT_GROSS_WEIGHT_TIME is not null and
- OO.ORDER_TYPE = 13
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 根据运输订单id获取计量实绩-->
- <select id="getFactorySporadicJiMiaoResult" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
- TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
- TWR.RESULT_NET_WEIGHT "resultNetWeight",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- RM.MATERIAL_NAME "materialName"
- 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 TTR.ORDER_ID = OO.ORDER_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 AMSTRUCK_SPORADIC_ORDER ASO
- on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
- where RESULT_GROSS_WEIGHT_TIME is not null and
- OO.ORDER_TYPE in (15,16)
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeight != null">
- and
- <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
- "resultGrossWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultNetWeight != null">
- and
- <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
- "resultNetWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultGrossWeightTime != null">
- and
- <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
- "resultGrossWeightTime" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultGrossWeightTime" desc
- </if>
- </select>
- <!-- 零星计皮 -->
- <select id="getFactorySkinSporadicJIPi" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
- OO.ORDER_NUMBER "orderNumber",
- RC.CAPACITY_NUMBER "capacityNumber",
- RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
- TWR.RESULT_POUND_NO "resultPoundNo",
- RM.MATERIAL_NAME "materialName"
- 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 TTR.ORDER_ID = OO.ORDER_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM
- on OO.ORDER_ID=OOM.ORDER_ID
- left join RMS_MATERIAL RM
- on RM.MATERIAL_ID=OOM.MATERIAL_ID
- left join AMSTRUCK_SPORADIC_ORDER ASO
- on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- left join RMS_TRUCK_CALCULATE RTC
- on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
- where RESULT_TARE_WEIGHT_TIME is not null
- and OO.ORDER_TYPE = 13
- )
- <where>
- <if test="purchaseOrderNo != null">
- <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
- "purchaseOrderNo" 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="capacityNumber != null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
- "capacityNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="truckCalculateNumber != null">
- and
- <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
- "truckCalculateNumber" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeight != null">
- and
- <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
- "resultTareWeight" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- <if test="resultTareWeightTime != null">
- and
- <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
- "resultTareWeightTime" like '%${item}%'
- </foreach>
- </if>
- <if test="resultPoundNo != null">
- and
- <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
- "resultPoundNo" like '%${item}%'
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- <if test="orderField == null ">
- order by "resultTareWeightTime" desc
- </if>
- </select>
- <!-- 通过总实绩ID查询订单类型 -->
- <select id="getOrderTypeByTotalId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
- select OO.ORDER_TYPE
- from OMSTRUCK_ORDER OO
- where OO.ORDER_ID =
- (select TTR.ORDER_ID from TMSTRUCK_TOTAL_RESULT TTR where TTR.RESULT_TOTAL_ID = #{resultTotalId})
- </select>
- </mapper>
|