TmstruckWeightResultMapper.xml 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.steerinfo.dil.mapper.TmstruckWeightResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
  5. <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
  8. <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
  9. <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
  10. <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
  11. <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
  12. <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  18. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  19. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  20. <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
  21. <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
  22. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  23. <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
  24. <result column="ISQUALITY" jdbcType="DECIMAL" property="isquality" />
  25. <result column="GROSS_SEGMENT_SQE" jdbcType="DECIMAL" property="grossSegmentSqe" />
  26. <result column="TARE_SEGMENT_SQE" jdbcType="DECIMAL" property="tareSegmentSqe" />
  27. </resultMap>
  28. <sql id="columns">
  29. WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  30. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME,
  31. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME,
  32. RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
  33. TARE_SEGMENT_SQE
  34. </sql>
  35. <sql id="columns_alias">
  36. t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
  37. t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
  38. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  39. t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID,
  40. t.ISDEDUCT, t.ISQUALITY, t.GROSS_SEGMENT_SQE, t.TARE_SEGMENT_SQE
  41. </sql>
  42. <sql id="select">
  43. SELECT <include refid="columns"/> FROM TMSTRUCK_WEIGHT_RESULT
  44. </sql>
  45. <sql id="select_alias">
  46. SELECT <include refid="columns_alias"/> FROM TMSTRUCK_WEIGHT_RESULT t
  47. </sql>
  48. <sql id="where">
  49. <where>
  50. <if test="weightTaskResultId != null">
  51. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  52. </if>
  53. <if test="resultTotalId != null">
  54. and RESULT_TOTAL_ID = #{resultTotalId}
  55. </if>
  56. <if test="resultPoundNo != null and resultPoundNo != ''">
  57. and RESULT_POUND_NO = #{resultPoundNo}
  58. </if>
  59. <if test="resultGrossWeight != null">
  60. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  61. </if>
  62. <if test="resultGrossWeightTime != null">
  63. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  64. </if>
  65. <if test="resultTareWeight != null">
  66. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  67. </if>
  68. <if test="resultTareWeightTime != null">
  69. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  70. </if>
  71. <if test="resultNetWeight != null">
  72. and RESULT_NET_WEIGHT = #{resultNetWeight}
  73. </if>
  74. <if test="insertUsername != null and insertUsername != ''">
  75. and INSERT_USERNAME = #{insertUsername}
  76. </if>
  77. <if test="insertTime != null">
  78. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  79. </if>
  80. <if test="updateUsername != null and updateUsername != ''">
  81. and UPDATE_USERNAME = #{updateUsername}
  82. </if>
  83. <if test="updateTime != null">
  84. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  85. </if>
  86. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  87. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  88. </if>
  89. <if test="deleteName != null and deleteName != ''">
  90. and DELETE_NAME = #{deleteName}
  91. </if>
  92. <if test="deleteTime != null">
  93. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  94. </if>
  95. <if test="resultGrossPlaceId != null">
  96. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  97. </if>
  98. <if test="resultTarePlaceId != null">
  99. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  100. </if>
  101. <if test="materialId != null">
  102. and MATERIAL_ID = #{materialId}
  103. </if>
  104. <if test="isdeduct != null">
  105. and ISDEDUCT = #{isdeduct}
  106. </if>
  107. <if test="isquality != null">
  108. and ISQUALITY = #{isquality}
  109. </if>
  110. <if test="grossSegmentSqe != null">
  111. and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  112. </if>
  113. <if test="tareSegmentSqe != null">
  114. and TARE_SEGMENT_SQE = #{tareSegmentSqe}
  115. </if>
  116. </where>
  117. </sql>
  118. <sql id="whereLike">
  119. <where>
  120. <if test="weightTaskResultId != null">
  121. and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
  122. </if>
  123. <if test="resultTotalId != null">
  124. and RESULT_TOTAL_ID = #{resultTotalId}
  125. </if>
  126. <if test="resultPoundNo != null and resultPoundNo != ''">
  127. and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
  128. </if>
  129. <if test="resultGrossWeight != null">
  130. and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  131. </if>
  132. <if test="resultGrossWeightTime != null">
  133. and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
  134. </if>
  135. <if test="resultTareWeight != null">
  136. and RESULT_TARE_WEIGHT = #{resultTareWeight}
  137. </if>
  138. <if test="resultTareWeightTime != null">
  139. and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
  140. </if>
  141. <if test="resultNetWeight != null">
  142. and RESULT_NET_WEIGHT = #{resultNetWeight}
  143. </if>
  144. <if test="insertUsername != null and insertUsername != ''">
  145. and INSERT_USERNAME LIKE '%${insertUsername}%'
  146. </if>
  147. <if test="insertTime != null">
  148. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  149. </if>
  150. <if test="updateUsername != null and updateUsername != ''">
  151. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  152. </if>
  153. <if test="updateTime != null">
  154. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  155. </if>
  156. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  157. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  158. </if>
  159. <if test="deleteName != null and deleteName != ''">
  160. and DELETE_NAME LIKE '%${deleteName}%'
  161. </if>
  162. <if test="deleteTime != null">
  163. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  164. </if>
  165. <if test="resultGrossPlaceId != null">
  166. and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  167. </if>
  168. <if test="resultTarePlaceId != null">
  169. and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  170. </if>
  171. <if test="materialId != null">
  172. and MATERIAL_ID = #{materialId}
  173. </if>
  174. <if test="isdeduct != null">
  175. and ISDEDUCT = #{isdeduct}
  176. </if>
  177. <if test="isquality != null">
  178. and ISQUALITY = #{isquality}
  179. </if>
  180. <if test="grossSegmentSqe != null">
  181. and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  182. </if>
  183. <if test="tareSegmentSqe != null">
  184. and TARE_SEGMENT_SQE = #{tareSegmentSqe}
  185. </if>
  186. </where>
  187. </sql>
  188. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  189. delete from TMSTRUCK_WEIGHT_RESULT
  190. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  191. </delete>
  192. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  193. delete from TMSTRUCK_WEIGHT_RESULT
  194. where 1!=1
  195. <if test="resultTotalId != null">
  196. or RESULT_TOTAL_ID = #{resultTotalId}
  197. </if>
  198. <if test="resultPoundNo != null and resultPoundNo != ''">
  199. or RESULT_POUND_NO = #{resultPoundNo}
  200. </if>
  201. <if test="resultGrossWeight != null">
  202. or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
  203. </if>
  204. <if test="resultGrossWeightTime != null">
  205. or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
  206. </if>
  207. <if test="resultTareWeight != null">
  208. or RESULT_TARE_WEIGHT = #{resultTareWeight}
  209. </if>
  210. <if test="resultTareWeightTime != null">
  211. or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
  212. </if>
  213. <if test="resultNetWeight != null">
  214. or RESULT_NET_WEIGHT = #{resultNetWeight}
  215. </if>
  216. <if test="insertUsername != null and insertUsername != ''">
  217. or INSERT_USERNAME = #{insertUsername}
  218. </if>
  219. <if test="insertTime != null">
  220. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  221. </if>
  222. <if test="updateUsername != null and updateUsername != ''">
  223. or UPDATE_USERNAME = #{updateUsername}
  224. </if>
  225. <if test="updateTime != null">
  226. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  227. </if>
  228. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  229. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  230. </if>
  231. <if test="deleteName != null and deleteName != ''">
  232. or DELETE_NAME = #{deleteName}
  233. </if>
  234. <if test="deleteTime != null">
  235. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  236. </if>
  237. <if test="resultGrossPlaceId != null">
  238. or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
  239. </if>
  240. <if test="resultTarePlaceId != null">
  241. or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
  242. </if>
  243. <if test="materialId != null">
  244. or MATERIAL_ID = #{materialId}
  245. </if>
  246. <if test="isdeduct != null">
  247. or ISDEDUCT = #{isdeduct}
  248. </if>
  249. <if test="isquality != null">
  250. or ISQUALITY = #{isquality}
  251. </if>
  252. <if test="grossSegmentSqe != null">
  253. or GROSS_SEGMENT_SQE = #{grossSegmentSqe}
  254. </if>
  255. <if test="tareSegmentSqe != null">
  256. or TARE_SEGMENT_SQE = #{tareSegmentSqe}
  257. </if>
  258. </delete>
  259. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  260. insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
  261. RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  262. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  263. RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
  264. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  265. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  266. RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
  267. ISQUALITY, GROSS_SEGMENT_SQE, TARE_SEGMENT_SQE
  268. )
  269. values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
  270. #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  271. #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
  272. #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  273. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  274. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
  275. #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
  276. #{isquality,jdbcType=DECIMAL}, #{grossSegmentSqe,jdbcType=DECIMAL}, #{tareSegmentSqe,jdbcType=DECIMAL}
  277. )
  278. </insert>
  279. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  280. insert into TMSTRUCK_WEIGHT_RESULT
  281. <trim prefix="(" suffix=")" suffixOverrides=",">
  282. <if test="weightTaskResultId != null">
  283. WEIGHT_TASK_RESULT_ID,
  284. </if>
  285. <if test="resultTotalId != null">
  286. RESULT_TOTAL_ID,
  287. </if>
  288. <if test="resultPoundNo != null">
  289. RESULT_POUND_NO,
  290. </if>
  291. <if test="resultGrossWeight != null">
  292. RESULT_GROSS_WEIGHT,
  293. </if>
  294. <if test="resultGrossWeightTime != null">
  295. RESULT_GROSS_WEIGHT_TIME,
  296. </if>
  297. <if test="resultTareWeight != null">
  298. RESULT_TARE_WEIGHT,
  299. </if>
  300. <if test="resultTareWeightTime != null">
  301. RESULT_TARE_WEIGHT_TIME,
  302. </if>
  303. <if test="resultNetWeight != null">
  304. RESULT_NET_WEIGHT,
  305. </if>
  306. <if test="insertUsername != null">
  307. INSERT_USERNAME,
  308. </if>
  309. <if test="insertTime != null">
  310. INSERT_TIME,
  311. </if>
  312. <if test="updateUsername != null">
  313. UPDATE_USERNAME,
  314. </if>
  315. <if test="updateTime != null">
  316. UPDATE_TIME,
  317. </if>
  318. <if test="insertUpdateRemark != null">
  319. INSERT_UPDATE_REMARK,
  320. </if>
  321. <if test="deleteName != null">
  322. DELETE_NAME,
  323. </if>
  324. <if test="deleteTime != null">
  325. DELETE_TIME,
  326. </if>
  327. <if test="resultGrossPlaceId != null">
  328. RESULT_GROSS_PLACE_ID,
  329. </if>
  330. <if test="resultTarePlaceId != null">
  331. RESULT_TARE_PLACE_ID,
  332. </if>
  333. <if test="materialId != null">
  334. MATERIAL_ID,
  335. </if>
  336. <if test="isdeduct != null">
  337. ISDEDUCT,
  338. </if>
  339. <if test="isquality != null">
  340. ISQUALITY,
  341. </if>
  342. <if test="grossSegmentSqe != null">
  343. GROSS_SEGMENT_SQE,
  344. </if>
  345. <if test="tareSegmentSqe != null">
  346. TARE_SEGMENT_SQE,
  347. </if>
  348. </trim>
  349. <trim prefix="values (" suffix=")" suffixOverrides=",">
  350. <if test="weightTaskResultId != null">
  351. #{weightTaskResultId,jdbcType=DECIMAL},
  352. </if>
  353. <if test="resultTotalId != null">
  354. #{resultTotalId,jdbcType=DECIMAL},
  355. </if>
  356. <if test="resultPoundNo != null">
  357. #{resultPoundNo,jdbcType=VARCHAR},
  358. </if>
  359. <if test="resultGrossWeight != null">
  360. #{resultGrossWeight,jdbcType=DECIMAL},
  361. </if>
  362. <if test="resultGrossWeightTime != null">
  363. #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  364. </if>
  365. <if test="resultTareWeight != null">
  366. #{resultTareWeight,jdbcType=DECIMAL},
  367. </if>
  368. <if test="resultTareWeightTime != null">
  369. #{resultTareWeightTime,jdbcType=TIMESTAMP},
  370. </if>
  371. <if test="resultNetWeight != null">
  372. #{resultNetWeight,jdbcType=DECIMAL},
  373. </if>
  374. <if test="insertUsername != null">
  375. #{insertUsername,jdbcType=VARCHAR},
  376. </if>
  377. <if test="insertTime != null">
  378. #{insertTime,jdbcType=TIMESTAMP},
  379. </if>
  380. <if test="updateUsername != null">
  381. #{updateUsername,jdbcType=VARCHAR},
  382. </if>
  383. <if test="updateTime != null">
  384. #{updateTime,jdbcType=TIMESTAMP},
  385. </if>
  386. <if test="insertUpdateRemark != null">
  387. #{insertUpdateRemark,jdbcType=VARCHAR},
  388. </if>
  389. <if test="deleteName != null">
  390. #{deleteName,jdbcType=VARCHAR},
  391. </if>
  392. <if test="deleteTime != null">
  393. #{deleteTime,jdbcType=TIMESTAMP},
  394. </if>
  395. <if test="resultGrossPlaceId != null">
  396. #{resultGrossPlaceId,jdbcType=DECIMAL},
  397. </if>
  398. <if test="resultTarePlaceId != null">
  399. #{resultTarePlaceId,jdbcType=DECIMAL},
  400. </if>
  401. <if test="materialId != null">
  402. #{materialId,jdbcType=DECIMAL},
  403. </if>
  404. <if test="isdeduct != null">
  405. #{isdeduct,jdbcType=DECIMAL},
  406. </if>
  407. <if test="isquality != null">
  408. #{isquality,jdbcType=DECIMAL},
  409. </if>
  410. <if test="grossSegmentSqe != null">
  411. #{grossSegmentSqe,jdbcType=DECIMAL},
  412. </if>
  413. <if test="tareSegmentSqe != null">
  414. #{tareSegmentSqe,jdbcType=DECIMAL},
  415. </if>
  416. </trim>
  417. </insert>
  418. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  419. update TMSTRUCK_WEIGHT_RESULT
  420. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  421. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  422. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  423. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  424. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  425. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  426. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  427. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  428. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  429. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  430. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  431. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  432. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  433. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  434. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  435. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  436. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  437. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  438. ISQUALITY = #{isquality,jdbcType=DECIMAL},
  439. GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
  440. TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL}
  441. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  442. </update>
  443. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
  444. update TMSTRUCK_WEIGHT_RESULT
  445. <set>
  446. <if test="resultTotalId != null">
  447. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  448. </if>
  449. <if test="resultPoundNo != null">
  450. RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
  451. </if>
  452. <if test="resultGrossWeight != null">
  453. RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
  454. </if>
  455. <if test="resultGrossWeightTime != null">
  456. RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
  457. </if>
  458. <if test="resultTareWeight != null">
  459. RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
  460. </if>
  461. <if test="resultTareWeightTime != null">
  462. RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
  463. </if>
  464. <if test="resultNetWeight != null">
  465. RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
  466. </if>
  467. <if test="insertUsername != null">
  468. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  469. </if>
  470. <if test="insertTime != null">
  471. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  472. </if>
  473. <if test="updateUsername != null">
  474. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  475. </if>
  476. <if test="updateTime != null">
  477. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  478. </if>
  479. <if test="insertUpdateRemark != null">
  480. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  481. </if>
  482. <if test="deleteName != null">
  483. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  484. </if>
  485. <if test="deleteTime != null">
  486. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  487. </if>
  488. <if test="resultGrossPlaceId != null">
  489. RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
  490. </if>
  491. <if test="resultTarePlaceId != null">
  492. RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
  493. </if>
  494. <if test="materialId != null">
  495. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  496. </if>
  497. <if test="isdeduct != null">
  498. ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
  499. </if>
  500. <if test="isquality != null">
  501. ISQUALITY = #{isquality,jdbcType=DECIMAL},
  502. </if>
  503. <if test="grossSegmentSqe != null">
  504. GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
  505. </if>
  506. <if test="tareSegmentSqe != null">
  507. TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
  508. </if>
  509. </set>
  510. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  511. </update>
  512. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  513. <include refid="select"/>
  514. where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
  515. </select>
  516. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  517. <include refid="select"/>
  518. <include refid="where"/>
  519. </select>
  520. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  521. <include refid="select"/>
  522. <include refid="whereLike"/>
  523. </select>
  524. <insert id="batchInsert" parameterType="java.util.List">
  525. insert into TMSTRUCK_WEIGHT_RESULT
  526. (WEIGHT_TASK_RESULT_ID,
  527. RESULT_TOTAL_ID, RESULT_POUND_NO,
  528. RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
  529. RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
  530. RESULT_NET_WEIGHT, INSERT_USERNAME,
  531. INSERT_TIME, UPDATE_USERNAME,
  532. UPDATE_TIME, INSERT_UPDATE_REMARK,
  533. DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
  534. RESULT_TARE_PLACE_ID, MATERIAL_ID,
  535. ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
  536. TARE_SEGMENT_SQE)
  537. ( <foreach collection="list" item="item" separator="union all">
  538. select
  539. #{item.weightTaskResultId,jdbcType=DECIMAL},
  540. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
  541. #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
  542. #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
  543. #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  544. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  545. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  546. #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
  547. #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
  548. #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL}, #{item.grossSegmentSqe,jdbcType=DECIMAL},
  549. #{item.tareSegmentSqe,jdbcType=DECIMAL} from dual
  550. </foreach> )
  551. </insert>
  552. <update id="batchUpdate" parameterType="java.util.List">
  553. update TMSTRUCK_WEIGHT_RESULT
  554. set
  555. WEIGHT_TASK_RESULT_ID=
  556. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  557. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
  558. </foreach>
  559. ,RESULT_TOTAL_ID=
  560. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  561. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  562. </foreach>
  563. ,RESULT_POUND_NO=
  564. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  565. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
  566. </foreach>
  567. ,RESULT_GROSS_WEIGHT=
  568. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  569. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
  570. </foreach>
  571. ,RESULT_GROSS_WEIGHT_TIME=
  572. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  573. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
  574. </foreach>
  575. ,RESULT_TARE_WEIGHT=
  576. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  577. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
  578. </foreach>
  579. ,RESULT_TARE_WEIGHT_TIME=
  580. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  581. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
  582. </foreach>
  583. ,RESULT_NET_WEIGHT=
  584. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  585. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
  586. </foreach>
  587. ,INSERT_USERNAME=
  588. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  589. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  590. </foreach>
  591. ,INSERT_TIME=
  592. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  593. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  594. </foreach>
  595. ,UPDATE_USERNAME=
  596. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  597. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  598. </foreach>
  599. ,UPDATE_TIME=
  600. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  601. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  602. </foreach>
  603. ,INSERT_UPDATE_REMARK=
  604. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  605. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  606. </foreach>
  607. ,DELETE_NAME=
  608. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  609. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  610. </foreach>
  611. ,DELETE_TIME=
  612. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  613. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  614. </foreach>
  615. ,RESULT_GROSS_PLACE_ID=
  616. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  617. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
  618. </foreach>
  619. ,RESULT_TARE_PLACE_ID=
  620. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  621. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
  622. </foreach>
  623. ,MATERIAL_ID=
  624. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  625. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  626. </foreach>
  627. ,ISDEDUCT=
  628. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  629. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
  630. </foreach>
  631. ,ISQUALITY=
  632. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  633. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
  634. </foreach>
  635. ,GROSS_SEGMENT_SQE=
  636. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  637. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.grossSegmentSqe,jdbcType=DECIMAL}
  638. </foreach>
  639. ,TARE_SEGMENT_SQE=
  640. <foreach collection="list" item="item" index="index" separator=" " open="case WEIGHT_TASK_RESULT_ID" close="end">
  641. when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.tareSegmentSqe,jdbcType=DECIMAL}
  642. </foreach>
  643. where WEIGHT_TASK_RESULT_ID in
  644. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  645. #{item.weightTaskResultId,jdbcType=DECIMAL}
  646. </foreach>
  647. </update>
  648. <delete id="batchDelete" parameterType="java.util.List">
  649. delete from TMSTRUCK_WEIGHT_RESULT
  650. where WEIGHT_TASK_RESULT_ID in
  651. <foreach collection="list" item="id" open="(" close=")" separator=",">
  652. #{id}
  653. </foreach>
  654. </delete>
  655. <!-- 友情提示!!!-->
  656. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  657. <!-- 进行排序 -->
  658. <sql id="orderBy">
  659. <if test="orderField != null and orderField != ''">
  660. order by "${orderField}"
  661. <if test="orderType != null and orderType != ''">
  662. ${orderType}
  663. </if>
  664. </if>
  665. </sql>
  666. <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
  667. <select id="selectTotalIdByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
  668. select
  669. OO.ORDER_ID "orderId",
  670. OO.ORDER_TYPE "orderTypee",
  671. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  672. TTR.RESULT_TOTAL_ID "resultTotalId",
  673. RC.CAPACITY_NUMBER "capacityNumber"
  674. from OMSTRUCK_ORDER OO
  675. left join TMSTRUCK_TOTAL_RESULT TTR
  676. on OO.ORDER_ID = TTR.ORDER_ID
  677. left join TMSTRUCK_WEIGHT_RESULT TWR
  678. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  679. left join RMS_CAPACITY RC
  680. on RC.CAPACITY_ID = OO.CAPACITY_ID
  681. where OO.ORDER_NUMBER = #{orderNumber}
  682. <if test="materialId != null">
  683. and TWR.MATERIAL_ID = #{materialId}
  684. </if>
  685. </select>
  686. <!-- 通过汽车衡编号查询对应的汽车衡ID -->
  687. <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
  688. select TRUCK_CALCULATE_ID
  689. from RMS_TRUCK_CALCULATE
  690. where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
  691. </select>
  692. <!-- 查询所有的采购计毛实绩 -->
  693. <select id="getCGAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  694. select *
  695. from (
  696. select
  697. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  698. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  699. RM.MATERIAL_NAME "materialName",
  700. OO.ORDER_NUMBER "orderNumber",
  701. RC.CAPACITY_NUMBER "capacityNumber",
  702. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  703. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  704. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  705. RS.SUPPLIER_NAME "supplierName",
  706. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  707. OO.ORDER_ID "orderId",
  708. OO.ORDER_STATUS "orderStatus"
  709. from TMSTRUCK_WEIGHT_RESULT TWR
  710. left join TMSTRUCK_TOTAL_RESULT TTR
  711. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  712. left join OMSTRUCK_ORDER OO
  713. on TTR.ORDER_ID = OO.ORDER_ID
  714. left join AMS_PURCHASE_ORDER APO
  715. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  716. left join RMS_CAPACITY RC
  717. on RC.CAPACITY_ID = OO.CAPACITY_ID
  718. left join RMS_TRUCK_CALCULATE RTC
  719. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  720. left join OMSTRUCK_ORDER_MATERIAL OOM
  721. on OOM.ORDER_ID = OO.ORDER_ID
  722. left join RMS_MATERIAL RM
  723. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  724. left join RMS_SUPPLIER RS
  725. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  726. left join RMS_CONSIGNEE RCON
  727. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  728. where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  729. )
  730. <where>
  731. <if test="purchaseOrderNo != null">
  732. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  733. "purchaseOrderNo" like '%${item}%'
  734. </foreach>
  735. </if>
  736. <if test="materialName != null">
  737. and
  738. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  739. "materialName" like '%${item}%'
  740. </foreach>
  741. </if>
  742. <if test="orderNumber != null">
  743. and
  744. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  745. "orderNumber" like '%${item}%'
  746. </foreach>
  747. </if>
  748. <if test="capacityNumber != null">
  749. and
  750. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  751. "capacityNumber" like '%${item}%'
  752. </foreach>
  753. </if>
  754. <if test="truckCalculateNumber != null">
  755. and
  756. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  757. "truckCalculateNumber" like '%${item}%'
  758. </foreach>
  759. </if>
  760. <if test="resultGrossWeight != null">
  761. and
  762. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  763. "resultGrossWeight" like '%${item}%'
  764. </foreach>
  765. </if>
  766. <if test="supplierName != null">
  767. and
  768. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  769. "supplierName" like '%${item}%'
  770. </foreach>
  771. </if>
  772. <if test="resultGrossWeightTime != null">
  773. and
  774. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  775. "resultGrossWeightTime" like '%${item}%'
  776. </foreach>
  777. </if>
  778. </where>
  779. <include refid="orderBy"></include>
  780. <if test="orderField == null ">
  781. order by "resultGrossWeightTime" desc
  782. </if>
  783. </select>
  784. <!-- 查询所有采购的计皮实绩 -->
  785. <select id="getCGAllJiPiResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  786. select *
  787. from (
  788. select
  789. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  790. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  791. RM.MATERIAL_NAME "materialName",
  792. OO.ORDER_NUMBER "orderNumber",
  793. RC.CAPACITY_NUMBER "capacityNumber",
  794. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  795. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  796. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  797. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  798. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  799. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  800. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  801. TWR.RESULT_POUND_NO "resultPoundNo"
  802. from TMSTRUCK_WEIGHT_RESULT TWR
  803. left join TMSTRUCK_TOTAL_RESULT TTR
  804. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  805. left join OMSTRUCK_ORDER OO
  806. on TTR.ORDER_ID = OO.ORDER_ID
  807. left join AMS_PURCHASE_ORDER APO
  808. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  809. left join DIL_BATCH DB
  810. on DB.BATCH_ID = APO.BATCH_ID
  811. left join RMS_CAPACITY RC
  812. on RC.CAPACITY_ID = OO.CAPACITY_ID
  813. left join RMS_TRUCK_CALCULATE RTC
  814. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  815. left join OMSTRUCK_ORDER_MATERIAL OOM
  816. on OOM.ORDER_ID = OO.ORDER_ID
  817. left join RMS_MATERIAL RM
  818. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  819. where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  820. )
  821. <where>
  822. <if test="purchaseOrderNo != null">
  823. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  824. "purchaseOrderNo" like '%${item}%'
  825. </foreach>
  826. </if>
  827. <if test="materialName != null">
  828. and
  829. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  830. "materialName" like '%${item}%'
  831. </foreach>
  832. </if>
  833. <if test="orderNumber != null">
  834. and
  835. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  836. "orderNumber" like '%${item}%'
  837. </foreach>
  838. </if>
  839. <if test="capacityNumber != null">
  840. and
  841. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  842. "capacityNumber" like '%${item}%'
  843. </foreach>
  844. </if>
  845. <if test="truckCalculateNumber != null">
  846. and
  847. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  848. "truckCalculateNumber" like '%${item}%'
  849. </foreach>
  850. </if>
  851. <if test="resultGrossWeight != null">
  852. and
  853. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  854. "resultGrossWeight" like '%${item}%'
  855. </foreach>
  856. </if>
  857. <if test="resultForeignShipName != null">
  858. and
  859. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  860. "resultForeignShipName" like '%${item}%'
  861. </foreach>
  862. </if>
  863. <if test="resultGrossWeightTime != null">
  864. and
  865. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  866. "resultGrossWeightTime" like '%${item}%'
  867. </foreach>
  868. </if>
  869. <if test="resultTareWeight != null">
  870. and
  871. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  872. "resultTareWeight" like '%${item}%'
  873. </foreach>
  874. </if>
  875. <if test="resultPoundNo != null">
  876. and
  877. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  878. "resultPoundNo" like '%${item}%'
  879. </foreach>
  880. </if>
  881. <if test="resultTareWeightTime != null">
  882. and
  883. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  884. "resultTareWeightTime" like '%${item}%'
  885. </foreach>
  886. </if>
  887. <if test="resultNetWeight != null">
  888. and
  889. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  890. "resultNetWeight" like '%${item}%'
  891. </foreach>
  892. </if>
  893. </where>
  894. <include refid="orderBy"></include>
  895. <if test="orderField == null ">
  896. order by "resultTareWeightTime" desc
  897. </if>
  898. </select>
  899. <!-- 通过订单Id查询订单下所有的物资理重及件数 -->
  900. <select id="getMaterialMes" parameterType="int" resultType="java.util.Map">
  901. select OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  902. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight"
  903. from OMSTRUCK_ORDER OO
  904. left join OMSTRUCK_ORDER_MATERIAL OOM
  905. on OO.ORDER_ID = OOM.ORDER_ID
  906. left join RMS_MATERIAL RM
  907. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  908. left join RMS_MATERIAL_STEEL RMS
  909. on RMS.MATERIAL_ID = RM.MATERIAL_ID
  910. where OO.ORDER_ID = #{orderId}
  911. </select>
  912. <!--计量委托查询所需数据-->
  913. <!--销售查询计毛 -->
  914. <select id="selectMakesureGrossForSaleByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
  915. SELECT OO.ORDER_NUMBER "orderNumber",
  916. RC.CAPACITY_NUMBER "capacityNumber",
  917. ASO.SALE_NUMBER "saleNumber",
  918. RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
  919. RM.MATERIAL_NAME "materialName",
  920. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
  921. RS.SHIPPER_NAME "shipperName",
  922. RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
  923. FROM OMSTRUCK_ORDER OO
  924. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  925. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  926. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  927. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  928. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_GROSS_PLACE_ID = RTC.TRUCK_CALCULATE_ID
  929. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  930. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  931. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  932. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  933. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
  934. WHERE OO.ORDER_NUMBER = #{orderNumber}
  935. and OO.ORDER_TYPE = 1
  936. </select>
  937. <!--销售物流查询计皮作业 -->
  938. <select id="selectMakesureTareForSaleByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
  939. SELECT OO.ORDER_NUMBER "orderNumber",
  940. RC.CAPACITY_NUMBER "capacityNumber",
  941. ASO.SALE_NUMBER "saleNumber",
  942. RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
  943. RM.MATERIAL_NAME "materialName",
  944. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
  945. RS.SHIPPER_NAME "shipperName",
  946. RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
  947. FROM OMSTRUCK_ORDER OO
  948. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  949. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  950. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  951. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  952. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_TARE_PLACE_ID = RTC.TRUCK_CALCULATE_ID
  953. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  954. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  955. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  956. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  957. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
  958. WHERE OO.ORDER_NUMBER = #{orderNumber}
  959. and OO.ORDER_TYPE = 1
  960. </select>
  961. <!--内转物流查询计皮作业 -->
  962. <select id="selectMakesureTareForConvertedByOrderNumber" resultType="java.util.Map"
  963. parameterType="java.lang.String">
  964. SELECT OO.ORDER_NUMBER "orderNumber",
  965. ARP.REQUIREMENT_NUMBER "requirementNumber",
  966. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  967. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  968. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  969. RL.LINE_START_NODE_DESC "startNode",
  970. RL.LINE_END_NODE_DESC "endNode",
  971. RC.CAPACITY_NUMBER "capacityNumber",
  972. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
  973. FROM OMSTRUCK_ORDER OO
  974. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  975. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
  976. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  977. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  978. LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
  979. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  980. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  981. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  982. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  983. WHERE OO.ORDER_NUMBER = #{orderNumber}
  984. and OO.ORDER_TYPE = 11
  985. </select>
  986. <!-- 内转物流查询计毛作业 -->
  987. <select id="selectMakesureGrossForConvertedByOrderNumber" resultType="java.util.Map"
  988. parameterType="java.lang.String">
  989. SELECT OO.ORDER_NUMBER "orderNumber",
  990. ARP.REQUIREMENT_NUMBER "requirementNumber",
  991. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  992. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  993. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  994. RL.LINE_START_NODE_DESC "startNode",
  995. RL.LINE_END_NODE_DESC "endNode",
  996. RC.CAPACITY_NUMBER "capacityNumber",
  997. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
  998. FROM OMSTRUCK_ORDER OO
  999. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  1000. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
  1001. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  1002. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  1003. LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
  1004. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  1005. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1006. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1007. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1008. and OO.ORDER_TYPE = 11
  1009. </select>
  1010. <!-- 采购查询计皮 -->
  1011. <select id="selectMakesureGrossForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
  1012. SELECT OO.ORDER_NUMBER "orderNumber",
  1013. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1014. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1015. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1016. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
  1017. RS.SHIPPER_NAME "shipperName",
  1018. RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
  1019. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  1020. RC.CAPACITY_NUMBER "capacityNumber"
  1021. FROM OMSTRUCK_ORDER OO
  1022. LEFT JOIN AMS_PURCHASE_ORDER APO
  1023. ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  1024. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1025. ON OO.ORDER_ID = OOM.ORDER_ID
  1026. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1027. ON OO.ORDER_ID = TTR.ORDER_ID
  1028. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  1029. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1030. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1031. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1032. LEFT JOIN RMS_SHIPPER RS
  1033. ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
  1034. LEFT JOIN RMS_RECEIVE_ADDRESS RRA
  1035. ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
  1036. LEFT JOIN RMS_MATERIAL_STEEL RMS
  1037. ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
  1038. LEFT JOIN RMS_CAPACITY RC
  1039. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1040. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1041. </select>
  1042. <!-- 采购查询计皮 -->
  1043. <select id="selectMakesureTareForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
  1044. SELECT OO.ORDER_NUMBER "orderNumber",
  1045. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1046. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1047. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1048. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
  1049. RS.SHIPPER_NAME "shipperName",
  1050. RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
  1051. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  1052. RC.CAPACITY_NUMBER "capacityNumber"
  1053. FROM OMSTRUCK_ORDER OO
  1054. LEFT JOIN AMS_PURCHASE_ORDER APO
  1055. ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  1056. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1057. ON OO.ORDER_ID = OOM.ORDER_ID
  1058. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1059. ON OO.ORDER_ID = TTR.ORDER_ID
  1060. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  1061. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1062. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1063. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1064. LEFT JOIN RMS_SHIPPER RS
  1065. ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
  1066. LEFT JOIN RMS_RECEIVE_ADDRESS RRA
  1067. ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
  1068. LEFT JOIN RMS_MATERIAL_STEEL RMS
  1069. ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
  1070. LEFT JOIN RMS_CAPACITY RC
  1071. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1072. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1073. </select>
  1074. <!-- //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
  1075. Map<BigDecimal, String> selectByOrderId(BigDecimal orderId);-->
  1076. <select id="selectByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  1077. select oo.ORDER_LINE_SEQUENCE as "orderLineSequence",
  1078. oo.LINE_ID as "lineId",
  1079. rm.material_type_id as "materialTypeId",
  1080. twr.weight_task_result_id as "weightTaskResultId"
  1081. from omstruck_order oo
  1082. join omstruck_order_material oom on oom.order_id = oo.order_id
  1083. left join rms_material rm on oom.material_id = rm.material_id
  1084. left join tmstruck_total_result ttr on oo.order_id = ttr.order_id
  1085. left join tmstruck_weight_result twr on ttr.result_total_id = twr.result_total_id
  1086. where oo.order_id = #{orderId}
  1087. and rownum = 1
  1088. order by twr.weight_task_result_id desc
  1089. </select>
  1090. <!-- 查询销售所有计皮实绩 -->
  1091. <select id="getXSAllJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1092. select *
  1093. from (
  1094. select
  1095. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1096. ASO.SALE_NUMBER "saleNumber",
  1097. RM.MATERIAL_NAME "materialName",
  1098. OO.ORDER_NUMBER "orderNumber",
  1099. RC.CAPACITY_NUMBER "capacityNumber",
  1100. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1101. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1102. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1103. -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1104. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1105. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1106. TWR.RESULT_POUND_NO "resultPoundNo",
  1107. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  1108. RS.SHIPPER_NAME "shipperName"
  1109. from TMSTRUCK_WEIGHT_RESULT TWR
  1110. left join TMSTRUCK_TOTAL_RESULT TTR
  1111. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1112. left join OMSTRUCK_ORDER OO
  1113. on TTR.ORDER_ID = OO.ORDER_ID
  1114. left join AMS_SALE_ORDER_MATERIAL ASOM
  1115. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1116. left join AMS_SALE_ORDER ASO
  1117. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1118. left join RMS_CAPACITY RC
  1119. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1120. left join RMS_TRUCK_CALCULATE RTC
  1121. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1122. left join OMSTRUCK_ORDER_MATERIAL OOM
  1123. on OOM.ORDER_ID = OO.ORDER_ID
  1124. -- left join RMS_MATERIAL_STEEL RMS
  1125. -- on OOM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
  1126. left join RMS_MATERIAL RM
  1127. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1128. left join RMS_SHIPPER RS
  1129. on RS.SHIPPER_ID = ASO.SHIPPER_ID
  1130. left join RMS_CONSIGNEE RCON
  1131. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  1132. where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
  1133. )
  1134. <where>
  1135. <if test="purchaseOrderNo != null">
  1136. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1137. "purchaseOrderNo" like '%${item}%'
  1138. </foreach>
  1139. </if>
  1140. <if test="materialName != null">
  1141. and
  1142. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1143. "materialName" like '%${item}%'
  1144. </foreach>
  1145. </if>
  1146. <if test="orderNumber != null">
  1147. and
  1148. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1149. "orderNumber" like '%${item}%'
  1150. </foreach>
  1151. </if>
  1152. <if test="capacityNumber != null">
  1153. and
  1154. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1155. "capacityNumber" like '%${item}%'
  1156. </foreach>
  1157. </if>
  1158. <if test="truckCalculateNumber != null">
  1159. and
  1160. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1161. "truckCalculateNumber" like '%${item}%'
  1162. </foreach>
  1163. </if>
  1164. <if test="resultGrossWeight != null">
  1165. and
  1166. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1167. "resultGrossWeight" like '%${item}%'
  1168. </foreach>
  1169. </if>
  1170. <if test="resultForeignShipName != null">
  1171. and
  1172. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1173. "resultForeignShipName" like '%${item}%'
  1174. </foreach>
  1175. </if>
  1176. <if test="resultGrossWeightTime != null">
  1177. and
  1178. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1179. "resultGrossWeightTime" like '%${item}%'
  1180. </foreach>
  1181. </if>
  1182. <if test="resultTareWeight != null">
  1183. and
  1184. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1185. "resultTareWeight" like '%${item}%'
  1186. </foreach>
  1187. </if>
  1188. <if test="resultPoundNo != null">
  1189. and
  1190. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1191. "resultPoundNo" like '%${item}%'
  1192. </foreach>
  1193. </if>
  1194. <if test="resultTareWeightTime != null">
  1195. and
  1196. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1197. "resultTareWeightTime" like '%${item}%'
  1198. </foreach>
  1199. </if>
  1200. <if test="resultNetWeight != null">
  1201. and
  1202. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1203. "resultNetWeight" like '%${item}%'
  1204. </foreach>
  1205. </if>
  1206. </where>
  1207. <include refid="orderBy"></include>
  1208. <if test="orderField == null ">
  1209. order by "resultTareWeightTime" desc
  1210. </if>
  1211. </select>
  1212. <!-- 查询销售计毛实绩 -->
  1213. <select id="getXSAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1214. select *
  1215. from (
  1216. select
  1217. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1218. ASO.SALE_NUMBER "saleNumber",
  1219. RM.MATERIAL_NAME "materialName",
  1220. OO.ORDER_NUMBER "orderNumber",
  1221. RC.CAPACITY_NUMBER "capacityNumber",
  1222. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1223. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1224. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1225. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1226. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1227. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1228. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1229. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1230. TWR.RESULT_POUND_NO "resultPoundNo",
  1231. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  1232. -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1233. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  1234. RS.SHIPPER_NAME "shipperName"
  1235. from TMSTRUCK_WEIGHT_RESULT TWR
  1236. left join TMSTRUCK_TOTAL_RESULT TTR
  1237. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1238. left join OMSTRUCK_ORDER OO
  1239. on TTR.ORDER_ID = OO.ORDER_ID
  1240. left join AMS_SALE_ORDER_MATERIAL ASOM
  1241. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1242. left join AMS_SALE_ORDER ASO
  1243. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1244. left join RMS_CAPACITY RC
  1245. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1246. left join RMS_TRUCK_CALCULATE RTC
  1247. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1248. left join OMSTRUCK_ORDER_MATERIAL OOM
  1249. on OOM.ORDER_ID = OO.ORDER_ID
  1250. -- left join RMS_MATERIAL_STEEL RMS
  1251. -- on RMS.MATERIAL_STEEL_ID = OOM.MATERIAL_ID
  1252. left join RMS_MATERIAL RM
  1253. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1254. left join RMS_SHIPPER RS
  1255. on RS.SHIPPER_ID = ASO.SHIPPER_ID
  1256. left join RMS_CONSIGNEE RCON
  1257. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  1258. where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
  1259. )
  1260. <where>
  1261. <if test="saleNumber != null">
  1262. <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
  1263. "saleNumber" like '%${item}%'
  1264. </foreach>
  1265. </if>
  1266. <if test="orderMaterialNumber != null">
  1267. and
  1268. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1269. "orderMaterialNumber" like '%${item}%'
  1270. </foreach>
  1271. </if>
  1272. <if test="materialTheoreticalWeight != null">
  1273. and
  1274. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1275. "materialTheoreticalWeight" like '%${item}%'
  1276. </foreach>
  1277. </if>
  1278. <if test="resultTareWeight != null">
  1279. and
  1280. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1281. "resultTareWeight" like '%${item}%'
  1282. </foreach>
  1283. </if>
  1284. <if test="resultPoundNo != null">
  1285. and
  1286. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1287. "resultPoundNo" like '%${item}%'
  1288. </foreach>
  1289. </if>
  1290. <if test="resultTareWeightTime != null">
  1291. and
  1292. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1293. "resultTareWeightTime" like '%${item}%'
  1294. </foreach>
  1295. </if>
  1296. <if test="resultNetWeight != null">
  1297. and
  1298. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1299. "resultNetWeight" like '%${item}%'
  1300. </foreach>
  1301. </if>
  1302. <if test="materialName != null">
  1303. and
  1304. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1305. "materialName" like '%${item}%'
  1306. </foreach>
  1307. </if>
  1308. <if test="consigneeCompanyName != null">
  1309. and
  1310. <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
  1311. "consigneeCompanyName" like '%${item}%'
  1312. </foreach>
  1313. </if>
  1314. <if test="orderNumber != null">
  1315. and
  1316. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1317. "orderNumber" like '%${item}%'
  1318. </foreach>
  1319. </if>
  1320. <if test="capacityNumber != null">
  1321. and
  1322. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1323. "capacityNumber" like '%${item}%'
  1324. </foreach>
  1325. </if>
  1326. <if test="truckCalculateNumber != null">
  1327. and
  1328. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1329. "truckCalculateNumber" like '%${item}%'
  1330. </foreach>
  1331. </if>
  1332. <if test="resultGrossWeight != null">
  1333. and
  1334. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1335. "resultGrossWeight" like '%${item}%'
  1336. </foreach>
  1337. </if>
  1338. <if test="shipperName != null">
  1339. and
  1340. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1341. "shipperName" like '%${item}%'
  1342. </foreach>
  1343. </if>
  1344. <if test="resultGrossWeightTime != null">
  1345. and
  1346. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1347. "resultGrossWeightTime" like '%${item}%'
  1348. </foreach>
  1349. </if>
  1350. </where>
  1351. <include refid="orderBy"></include>
  1352. <if test="orderField == null ">
  1353. order by "resultGrossWeightTime" desc
  1354. </if>
  1355. </select>
  1356. <!-- 通过物资名称和物资规格查询物资ID -->
  1357. <select id="getMaterialIdByMaterialNameAndSpe" parameterType="java.util.Map" resultType="java.lang.Integer">
  1358. select RM.MATERIAL_ID
  1359. from RMS_MATERIAL RM
  1360. <where>
  1361. <if test="materialName != null">
  1362. RM.MATERIAL_NAME = #{materialName}
  1363. </if>
  1364. <if test="materialSpecification != null">
  1365. and RM.MATERIAL_SPECIFICATION = #{materialSpecification}
  1366. </if>
  1367. <if test="materialModel != null">
  1368. and RM.MATERIAL_MODEL = #{materialModel}
  1369. </if>
  1370. </where>
  1371. </select>
  1372. <!-- 通过物资Id和运输订单id 查询计量实绩Id -->
  1373. <select id="getWeightIdBySQEAndOrderId" parameterType="java.util.Map" resultType="DECIMAL">
  1374. select *
  1375. from (
  1376. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId"
  1377. from OMSTRUCK_ORDER OO
  1378. left join TMSTRUCK_TOTAL_RESULT TTR
  1379. on OO.ORDER_ID = TTR.ORDER_ID
  1380. left join TMSTRUCK_WEIGHT_RESULT TWR
  1381. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1382. where OO.ORDER_ID = #{orderId}
  1383. and TWR.RESULT_NET_WEIGHT is null
  1384. order by TWR.TARE_SEGMENT_SQE
  1385. )
  1386. where rownum = 1
  1387. </select>
  1388. <!-- 通过运输订单号和查询订单Id 和物资ID (针对单拼) -->
  1389. <select id="getOrderIdAndMaterialIdByOrderNum" parameterType="string" resultType="java.util.Map">
  1390. select OO.ORDER_ID "orderId",
  1391. OOM.MATERIAL_ID "materialId"
  1392. from OMSTRUCK_ORDER OO
  1393. left join OMSTRUCK_ORDER_MATERIAL OOM
  1394. on OOM.ORDER_ID = OO.ORDER_ID
  1395. where OO.ORDER_NUMBER = #{orderNumber}
  1396. </select>
  1397. <!-- 查询内转到钢材到异地库计量实绩 -->
  1398. <select id="getSteelNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1399. SELECT *
  1400. FROM (
  1401. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1402. AROD.DAYPLAN_NO "dayplanNo",
  1403. OO.ORDER_NUMBER "orderNumber",
  1404. RC.CAPACITY_NUMBER "capacityNumber",
  1405. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1406. RM.MATERIAL_NAME "materialName",
  1407. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1408. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1409. RS.SHIPPER_NAME "shipperName",
  1410. RW.WAREHOUSE_NAME "warehouseName",
  1411. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1412. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime"
  1413. FROM TMSTRUCK_WEIGHT_RESULT TWR
  1414. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1415. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  1416. LEFT JOIN OMSTRUCK_ORDER OO
  1417. ON OO.ORDER_ID = TTR.ORDER_ID
  1418. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  1419. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  1420. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1421. ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
  1422. LEFT JOIN RMS_MATERIAL RM
  1423. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1424. LEFT JOIN RMS_SHIPPER RS
  1425. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  1426. LEFT JOIN RMS_WAREHOUSE RW
  1427. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  1428. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1429. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1430. LEFT JOIN RMS_CAPACITY RC
  1431. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1432. WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_TARE_WEIGHT IS NOT NULL
  1433. )
  1434. <where>
  1435. <if test="dayplanNo != null">
  1436. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  1437. "dayplanNo" like '%${item}%'
  1438. </foreach>
  1439. </if>
  1440. <if test="orderNumber != null">
  1441. and
  1442. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1443. "orderNumber" like '%${item}%'
  1444. </foreach>
  1445. </if>
  1446. <if test="capacityNumber != null">
  1447. and
  1448. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1449. "capacityNumber" like '%${item}%'
  1450. </foreach>
  1451. </if>
  1452. <if test="truckCalculateNumber != null">
  1453. and
  1454. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1455. "truckCalculateNumber" like '%${item}%'
  1456. </foreach>
  1457. </if>
  1458. <if test="materialName != null">
  1459. and
  1460. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1461. "materialName" like '%${item}%'
  1462. </foreach>
  1463. </if>
  1464. <if test="orderMaterialNumber != null">
  1465. and
  1466. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1467. "orderMaterialNumber" like '%${item}%'
  1468. </foreach>
  1469. </if>
  1470. <if test="materialTheoreticalWeight != null">
  1471. and
  1472. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1473. "materialTheoreticalWeight" like '%${item}%'
  1474. </foreach>
  1475. </if>
  1476. <if test="shipperName != null">
  1477. and
  1478. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1479. "shipperName" like '%${item}%'
  1480. </foreach>
  1481. </if>
  1482. <if test="warehouseName != null">
  1483. and
  1484. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1485. "warehouseName" like '%${item}%'
  1486. </foreach>
  1487. </if>
  1488. <if test="resultTareWeight != null">
  1489. and
  1490. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1491. "resultTareWeight" like '%${item}%'
  1492. </foreach>
  1493. </if>
  1494. <if test="resultTareWeightTime != null">
  1495. and
  1496. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1497. "resultTareWeightTime" like '%${item}%'
  1498. </foreach>
  1499. </if>
  1500. </where>
  1501. <include refid="orderBy"></include>
  1502. <if test="orderField == null ">
  1503. order by "resultTareWeightTime" desc
  1504. </if>
  1505. </select>
  1506. <!-- 查询内转钢材到异地库计毛实绩 -->
  1507. <select id="getSteelNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1508. SELECT *
  1509. FROM (
  1510. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1511. AROD.DAYPLAN_NO "dayplanNo",
  1512. OO.ORDER_NUMBER "orderNumber",
  1513. RC.CAPACITY_NUMBER "capacityNumber",
  1514. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1515. RM.MATERIAL_NAME "materialName",
  1516. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1517. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1518. RS.SHIPPER_NAME "shipperName",
  1519. RW.WAREHOUSE_NAME "warehouseName",
  1520. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1521. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1522. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  1523. FROM TMSTRUCK_WEIGHT_RESULT TWR
  1524. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1525. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  1526. LEFT JOIN OMSTRUCK_ORDER OO
  1527. ON OO.ORDER_ID = TTR.ORDER_ID
  1528. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  1529. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  1530. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1531. ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
  1532. LEFT JOIN RMS_MATERIAL RM
  1533. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1534. LEFT JOIN RMS_SHIPPER RS
  1535. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  1536. LEFT JOIN RMS_WAREHOUSE RW
  1537. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  1538. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1539. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1540. LEFT JOIN RMS_CAPACITY RC
  1541. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1542. WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_GROSS_WEIGHT IS NOT NULL
  1543. )
  1544. <where>
  1545. <if test="dayplanNo != null">
  1546. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  1547. "dayplanNo" like '%${item}%'
  1548. </foreach>
  1549. </if>
  1550. <if test="orderNumber != null">
  1551. and
  1552. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1553. "orderNumber" like '%${item}%'
  1554. </foreach>
  1555. </if>
  1556. <if test="capacityNumber != null">
  1557. and
  1558. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1559. "capacityNumber" like '%${item}%'
  1560. </foreach>
  1561. </if>
  1562. <if test="truckCalculateNumber != null">
  1563. and
  1564. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1565. "truckCalculateNumber" like '%${item}%'
  1566. </foreach>
  1567. </if>
  1568. <if test="materialName != null">
  1569. and
  1570. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1571. "materialName" like '%${item}%'
  1572. </foreach>
  1573. </if>
  1574. <if test="orderMaterialNumber != null">
  1575. and
  1576. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1577. "orderMaterialNumber" like '%${item}%'
  1578. </foreach>
  1579. </if>
  1580. <if test="materialTheoreticalWeight != null">
  1581. and
  1582. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1583. "materialTheoreticalWeight" like '%${item}%'
  1584. </foreach>
  1585. </if>
  1586. <if test="shipperName != null">
  1587. and
  1588. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1589. "shipperName" like '%${item}%'
  1590. </foreach>
  1591. </if>
  1592. <if test="warehouseName != null">
  1593. and
  1594. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1595. "warehouseName" like '%${item}%'
  1596. </foreach>
  1597. </if>
  1598. <if test="resultGrossWeight != null">
  1599. and
  1600. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1601. "resultGrossWeight" like '%${item}%'
  1602. </foreach>
  1603. </if>
  1604. <if test="resultGrossWeightTime != null">
  1605. and
  1606. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1607. "resultGrossWeightTime" like '%${item}%'
  1608. </foreach>
  1609. </if>
  1610. <if test="insertUpdateRemark != null">
  1611. and
  1612. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  1613. "insertUpdateRemark" like '%${item}%'
  1614. </foreach>
  1615. </if>
  1616. </where>
  1617. <include refid="orderBy"></include>
  1618. <if test="orderField == null ">
  1619. order by "resultGrossWeightTime" desc
  1620. </if>
  1621. </select>
  1622. <!-- 查询国产矿进口矿计毛实绩 -->
  1623. <select id="getImportedDomesticNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1624. SELECT *
  1625. FROM (
  1626. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1627. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1628. RM.MATERIAL_NAME "materialName",
  1629. OO.ORDER_NUMBER "orderNumber",
  1630. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1631. RC.CAPACITY_NUMBER "capacityNumber",
  1632. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1633. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1634. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1635. RS.SUPPLIER_NAME "supplierName",
  1636. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  1637. from TMSTRUCK_WEIGHT_RESULT TWR
  1638. left join TMSTRUCK_TOTAL_RESULT TTR
  1639. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1640. left join OMSTRUCK_ORDER OO
  1641. on TTR.ORDER_ID = OO.ORDER_ID
  1642. left join AMS_PURCHASE_ORDER APO
  1643. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1644. left join DIL_BATCH DB
  1645. ON DB.BATCH_ID = APO.BATCH_ID
  1646. left join RMS_CAPACITY RC
  1647. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1648. left join RMS_TRUCK_CALCULATE RTC
  1649. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1650. left join OMSTRUCK_ORDER_MATERIAL OOM
  1651. on OOM.ORDER_ID = OO.ORDER_ID
  1652. left join RMS_MATERIAL RM
  1653. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1654. left join RMS_SUPPLIER RS
  1655. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1656. left join RMS_CONSIGNEE RCON
  1657. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1658. where RESULT_GROSS_WEIGHT_TIME is not null
  1659. and OO.ORDER_TYPE = 9
  1660. )
  1661. <where>
  1662. <if test="purchaseOrderNo != null">
  1663. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1664. "purchaseOrderNo" like '%${item}%'
  1665. </foreach>
  1666. </if>
  1667. <if test="materialName != null">
  1668. and
  1669. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1670. "materialName" like '%${item}%'
  1671. </foreach>
  1672. </if>
  1673. <if test="orderNumber != null">
  1674. and
  1675. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1676. "orderNumber" like '%${item}%'
  1677. </foreach>
  1678. </if>
  1679. <if test="capacityNumber != null">
  1680. and
  1681. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1682. "capacityNumber" like '%${item}%'
  1683. </foreach>
  1684. </if>
  1685. <if test="truckCalculateNumber != null">
  1686. and
  1687. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1688. "truckCalculateNumber" like '%${item}%'
  1689. </foreach>
  1690. </if>
  1691. <if test="resultGrossWeight != null">
  1692. and
  1693. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1694. "resultGrossWeight" like '%${item}%'
  1695. </foreach>
  1696. </if>
  1697. <if test="supplierName != null">
  1698. and
  1699. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1700. "supplierName" like '%${item}%'
  1701. </foreach>
  1702. </if>
  1703. <if test="resultGrossWeightTime != null">
  1704. and
  1705. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1706. "resultGrossWeightTime" like '%${item}%'
  1707. </foreach>
  1708. </if>
  1709. <if test="resultForeignShipName != null">
  1710. and
  1711. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1712. "resultForeignShipName" like '%${item}%'
  1713. </foreach>
  1714. </if>
  1715. </where>
  1716. <include refid="orderBy"></include>
  1717. <if test="orderField == null ">
  1718. order by "resultGrossWeightTime" desc
  1719. </if>
  1720. </select>
  1721. <!-- 查询国产矿进口矿计皮实绩 -->
  1722. <select id="getImportedDomesticNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1723. select *
  1724. from (
  1725. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1726. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1727. RM.MATERIAL_NAME "materialName",
  1728. OO.ORDER_NUMBER "orderNumber",
  1729. RC.CAPACITY_NUMBER "capacityNumber",
  1730. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1731. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1732. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1733. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1734. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1735. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1736. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1737. TWR.RESULT_POUND_NO "resultPoundNo"
  1738. from TMSTRUCK_WEIGHT_RESULT TWR
  1739. left join TMSTRUCK_TOTAL_RESULT TTR
  1740. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1741. left join OMSTRUCK_ORDER OO
  1742. on TTR.ORDER_ID = OO.ORDER_ID
  1743. left join AMS_PURCHASE_ORDER APO
  1744. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1745. left join DIL_BATCH DB
  1746. on DB.BATCH_ID = APO.BATCH_ID
  1747. left join RMS_CAPACITY RC
  1748. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1749. left join RMS_TRUCK_CALCULATE RTC
  1750. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1751. left join OMSTRUCK_ORDER_MATERIAL OOM
  1752. on OOM.ORDER_ID = OO.ORDER_ID
  1753. left join RMS_MATERIAL RM
  1754. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1755. where RESULT_TARE_WEIGHT_TIME is not null
  1756. and OO.ORDER_TYPE = 9
  1757. )
  1758. <where>
  1759. <if test="purchaseOrderNo != null">
  1760. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1761. "purchaseOrderNo" like '%${item}%'
  1762. </foreach>
  1763. </if>
  1764. <if test="materialName != null">
  1765. and
  1766. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1767. "materialName" like '%${item}%'
  1768. </foreach>
  1769. </if>
  1770. <if test="orderNumber != null">
  1771. and
  1772. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1773. "orderNumber" like '%${item}%'
  1774. </foreach>
  1775. </if>
  1776. <if test="capacityNumber != null">
  1777. and
  1778. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1779. "capacityNumber" like '%${item}%'
  1780. </foreach>
  1781. </if>
  1782. <if test="truckCalculateNumber != null">
  1783. and
  1784. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1785. "truckCalculateNumber" like '%${item}%'
  1786. </foreach>
  1787. </if>
  1788. <if test="resultGrossWeight != null">
  1789. and
  1790. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1791. "resultGrossWeight" like '%${item}%'
  1792. </foreach>
  1793. </if>
  1794. <if test="resultForeignShipName != null">
  1795. and
  1796. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1797. "resultForeignShipName" like '%${item}%'
  1798. </foreach>
  1799. </if>
  1800. <if test="resultGrossWeightTime != null">
  1801. and
  1802. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1803. "resultGrossWeightTime" like '%${item}%'
  1804. </foreach>
  1805. </if>
  1806. <if test="resultTareWeight != null">
  1807. and
  1808. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1809. "resultTareWeight" like '%${item}%'
  1810. </foreach>
  1811. </if>
  1812. <if test="resultPoundNo != null">
  1813. and
  1814. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1815. "resultPoundNo" like '%${item}%'
  1816. </foreach>
  1817. </if>
  1818. <if test="resultTareWeightTime != null">
  1819. and
  1820. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1821. "resultTareWeightTime" like '%${item}%'
  1822. </foreach>
  1823. </if>
  1824. <if test="resultNetWeight != null">
  1825. and
  1826. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1827. "resultNetWeight" like '%${item}%'
  1828. </foreach>
  1829. </if>
  1830. </where>
  1831. <include refid="orderBy"></include>
  1832. <if test="orderField == null ">
  1833. order by "resultTareWeightTime" desc
  1834. </if>
  1835. </select>
  1836. <!-- 查询国产矿进口矿计皮实绩(老区-厂内) -->
  1837. <select id="getImportedDomesticNzJiPi2Result" parameterType="java.util.Map" resultType="java.util.Map">
  1838. select *
  1839. from (
  1840. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1841. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1842. RM.MATERIAL_NAME "materialName",
  1843. OO.ORDER_NUMBER "orderNumber",
  1844. RC.CAPACITY_NUMBER "capacityNumber",
  1845. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1846. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1847. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1848. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1849. TWR.RESULT_POUND_NO "resultPoundNo",
  1850. TWR.RESULT_NET_WEIGHT "netWeight"
  1851. from TMSTRUCK_WEIGHT_RESULT TWR
  1852. left join TMSTRUCK_TOTAL_RESULT TTR
  1853. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1854. left join OMSTRUCK_ORDER OO
  1855. on TTR.ORDER_ID = OO.ORDER_ID
  1856. left join amstruck_inward_plan aip
  1857. on aip.plan_id = oo.order_plan_id
  1858. left join amstruck_requirement_plan arp
  1859. on arp.plan_id = aip.plan_id
  1860. left join amstruck_inward_requirement air
  1861. on air.requirement_id = arp.requirement_id
  1862. left join AMS_PURCHASE_ORDER APO
  1863. on APO.PURCHASE_ORDER_ID = air.purchase_order_id
  1864. left join DIL_BATCH DB
  1865. on DB.BATCH_ID = APO.BATCH_ID
  1866. left join RMS_CAPACITY RC
  1867. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1868. left join RMS_TRUCK_CALCULATE RTC
  1869. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1870. left join OMSTRUCK_ORDER_MATERIAL OOM
  1871. on OOM.ORDER_ID = OO.ORDER_ID
  1872. left join RMS_MATERIAL RM
  1873. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1874. where RESULT_TARE_WEIGHT_TIME is not null
  1875. and OO.ORDER_TYPE in (10,20)
  1876. <if test="userId!=null">
  1877. AND air.INSERT_USERNAME =#{userId}
  1878. </if>
  1879. )
  1880. <where>
  1881. <if test="purchaseOrderNo != null">
  1882. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1883. "purchaseOrderNo" like '%${item}%'
  1884. </foreach>
  1885. </if>
  1886. <if test="materialName != null">
  1887. and
  1888. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1889. "materialName" like '%${item}%'
  1890. </foreach>
  1891. </if>
  1892. <if test="orderNumber != null">
  1893. and
  1894. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1895. "orderNumber" like '%${item}%'
  1896. </foreach>
  1897. </if>
  1898. <if test="capacityNumber != null">
  1899. and
  1900. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1901. "capacityNumber" like '%${item}%'
  1902. </foreach>
  1903. </if>
  1904. <if test="truckCalculateNumber != null">
  1905. and
  1906. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1907. "truckCalculateNumber" like '%${item}%'
  1908. </foreach>
  1909. </if>
  1910. <if test="resultTareWeight != null">
  1911. and
  1912. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1913. "resultTareWeight" like '%${item}%'
  1914. </foreach>
  1915. </if>
  1916. <if test="resultPoundNo != null">
  1917. and
  1918. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1919. "resultPoundNo" like '%${item}%'
  1920. </foreach>
  1921. </if>
  1922. <if test="resultTareWeightTime != null">
  1923. and
  1924. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1925. "resultTareWeightTime" like '%${item}%'
  1926. </foreach>
  1927. </if>
  1928. <if test="resultNetWeight != null">
  1929. and
  1930. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1931. "resultNetWeight" like '%${item}%'
  1932. </foreach>
  1933. </if>
  1934. </where>
  1935. <include refid="orderBy"></include>
  1936. <if test="orderField == null ">
  1937. order by "resultTareWeightTime" desc
  1938. </if>
  1939. </select>
  1940. <!-- 查询国产矿进口矿计毛实绩(老区-厂内) -->
  1941. <select id="getImportedDomesticNzJiMao2Result" parameterType="java.util.Map" resultType="java.util.Map">
  1942. SELECT *
  1943. FROM (
  1944. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1945. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1946. RM.MATERIAL_NAME "materialName",
  1947. OO.ORDER_NUMBER "orderNumber",
  1948. RC.CAPACITY_NUMBER "capacityNumber",
  1949. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1950. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1951. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1952. RS.SUPPLIER_NAME "supplierName",
  1953. rsr.shipper_name "consigneeCompanyName"
  1954. from TMSTRUCK_WEIGHT_RESULT TWR
  1955. left join TMSTRUCK_TOTAL_RESULT TTR
  1956. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1957. left join OMSTRUCK_ORDER OO
  1958. on TTR.ORDER_ID = OO.ORDER_ID
  1959. left join AMSTRUCK_INWARD_PLAN AIP
  1960. on AIP.PLAN_ID = OO.ORDER_PLAN_ID
  1961. left join AMSTRUCK_REQUIREMENT_PLAN ARP
  1962. on ARP.PLAN_ID = AIP.PLAN_ID
  1963. left join AMSTRUCK_INWARD_REQUIREMENT AIR
  1964. on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  1965. left join AMS_PURCHASE_ORDER APO
  1966. on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1967. left join DIL_BATCH DB
  1968. ON DB.BATCH_ID = APO.BATCH_ID
  1969. left join RMS_CAPACITY RC
  1970. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1971. left join RMS_TRUCK_CALCULATE RTC
  1972. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1973. left join OMSTRUCK_ORDER_MATERIAL OOM
  1974. on OOM.ORDER_ID = OO.ORDER_ID
  1975. left join RMS_MATERIAL RM
  1976. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1977. left join RMS_SUPPLIER RS
  1978. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1979. left join rms_shipper rsr
  1980. on rsr.shipper_id = APO.RECEIVE_UNIT_ID
  1981. where RESULT_GROSS_WEIGHT_TIME is not null
  1982. and OO.ORDER_TYPE in (10,20)
  1983. <if test="userId !=null">
  1984. AND AIR.INSERT_USERNAME = #{userId}
  1985. </if>
  1986. )
  1987. <where>
  1988. <if test="purchaseOrderNo != null">
  1989. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1990. "purchaseOrderNo" like '%${item}%'
  1991. </foreach>
  1992. </if>
  1993. <if test="materialName != null">
  1994. and
  1995. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1996. "materialName" like '%${item}%'
  1997. </foreach>
  1998. </if>
  1999. <if test="orderNumber != null">
  2000. and
  2001. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2002. "orderNumber" like '%${item}%'
  2003. </foreach>
  2004. </if>
  2005. <if test="capacityNumber != null">
  2006. and
  2007. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2008. "capacityNumber" like '%${item}%'
  2009. </foreach>
  2010. </if>
  2011. <if test="truckCalculateNumber != null">
  2012. and
  2013. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2014. "truckCalculateNumber" like '%${item}%'
  2015. </foreach>
  2016. </if>
  2017. <if test="resultGrossWeight != null">
  2018. and
  2019. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2020. "resultGrossWeight" like '%${item}%'
  2021. </foreach>
  2022. </if>
  2023. <if test="supplierName != null">
  2024. and
  2025. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  2026. "supplierName" like '%${item}%'
  2027. </foreach>
  2028. </if>
  2029. <if test="resultGrossWeightTime != null">
  2030. and
  2031. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2032. "resultGrossWeightTime" like '%${item}%'
  2033. </foreach>
  2034. </if>
  2035. <if test="resultForeignShipName != null">
  2036. and
  2037. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2038. "resultForeignShipName" like '%${item}%'
  2039. </foreach>
  2040. </if>
  2041. </where>
  2042. <include refid="orderBy"></include>
  2043. <if test="orderField == null ">
  2044. order by "resultGrossWeightTime" desc
  2045. </if>
  2046. </select>
  2047. <!-- 查询内转厂内物资计量实绩 -->
  2048. <select id="getInFactoryJiLiangResult" parameterType="java.util.Map" resultType="java.util.Map">
  2049. select *
  2050. from (
  2051. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2052. RM.MATERIAL_NAME "materialName",
  2053. OO.ORDER_NUMBER "orderNumber",
  2054. RC.CAPACITY_NUMBER "capacityNumber",
  2055. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2056. RTC1.TRUCK_CALCULATE_NUMBER "grossCalculateNumber",
  2057. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2058. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2059. GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME) "netWeightTime",
  2060. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2061. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2062. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2063. TWR.RESULT_POUND_NO "resultPoundNo",
  2064. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  2065. from TMSTRUCK_WEIGHT_RESULT TWR
  2066. left join TMSTRUCK_TOTAL_RESULT TTR
  2067. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2068. left join OMSTRUCK_ORDER OO
  2069. on TTR.ORDER_ID = OO.ORDER_ID
  2070. left join RMS_CAPACITY RC
  2071. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2072. left join RMS_TRUCK_CALCULATE RTC
  2073. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2074. left join RMS_TRUCK_CALCULATE RTC1
  2075. on RTC1.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2076. left join OMSTRUCK_ORDER_MATERIAL OOM
  2077. on OOM.ORDER_ID = OO.ORDER_ID
  2078. left join RMS_MATERIAL RM
  2079. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2080. where TWR.RESULT_NET_WEIGHT IS NOT NULL
  2081. and OO.ORDER_TYPE = #{orderTypee}
  2082. )
  2083. <where>
  2084. <if test="materialName != null">
  2085. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2086. "materialName" like '%${item}%'
  2087. </foreach>
  2088. </if>
  2089. <if test="orderNumber != null">
  2090. and
  2091. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2092. "orderNumber" like '%${item}%'
  2093. </foreach>
  2094. </if>
  2095. <if test="capacityNumber != null">
  2096. and
  2097. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2098. "capacityNumber" like '%${item}%'
  2099. </foreach>
  2100. </if>
  2101. <if test="truckCalculateNumber != null">
  2102. and
  2103. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2104. "truckCalculateNumber" like '%${item}%'
  2105. </foreach>
  2106. </if>
  2107. <if test="resultGrossWeight != null">
  2108. and
  2109. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2110. "resultGrossWeight" like '%${item}%'
  2111. </foreach>
  2112. </if>
  2113. <if test="resultGrossWeightTime != null">
  2114. and
  2115. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2116. to_char("resultGrossWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
  2117. </foreach>
  2118. </if>
  2119. <if test="resultTareWeight != null">
  2120. and
  2121. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2122. "resultTareWeight" like '%${item}%'
  2123. </foreach>
  2124. </if>
  2125. <if test="resultPoundNo != null">
  2126. and
  2127. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2128. "resultPoundNo" like '%${item}%'
  2129. </foreach>
  2130. </if>
  2131. <if test="resultTareWeightTime != null">
  2132. and
  2133. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2134. to_char("resultTareWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
  2135. </foreach>
  2136. </if>
  2137. <if test="resultNetWeight != null">
  2138. and
  2139. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2140. "resultNetWeight" like '%${item}%'
  2141. </foreach>
  2142. </if>
  2143. <if test="netWeightTime != null">
  2144. and
  2145. <foreach collection="netWeightTime" item="item" open="(" separator="or" close=")">
  2146. to_char("netWeightTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
  2147. </foreach>
  2148. </if>
  2149. </where>
  2150. <include refid="orderBy"></include>
  2151. <if test="orderField == null ">
  2152. order by "netWeightTime" desc
  2153. </if>
  2154. </select>
  2155. <!-- 根据运输订单Id获取计毛实绩-->
  2156. <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
  2157. select *
  2158. from (
  2159. select distinct
  2160. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2161. OO.ORDER_NUMBER "orderNumber",
  2162. RC.CAPACITY_NUMBER "capacityNumber",
  2163. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2164. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2165. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2166. TWR.RESULT_NET_WEIGHT "netWeight",
  2167. RM.MATERIAL_NAME "materialName",
  2168. OO.ORDER_ID "orderId",
  2169. OO.ORDER_STATUS "orderStatus"
  2170. from TMSTRUCK_WEIGHT_RESULT TWR
  2171. left join TMSTRUCK_TOTAL_RESULT TTR
  2172. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2173. left join OMSTRUCK_ORDER OO
  2174. on TTR.ORDER_ID = OO.ORDER_ID
  2175. left join AMSTRUCK_SPORADIC_ORDER ASO
  2176. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2177. left join OMSTRUCK_ORDER_MATERIAL OOM
  2178. on OOM.ORDER_ID=OO.ORDER_ID
  2179. left join RMS_MATERIAL RM
  2180. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2181. left join RMS_CAPACITY RC
  2182. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2183. left join RMS_TRUCK_CALCULATE RTC
  2184. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2185. where RESULT_GROSS_WEIGHT_TIME is not null
  2186. <if test="orderTypee != 100">
  2187. AND OO.ORDER_TYPE = #{orderTypee}
  2188. </if>
  2189. <if test="orderTypee == 100">
  2190. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  2191. </if>
  2192. <if test="userId!=null">
  2193. and ASO.INSERT_USERNAME=#{userId}
  2194. </if>
  2195. )
  2196. <where>
  2197. <if test="purchaseOrderNo != null">
  2198. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2199. "purchaseOrderNo" like '%${item}%'
  2200. </foreach>
  2201. </if>
  2202. <if test="orderNumber != null">
  2203. and
  2204. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2205. "orderNumber" like '%${item}%'
  2206. </foreach>
  2207. </if>
  2208. <if test="capacityNumber != null">
  2209. and
  2210. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2211. "capacityNumber" like '%${item}%'
  2212. </foreach>
  2213. </if>
  2214. <if test="truckCalculateNumber != null">
  2215. and
  2216. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2217. "truckCalculateNumber" like '%${item}%'
  2218. </foreach>
  2219. </if>
  2220. <if test="resultGrossWeight != null">
  2221. and
  2222. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2223. "resultGrossWeight" like '%${item}%'
  2224. </foreach>
  2225. </if>
  2226. <if test="resultGrossWeightTime != null">
  2227. and
  2228. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2229. "resultGrossWeightTime" like '%${item}%'
  2230. </foreach>
  2231. </if>
  2232. </where>
  2233. <include refid="orderBy"></include>
  2234. <if test="orderField == null ">
  2235. order by "resultGrossWeightTime" desc
  2236. </if>
  2237. </select>
  2238. <!-- 根据运输订单Id获取零星物资计皮实绩-->
  2239. <select id="getSporadicSuppliesJiPiResult" resultType="java.util.Map">
  2240. select *
  2241. from (
  2242. select
  2243. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2244. APO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2245. RM.MATERIAL_NAME "materialName",
  2246. OO.ORDER_NUMBER "orderNumber",
  2247. RC.CAPACITY_NUMBER "capacityNumber",
  2248. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2249. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2250. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2251. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2252. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2253. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2254. TWR.RESULT_POUND_NO "resultPoundNo"
  2255. from TMSTRUCK_WEIGHT_RESULT TWR
  2256. left join TMSTRUCK_TOTAL_RESULT TTR
  2257. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2258. left join OMSTRUCK_ORDER OO
  2259. on TTR.ORDER_ID = OO.ORDER_ID
  2260. left join AMSTRUCK_SPORADIC_ORDER APO
  2261. on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2262. left join RMS_CAPACITY RC
  2263. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2264. left join RMS_TRUCK_CALCULATE RTC
  2265. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2266. left join OMSTRUCK_ORDER_MATERIAL OOM
  2267. on OOM.ORDER_ID = OO.ORDER_ID
  2268. left join RMS_MATERIAL RM
  2269. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2270. where RESULT_TARE_WEIGHT_TIME is not null
  2271. and OO.ORDER_TYPE = 12
  2272. )
  2273. <where>
  2274. <if test="purchaseOrderNo != null">
  2275. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2276. "purchaseOrderNo" like '%${item}%'
  2277. </foreach>
  2278. </if>
  2279. <if test="materialName != null">
  2280. and
  2281. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2282. "materialName" like '%${item}%'
  2283. </foreach>
  2284. </if>
  2285. <if test="orderNumber != null">
  2286. and
  2287. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2288. "orderNumber" like '%${item}%'
  2289. </foreach>
  2290. </if>
  2291. <if test="capacityNumber != null">
  2292. and
  2293. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2294. "capacityNumber" like '%${item}%'
  2295. </foreach>
  2296. </if>
  2297. <if test="truckCalculateNumber != null">
  2298. and
  2299. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2300. "truckCalculateNumber" like '%${item}%'
  2301. </foreach>
  2302. </if>
  2303. <if test="resultGrossWeight != null">
  2304. and
  2305. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2306. "resultGrossWeight" like '%${item}%'
  2307. </foreach>
  2308. </if>
  2309. <if test="resultForeignShipName != null">
  2310. and
  2311. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2312. "resultForeignShipName" like '%${item}%'
  2313. </foreach>
  2314. </if>
  2315. <if test="resultGrossWeightTime != null">
  2316. and
  2317. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2318. "resultGrossWeightTime" like '%${item}%'
  2319. </foreach>
  2320. </if>
  2321. <if test="resultTareWeight != null">
  2322. and
  2323. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2324. "resultTareWeight" like '%${item}%'
  2325. </foreach>
  2326. </if>
  2327. <if test="resultPoundNo != null">
  2328. and
  2329. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2330. "resultPoundNo" like '%${item}%'
  2331. </foreach>
  2332. </if>
  2333. <if test="resultTareWeightTime != null">
  2334. and
  2335. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2336. "resultTareWeightTime" like '%${item}%'
  2337. </foreach>
  2338. </if>
  2339. <if test="resultNetWeight != null">
  2340. and
  2341. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2342. "resultNetWeight" like '%${item}%'
  2343. </foreach>
  2344. </if>
  2345. </where>
  2346. <include refid="orderBy"></include>
  2347. <if test="orderField == null ">
  2348. order by "resultTareWeightTime" desc
  2349. </if>
  2350. </select>
  2351. <!-- 一车多趟获取计重实绩(零星物资) -->
  2352. <select id="getFactorySkinSporadicWeight" resultType="java.util.Map">
  2353. select *
  2354. from (
  2355. select distinct
  2356. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2357. ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2358. RM.MATERIAL_NAME "materialName",
  2359. OO.ORDER_NUMBER "orderNumber",
  2360. RC.CAPACITY_NUMBER "capacityNumber",
  2361. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2362. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2363. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2364. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2365. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2366. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2367. TWR.RESULT_POUND_NO "resultPoundNo"
  2368. from TMSTRUCK_WEIGHT_RESULT TWR
  2369. left join TMSTRUCK_TOTAL_RESULT TTR
  2370. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2371. left join OMSTRUCK_ORDER OO
  2372. on TTR.ORDER_ID = OO.ORDER_ID
  2373. left join AMSTRUCK_SPORADIC_ORDER ASO
  2374. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2375. left join RMS_CAPACITY RC
  2376. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2377. left join RMS_TRUCK_CALCULATE RTC
  2378. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2379. left join OMSTRUCK_ORDER_MATERIAL OOM
  2380. on OOM.ORDER_ID = OO.ORDER_ID
  2381. left join RMS_MATERIAL RM
  2382. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2383. where RESULT_TARE_WEIGHT_TIME is not null
  2384. <if test="orderTypee != 100">
  2385. AND OO.ORDER_TYPE = #{orderTypee}
  2386. </if>
  2387. <if test="orderTypee == 100">
  2388. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  2389. </if>
  2390. <if test="userId!=null">
  2391. and ASO.INSERT_USERNAME=#{userId}
  2392. </if>
  2393. <if test="userIds!=null">
  2394. and ASO.UPDATE_USERNAME=#{userIds}
  2395. </if>
  2396. )
  2397. <where>
  2398. <if test="purchaseOrderNo != null">
  2399. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2400. "purchaseOrderNo" like '%${item}%'
  2401. </foreach>
  2402. </if>
  2403. <if test="materialName != null">
  2404. and
  2405. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2406. "materialName" like '%${item}%'
  2407. </foreach>
  2408. </if>
  2409. <if test="orderNumber != null">
  2410. and
  2411. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2412. "orderNumber" like '%${item}%'
  2413. </foreach>
  2414. </if>
  2415. <if test="capacityNumber != null">
  2416. and
  2417. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2418. "capacityNumber" like '%${item}%'
  2419. </foreach>
  2420. </if>
  2421. <if test="truckCalculateNumber != null">
  2422. and
  2423. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2424. "truckCalculateNumber" like '%${item}%'
  2425. </foreach>
  2426. </if>
  2427. <if test="resultGrossWeight != null">
  2428. and
  2429. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2430. "resultGrossWeight" like '%${item}%'
  2431. </foreach>
  2432. </if>
  2433. <if test="resultForeignShipName != null">
  2434. and
  2435. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2436. "resultForeignShipName" like '%${item}%'
  2437. </foreach>
  2438. </if>
  2439. <if test="resultGrossWeightTime != null">
  2440. and
  2441. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2442. "resultGrossWeightTime" like '%${item}%'
  2443. </foreach>
  2444. </if>
  2445. <if test="resultTareWeight != null">
  2446. and
  2447. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2448. "resultTareWeight" like '%${item}%'
  2449. </foreach>
  2450. </if>
  2451. <if test="resultPoundNo != null">
  2452. and
  2453. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2454. "resultPoundNo" like '%${item}%'
  2455. </foreach>
  2456. </if>
  2457. <if test="resultTareWeightTime != null">
  2458. and
  2459. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2460. "resultTareWeightTime" like '%${item}%'
  2461. </foreach>
  2462. </if>
  2463. <if test="resultNetWeight != null">
  2464. and
  2465. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2466. "resultNetWeight" like '%${item}%'
  2467. </foreach>
  2468. </if>
  2469. </where>
  2470. <include refid="orderBy"></include>
  2471. <if test="orderField == null ">
  2472. order by "resultTareWeightTime" desc
  2473. </if>
  2474. </select>
  2475. <!-- 根据运输订单Id获取计毛实绩-->
  2476. <select id="getFactorySkinSporadicJiMiao" resultType="java.util.Map">
  2477. select *
  2478. from (
  2479. select
  2480. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2481. OO.ORDER_NUMBER "orderNumber",
  2482. RC.CAPACITY_NUMBER "capacityNumber",
  2483. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2484. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2485. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2486. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2487. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2488. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2489. RM.MATERIAL_NAME "materialName"
  2490. from TMSTRUCK_WEIGHT_RESULT TWR
  2491. left join TMSTRUCK_TOTAL_RESULT TTR
  2492. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2493. left join OMSTRUCK_ORDER OO
  2494. on TTR.ORDER_ID = OO.ORDER_ID
  2495. left join OMSTRUCK_ORDER_MATERIAL OOM
  2496. on OOM.ORDER_ID=OO.ORDER_ID
  2497. left join RMS_MATERIAL RM
  2498. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2499. left join AMSTRUCK_SPORADIC_ORDER ASO
  2500. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2501. left join RMS_CAPACITY RC
  2502. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2503. left join RMS_TRUCK_CALCULATE RTC
  2504. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2505. where RESULT_GROSS_WEIGHT_TIME is not null and
  2506. OO.ORDER_TYPE = 13
  2507. )
  2508. <where>
  2509. <if test="purchaseOrderNo != null">
  2510. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2511. "purchaseOrderNo" like '%${item}%'
  2512. </foreach>
  2513. </if>
  2514. <if test="orderNumber != null">
  2515. and
  2516. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2517. "orderNumber" like '%${item}%'
  2518. </foreach>
  2519. </if>
  2520. <if test="capacityNumber != null">
  2521. and
  2522. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2523. "capacityNumber" like '%${item}%'
  2524. </foreach>
  2525. </if>
  2526. <if test="truckCalculateNumber != null">
  2527. and
  2528. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2529. "truckCalculateNumber" like '%${item}%'
  2530. </foreach>
  2531. </if>
  2532. <if test="resultGrossWeight != null">
  2533. and
  2534. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2535. "resultGrossWeight" like '%${item}%'
  2536. </foreach>
  2537. </if>
  2538. <if test="resultGrossWeightTime != null">
  2539. and
  2540. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2541. "resultGrossWeightTime" like '%${item}%'
  2542. </foreach>
  2543. </if>
  2544. <if test="resultTareWeight != null">
  2545. and
  2546. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2547. "resultTareWeight" like '%${item}%'
  2548. </foreach>
  2549. </if>
  2550. <if test="resultTareWeightTime != null">
  2551. and
  2552. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2553. "resultTareWeightTime" like '%${item}%'
  2554. </foreach>
  2555. </if>
  2556. <if test="resultNetWeight != null">
  2557. and
  2558. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2559. "resultNetWeight" like '%${item}%'
  2560. </foreach>
  2561. </if>
  2562. <if test="resultGrossWeightTime != null">
  2563. and
  2564. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2565. "resultGrossWeightTime" like '%${item}%'
  2566. </foreach>
  2567. </if>
  2568. </where>
  2569. <include refid="orderBy"></include>
  2570. <if test="orderField == null ">
  2571. order by "resultGrossWeightTime" desc
  2572. </if>
  2573. </select>
  2574. <!-- 根据运输订单id获取计量实绩-->
  2575. <select id="getFactorySporadicJiMiaoResult" resultType="java.util.Map">
  2576. select *
  2577. from (
  2578. select
  2579. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2580. OO.ORDER_NUMBER "orderNumber",
  2581. RC.CAPACITY_NUMBER "capacityNumber",
  2582. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2583. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2584. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2585. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2586. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2587. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2588. RM.MATERIAL_NAME "materialName"
  2589. from TMSTRUCK_WEIGHT_RESULT TWR
  2590. left join TMSTRUCK_TOTAL_RESULT TTR
  2591. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2592. left join OMSTRUCK_ORDER OO
  2593. on TTR.ORDER_ID = OO.ORDER_ID
  2594. left join OMSTRUCK_ORDER_MATERIAL OOM
  2595. on OOM.ORDER_ID=OO.ORDER_ID
  2596. left join RMS_MATERIAL RM
  2597. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2598. left join AMSTRUCK_SPORADIC_ORDER ASO
  2599. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2600. left join RMS_CAPACITY RC
  2601. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2602. left join RMS_TRUCK_CALCULATE RTC
  2603. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2604. where RESULT_GROSS_WEIGHT_TIME is not null and
  2605. OO.ORDER_TYPE in (15,16)
  2606. )
  2607. <where>
  2608. <if test="purchaseOrderNo != null">
  2609. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2610. "purchaseOrderNo" like '%${item}%'
  2611. </foreach>
  2612. </if>
  2613. <if test="orderNumber != null">
  2614. and
  2615. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2616. "orderNumber" like '%${item}%'
  2617. </foreach>
  2618. </if>
  2619. <if test="capacityNumber != null">
  2620. and
  2621. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2622. "capacityNumber" like '%${item}%'
  2623. </foreach>
  2624. </if>
  2625. <if test="truckCalculateNumber != null">
  2626. and
  2627. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2628. "truckCalculateNumber" like '%${item}%'
  2629. </foreach>
  2630. </if>
  2631. <if test="resultGrossWeight != null">
  2632. and
  2633. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2634. "resultGrossWeight" like '%${item}%'
  2635. </foreach>
  2636. </if>
  2637. <if test="resultGrossWeightTime != null">
  2638. and
  2639. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2640. "resultGrossWeightTime" like '%${item}%'
  2641. </foreach>
  2642. </if>
  2643. <if test="resultTareWeight != null">
  2644. and
  2645. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2646. "resultTareWeight" like '%${item}%'
  2647. </foreach>
  2648. </if>
  2649. <if test="resultTareWeightTime != null">
  2650. and
  2651. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2652. "resultTareWeightTime" like '%${item}%'
  2653. </foreach>
  2654. </if>
  2655. <if test="resultNetWeight != null">
  2656. and
  2657. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2658. "resultNetWeight" like '%${item}%'
  2659. </foreach>
  2660. </if>
  2661. <if test="resultGrossWeightTime != null">
  2662. and
  2663. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2664. "resultGrossWeightTime" like '%${item}%'
  2665. </foreach>
  2666. </if>
  2667. </where>
  2668. <include refid="orderBy"></include>
  2669. <if test="orderField == null ">
  2670. order by "resultGrossWeightTime" desc
  2671. </if>
  2672. </select>
  2673. <!-- 零星计皮 -->
  2674. <select id="getFactorySkinSporadicJIPi" parameterType="java.util.Map" resultType="java.util.Map">
  2675. select *
  2676. from (
  2677. select
  2678. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2679. ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2680. OO.ORDER_NUMBER "orderNumber",
  2681. RC.CAPACITY_NUMBER "capacityNumber",
  2682. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2683. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2684. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2685. TWR.RESULT_POUND_NO "resultPoundNo",
  2686. RM.MATERIAL_NAME "materialName"
  2687. from TMSTRUCK_WEIGHT_RESULT TWR
  2688. left join TMSTRUCK_TOTAL_RESULT TTR
  2689. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2690. left join OMSTRUCK_ORDER OO
  2691. on TTR.ORDER_ID = OO.ORDER_ID
  2692. left join OMSTRUCK_ORDER_MATERIAL OOM
  2693. on OO.ORDER_ID=OOM.ORDER_ID
  2694. left join RMS_MATERIAL RM
  2695. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2696. left join AMSTRUCK_SPORADIC_ORDER ASO
  2697. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2698. left join RMS_CAPACITY RC
  2699. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2700. left join RMS_TRUCK_CALCULATE RTC
  2701. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2702. where RESULT_TARE_WEIGHT_TIME is not null
  2703. and OO.ORDER_TYPE = 13
  2704. )
  2705. <where>
  2706. <if test="purchaseOrderNo != null">
  2707. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2708. "purchaseOrderNo" like '%${item}%'
  2709. </foreach>
  2710. </if>
  2711. <if test="orderNumber != null">
  2712. and
  2713. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2714. "orderNumber" like '%${item}%'
  2715. </foreach>
  2716. </if>
  2717. <if test="capacityNumber != null">
  2718. and
  2719. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2720. "capacityNumber" like '%${item}%'
  2721. </foreach>
  2722. </if>
  2723. <if test="truckCalculateNumber != null">
  2724. and
  2725. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2726. "truckCalculateNumber" like '%${item}%'
  2727. </foreach>
  2728. </if>
  2729. <if test="resultTareWeight != null">
  2730. and
  2731. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2732. "resultTareWeight" like '%${item}%'
  2733. </foreach>
  2734. </if>
  2735. <if test="resultPoundNo != null">
  2736. and
  2737. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2738. "resultPoundNo" like '%${item}%'
  2739. </foreach>
  2740. </if>
  2741. <if test="resultTareWeightTime != null">
  2742. and
  2743. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2744. "resultTareWeightTime" like '%${item}%'
  2745. </foreach>
  2746. </if>
  2747. <if test="resultPoundNo != null">
  2748. and
  2749. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2750. "resultPoundNo" like '%${item}%'
  2751. </foreach>
  2752. </if>
  2753. </where>
  2754. <include refid="orderBy"></include>
  2755. <if test="orderField == null ">
  2756. order by "resultTareWeightTime" desc
  2757. </if>
  2758. </select>
  2759. <!-- 通过总实绩ID查询订单类型 -->
  2760. <select id="getOrderTypeByTotalId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  2761. select OO.ORDER_TYPE
  2762. from OMSTRUCK_ORDER OO
  2763. where OO.ORDER_ID =
  2764. (select TTR.ORDER_ID from TMSTRUCK_TOTAL_RESULT TTR where TTR.RESULT_TOTAL_ID = #{resultTotalId})
  2765. </select>
  2766. </mapper>