TmstruckWeightResultMapper.xml 129 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846
  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. <if test="oneDate != null">
  730. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TWR.RESULT_GROSS_WEIGHT_TIME
  731. </if>
  732. <if test="startDate != null">
  733. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TWR.RESULT_GROSS_WEIGHT_TIME
  734. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
  735. </if>
  736. <if test="con!=null">
  737. and ((instr( RCON. CONSIGNEE_COMPANY_NAME, #{con}) > 0) or (instr(OO.ORDER_NUMBER, #{con}) > 0)
  738. or (instr( RC.CAPACITY_NUMBER, #{con}) > 0) or (instr(RM.MATERIAL_NAME , #{con}) > 0))
  739. </if>
  740. )
  741. <where>
  742. <if test="purchaseOrderNo != null">
  743. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  744. "purchaseOrderNo" like '%${item}%'
  745. </foreach>
  746. </if>
  747. <if test="materialName != null">
  748. and
  749. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  750. "materialName" like '%${item}%'
  751. </foreach>
  752. </if>
  753. <if test="orderNumber != null">
  754. and
  755. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  756. "orderNumber" like '%${item}%'
  757. </foreach>
  758. </if>
  759. <if test="capacityNumber != null">
  760. and
  761. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  762. "capacityNumber" like '%${item}%'
  763. </foreach>
  764. </if>
  765. <if test="truckCalculateNumber != null">
  766. and
  767. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  768. "truckCalculateNumber" like '%${item}%'
  769. </foreach>
  770. </if>
  771. <if test="resultGrossWeight != null">
  772. and
  773. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  774. "resultGrossWeight" like '%${item}%'
  775. </foreach>
  776. </if>
  777. <if test="supplierName != null">
  778. and
  779. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  780. "supplierName" like '%${item}%'
  781. </foreach>
  782. </if>
  783. <if test="resultGrossWeightTime != null">
  784. and
  785. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  786. "resultGrossWeightTime" like '%${item}%'
  787. </foreach>
  788. </if>
  789. </where>
  790. <include refid="orderBy"></include>
  791. <if test="orderField == null ">
  792. order by "resultGrossWeightTime" desc
  793. </if>
  794. </select>
  795. <!-- 查询所有采购的计皮实绩 -->
  796. <select id="getCGAllJiPiResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  797. select *
  798. from (
  799. select
  800. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  801. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  802. RM.MATERIAL_NAME "materialName",
  803. OO.ORDER_NUMBER "orderNumber",
  804. RC.CAPACITY_NUMBER "capacityNumber",
  805. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  806. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  807. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  808. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  809. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  810. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  811. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  812. TWR.RESULT_POUND_NO "resultPoundNo"
  813. from TMSTRUCK_WEIGHT_RESULT TWR
  814. left join TMSTRUCK_TOTAL_RESULT TTR
  815. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  816. left join OMSTRUCK_ORDER OO
  817. on TTR.ORDER_ID = OO.ORDER_ID
  818. left join AMS_PURCHASE_ORDER APO
  819. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  820. left join DIL_BATCH DB
  821. on DB.BATCH_ID = APO.BATCH_ID
  822. left join RMS_CAPACITY RC
  823. on RC.CAPACITY_ID = OO.CAPACITY_ID
  824. left join RMS_TRUCK_CALCULATE RTC
  825. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  826. left join OMSTRUCK_ORDER_MATERIAL OOM
  827. on OOM.ORDER_ID = OO.ORDER_ID
  828. left join RMS_MATERIAL RM
  829. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  830. where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  831. <if test="oneDate != null">
  832. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TWR.RESULT_TARE_WEIGHT_TIME
  833. </if>
  834. <if test="startDate != null">
  835. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt; = TWR.RESULT_TARE_WEIGHT_TIME
  836. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_TARE_WEIGHT_TIME
  837. </if>
  838. <if test="con!=null">
  839. and ((instr(DB.RESULT_FOREIGN_SHIP_NAME, #{con}) > 0) or (instr(OO.ORDER_NUMBER, #{con}) > 0)
  840. or (instr( RC.CAPACITY_NUMBER, #{con}) > 0) or (instr(RM.MATERIAL_NAME , #{con}) > 0))
  841. </if>
  842. )
  843. <where>
  844. <if test="purchaseOrderNo != null">
  845. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  846. "purchaseOrderNo" like '%${item}%'
  847. </foreach>
  848. </if>
  849. <if test="materialName != null">
  850. and
  851. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  852. "materialName" like '%${item}%'
  853. </foreach>
  854. </if>
  855. <if test="orderNumber != null">
  856. and
  857. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  858. "orderNumber" like '%${item}%'
  859. </foreach>
  860. </if>
  861. <if test="capacityNumber != null">
  862. and
  863. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  864. "capacityNumber" like '%${item}%'
  865. </foreach>
  866. </if>
  867. <if test="truckCalculateNumber != null">
  868. and
  869. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  870. "truckCalculateNumber" like '%${item}%'
  871. </foreach>
  872. </if>
  873. <if test="resultGrossWeight != null">
  874. and
  875. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  876. "resultGrossWeight" like '%${item}%'
  877. </foreach>
  878. </if>
  879. <if test="resultForeignShipName != null">
  880. and
  881. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  882. "resultForeignShipName" like '%${item}%'
  883. </foreach>
  884. </if>
  885. <if test="resultGrossWeightTime != null">
  886. and
  887. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  888. "resultGrossWeightTime" like '%${item}%'
  889. </foreach>
  890. </if>
  891. <if test="resultTareWeight != null">
  892. and
  893. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  894. "resultTareWeight" like '%${item}%'
  895. </foreach>
  896. </if>
  897. <if test="resultPoundNo != null">
  898. and
  899. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  900. "resultPoundNo" like '%${item}%'
  901. </foreach>
  902. </if>
  903. <if test="resultTareWeightTime != null">
  904. and
  905. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  906. "resultTareWeightTime" like '%${item}%'
  907. </foreach>
  908. </if>
  909. <if test="resultNetWeight != null">
  910. and
  911. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  912. "resultNetWeight" like '%${item}%'
  913. </foreach>
  914. </if>
  915. </where>
  916. <include refid="orderBy"></include>
  917. <if test="orderField == null ">
  918. order by "resultTareWeightTime" desc
  919. </if>
  920. </select>
  921. <!-- 通过订单Id查询订单下所有的物资理重及件数 -->
  922. <select id="getMaterialMes" parameterType="int" resultType="java.util.Map">
  923. select OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  924. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight"
  925. from OMSTRUCK_ORDER OO
  926. left join OMSTRUCK_ORDER_MATERIAL OOM
  927. on OO.ORDER_ID = OOM.ORDER_ID
  928. left join RMS_MATERIAL RM
  929. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  930. left join RMS_MATERIAL_STEEL RMS
  931. on RMS.MATERIAL_ID = RM.MATERIAL_ID
  932. where OO.ORDER_ID = #{orderId}
  933. </select>
  934. <!--计量委托查询所需数据-->
  935. <!--销售查询计毛 -->
  936. <select id="selectMakesureGrossForSaleByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
  937. SELECT OO.ORDER_NUMBER "orderNumber",
  938. RC.CAPACITY_NUMBER "capacityNumber",
  939. ASO.SALE_NUMBER "saleNumber",
  940. RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
  941. RM.MATERIAL_NAME "materialName",
  942. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
  943. RS.SHIPPER_NAME "shipperName",
  944. RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
  945. FROM OMSTRUCK_ORDER OO
  946. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  947. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  948. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  949. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  950. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_GROSS_PLACE_ID = RTC.TRUCK_CALCULATE_ID
  951. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  952. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  953. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  954. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  955. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
  956. WHERE OO.ORDER_NUMBER = #{orderNumber}
  957. and OO.ORDER_TYPE = 1
  958. </select>
  959. <!--销售物流查询计皮作业 -->
  960. <select id="selectMakesureTareForSaleByOrderNumber" resultType="java.util.Map" parameterType="java.lang.String">
  961. SELECT OO.ORDER_NUMBER "orderNumber",
  962. RC.CAPACITY_NUMBER "capacityNumber",
  963. ASO.SALE_NUMBER "saleNumber",
  964. RTC.TRUCK_CALCULATE_NUMBER "calcuateNumber",
  965. RM.MATERIAL_NAME "materialName",
  966. RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoretialWeight",
  967. RS.SHIPPER_NAME "shipperName",
  968. RRA.ADDRESS_DELIVERY_ADDRESS "addressDelivery"
  969. FROM OMSTRUCK_ORDER OO
  970. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  971. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  972. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  973. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  974. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON TWR.RESULT_TARE_PLACE_ID = RTC.TRUCK_CALCULATE_ID
  975. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  976. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  977. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  978. LEFT JOIN RMS_SHIPPER RS ON RS.SHIPPER_ID = ASO.SHIPPER_ID
  979. LEFT JOIN RMS_RECEIVE_ADDRESS RRA ON RRA.ADDRESS_ID = ASO.RECEIVE_ID
  980. WHERE OO.ORDER_NUMBER = #{orderNumber}
  981. and OO.ORDER_TYPE = 1
  982. </select>
  983. <!--内转物流查询计皮作业 -->
  984. <select id="selectMakesureTareForConvertedByOrderNumber" resultType="java.util.Map"
  985. parameterType="java.lang.String">
  986. SELECT OO.ORDER_NUMBER "orderNumber",
  987. ARP.REQUIREMENT_NUMBER "requirementNumber",
  988. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  989. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  990. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  991. RL.LINE_START_NODE_DESC "startNode",
  992. RL.LINE_END_NODE_DESC "endNode",
  993. RC.CAPACITY_NUMBER "capacityNumber",
  994. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
  995. FROM OMSTRUCK_ORDER OO
  996. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  997. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
  998. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  999. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  1000. LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
  1001. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  1002. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1003. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1004. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1005. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1006. and OO.ORDER_TYPE = 11
  1007. </select>
  1008. <!-- 内转物流查询计毛作业 -->
  1009. <select id="selectMakesureGrossForConvertedByOrderNumber" resultType="java.util.Map"
  1010. parameterType="java.lang.String">
  1011. SELECT OO.ORDER_NUMBER "orderNumber",
  1012. ARP.REQUIREMENT_NUMBER "requirementNumber",
  1013. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1014. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1015. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  1016. RL.LINE_START_NODE_DESC "startNode",
  1017. RL.LINE_END_NODE_DESC "endNode",
  1018. RC.CAPACITY_NUMBER "capacityNumber",
  1019. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber"
  1020. FROM OMSTRUCK_ORDER OO
  1021. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  1022. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT ARP ON ARP.REQUIREMENT_ID = OO.ORDER_PLAN_ID
  1023. LEFT JOIN RMS_CAPACITY RC ON OO.CAPACITY_ID = RC.CAPACITY_ID
  1024. LEFT JOIN RMS_MATERIAL_STEEL RMS ON OOM.MATERIAL_ID = RMS.MATERIAL_ID
  1025. LEFT JOIN RMS_LINE RL ON ARP.LINE_ID = RL.LINE_ID
  1026. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.ORDER_ID = OO.ORDER_ID
  1027. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1028. LEFT JOIN RMS_TRUCK_CALCULATE RTC ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1029. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1030. and OO.ORDER_TYPE = 11
  1031. </select>
  1032. <!-- 采购查询计皮 -->
  1033. <select id="selectMakesureGrossForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
  1034. SELECT OO.ORDER_NUMBER "orderNumber",
  1035. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1036. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1037. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1038. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
  1039. RS.SHIPPER_NAME "shipperName",
  1040. RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
  1041. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  1042. RC.CAPACITY_NUMBER "capacityNumber"
  1043. FROM OMSTRUCK_ORDER OO
  1044. LEFT JOIN AMS_PURCHASE_ORDER APO
  1045. ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  1046. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1047. ON OO.ORDER_ID = OOM.ORDER_ID
  1048. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1049. ON OO.ORDER_ID = TTR.ORDER_ID
  1050. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  1051. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1052. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1053. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1054. LEFT JOIN RMS_SHIPPER RS
  1055. ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
  1056. LEFT JOIN RMS_RECEIVE_ADDRESS RRA
  1057. ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
  1058. LEFT JOIN RMS_MATERIAL_STEEL RMS
  1059. ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
  1060. LEFT JOIN RMS_CAPACITY RC
  1061. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1062. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1063. </select>
  1064. <!-- 采购查询计皮 -->
  1065. <select id="selectMakesureTareForPurchase" parameterType="java.lang.String" resultType="java.util.Map">
  1066. SELECT OO.ORDER_NUMBER "orderNumber",
  1067. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1068. OOM.ORDER_MATERIAL_WEIGHT "materialWeight",
  1069. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1070. RTC.TRUCK_CALCULATE_NUMBER "calculateNumber",
  1071. RS.SHIPPER_NAME "shipperName",
  1072. RRA.ADDRESS_DELIVERY_ADDRESS "deliveryAdress",
  1073. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  1074. RC.CAPACITY_NUMBER "capacityNumber"
  1075. FROM OMSTRUCK_ORDER OO
  1076. LEFT JOIN AMS_PURCHASE_ORDER APO
  1077. ON OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  1078. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1079. ON OO.ORDER_ID = OOM.ORDER_ID
  1080. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1081. ON OO.ORDER_ID = TTR.ORDER_ID
  1082. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  1083. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1084. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1085. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1086. LEFT JOIN RMS_SHIPPER RS
  1087. ON RS.SHIPPER_ID = APO.SUPPLIER_UNIT_ID
  1088. LEFT JOIN RMS_RECEIVE_ADDRESS RRA
  1089. ON RRA.ADDRESS_ID = APO.RECEIVE_UNIT_ID
  1090. LEFT JOIN RMS_MATERIAL_STEEL RMS
  1091. ON RMS.MATERIAL_ID = OOM.MATERIAL_ID
  1092. LEFT JOIN RMS_CAPACITY RC
  1093. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1094. WHERE OO.ORDER_NUMBER = #{orderNumber}
  1095. </select>
  1096. <!-- //通过运输订单id获取路段顺序号、物资类型、计量实绩主键、line_id
  1097. Map<BigDecimal, String> selectByOrderId(BigDecimal orderId);-->
  1098. <select id="selectByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  1099. select oo.ORDER_LINE_SEQUENCE as "orderLineSequence",
  1100. oo.LINE_ID as "lineId",
  1101. rm.material_type_id as "materialTypeId",
  1102. twr.weight_task_result_id as "weightTaskResultId"
  1103. from omstruck_order oo
  1104. join omstruck_order_material oom on oom.order_id = oo.order_id
  1105. left join rms_material rm on oom.material_id = rm.material_id
  1106. left join tmstruck_total_result ttr on oo.order_id = ttr.order_id
  1107. left join tmstruck_weight_result twr on ttr.result_total_id = twr.result_total_id
  1108. where oo.order_id = #{orderId}
  1109. and rownum = 1
  1110. order by twr.weight_task_result_id desc
  1111. </select>
  1112. <!-- 查询销售所有计皮实绩 -->
  1113. <select id="getXSAllJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1114. select *
  1115. from (
  1116. select
  1117. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1118. ASO.SALE_NUMBER "saleNumber",
  1119. RM.MATERIAL_NAME "materialName",
  1120. OO.ORDER_NUMBER "orderNumber",
  1121. RC.CAPACITY_NUMBER "capacityNumber",
  1122. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1123. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1124. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1125. -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1126. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1127. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1128. TWR.RESULT_POUND_NO "resultPoundNo",
  1129. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  1130. RS.SHIPPER_NAME "shipperName"
  1131. from TMSTRUCK_WEIGHT_RESULT TWR
  1132. left join TMSTRUCK_TOTAL_RESULT TTR
  1133. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1134. left join OMSTRUCK_ORDER OO
  1135. on TTR.ORDER_ID = OO.ORDER_ID
  1136. left join AMS_SALE_ORDER_MATERIAL ASOM
  1137. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1138. left join AMS_SALE_ORDER ASO
  1139. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1140. left join RMS_CAPACITY RC
  1141. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1142. left join RMS_TRUCK_CALCULATE RTC
  1143. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1144. left join OMSTRUCK_ORDER_MATERIAL OOM
  1145. on OOM.ORDER_ID = OO.ORDER_ID
  1146. -- left join RMS_MATERIAL_STEEL RMS
  1147. -- on OOM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
  1148. left join RMS_MATERIAL RM
  1149. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1150. left join RMS_SHIPPER RS
  1151. on RS.SHIPPER_ID = ASO.SHIPPER_ID
  1152. left join RMS_CONSIGNEE RCON
  1153. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  1154. where RESULT_TARE_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
  1155. )
  1156. <where>
  1157. <if test="purchaseOrderNo != null">
  1158. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1159. "purchaseOrderNo" like '%${item}%'
  1160. </foreach>
  1161. </if>
  1162. <if test="materialName != null">
  1163. and
  1164. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1165. "materialName" like '%${item}%'
  1166. </foreach>
  1167. </if>
  1168. <if test="orderNumber != null">
  1169. and
  1170. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1171. "orderNumber" like '%${item}%'
  1172. </foreach>
  1173. </if>
  1174. <if test="capacityNumber != null">
  1175. and
  1176. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1177. "capacityNumber" like '%${item}%'
  1178. </foreach>
  1179. </if>
  1180. <if test="truckCalculateNumber != null">
  1181. and
  1182. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1183. "truckCalculateNumber" like '%${item}%'
  1184. </foreach>
  1185. </if>
  1186. <if test="resultGrossWeight != null">
  1187. and
  1188. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1189. "resultGrossWeight" like '%${item}%'
  1190. </foreach>
  1191. </if>
  1192. <if test="resultForeignShipName != null">
  1193. and
  1194. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1195. "resultForeignShipName" like '%${item}%'
  1196. </foreach>
  1197. </if>
  1198. <if test="resultGrossWeightTime != null">
  1199. and
  1200. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1201. "resultGrossWeightTime" like '%${item}%'
  1202. </foreach>
  1203. </if>
  1204. <if test="resultTareWeight != null">
  1205. and
  1206. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1207. "resultTareWeight" like '%${item}%'
  1208. </foreach>
  1209. </if>
  1210. <if test="resultPoundNo != null">
  1211. and
  1212. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1213. "resultPoundNo" like '%${item}%'
  1214. </foreach>
  1215. </if>
  1216. <if test="resultTareWeightTime != null">
  1217. and
  1218. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1219. "resultTareWeightTime" like '%${item}%'
  1220. </foreach>
  1221. </if>
  1222. <if test="resultNetWeight != null">
  1223. and
  1224. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1225. "resultNetWeight" like '%${item}%'
  1226. </foreach>
  1227. </if>
  1228. </where>
  1229. <include refid="orderBy"></include>
  1230. <if test="orderField == null ">
  1231. order by "resultTareWeightTime" desc
  1232. </if>
  1233. </select>
  1234. <!-- 查询销售计毛实绩 -->
  1235. <select id="getXSAllJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1236. select *
  1237. from (
  1238. select
  1239. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1240. ASO.SALE_NUMBER "saleNumber",
  1241. RM.MATERIAL_NAME "materialName",
  1242. OO.ORDER_NUMBER "orderNumber",
  1243. RC.CAPACITY_NUMBER "capacityNumber",
  1244. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1245. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1246. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1247. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1248. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1249. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1250. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1251. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1252. TWR.RESULT_POUND_NO "resultPoundNo",
  1253. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  1254. -- RMS.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1255. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  1256. RS.SHIPPER_NAME "shipperName"
  1257. from TMSTRUCK_WEIGHT_RESULT TWR
  1258. left join TMSTRUCK_TOTAL_RESULT TTR
  1259. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1260. left join OMSTRUCK_ORDER OO
  1261. on TTR.ORDER_ID = OO.ORDER_ID
  1262. left join AMS_SALE_ORDER_MATERIAL ASOM
  1263. on ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1264. left join AMS_SALE_ORDER ASO
  1265. on ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  1266. left join RMS_CAPACITY RC
  1267. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1268. left join RMS_TRUCK_CALCULATE RTC
  1269. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1270. left join OMSTRUCK_ORDER_MATERIAL OOM
  1271. on OOM.ORDER_ID = OO.ORDER_ID
  1272. -- left join RMS_MATERIAL_STEEL RMS
  1273. -- on RMS.MATERIAL_STEEL_ID = OOM.MATERIAL_ID
  1274. left join RMS_MATERIAL RM
  1275. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1276. left join RMS_SHIPPER RS
  1277. on RS.SHIPPER_ID = ASO.SHIPPER_ID
  1278. left join RMS_CONSIGNEE RCON
  1279. on RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  1280. where RESULT_GROSS_WEIGHT_TIME is not null and OO.ORDER_TYPE in (1, 2)
  1281. )
  1282. <where>
  1283. <if test="saleNumber != null">
  1284. <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
  1285. "saleNumber" like '%${item}%'
  1286. </foreach>
  1287. </if>
  1288. <if test="orderMaterialNumber != null">
  1289. and
  1290. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1291. "orderMaterialNumber" like '%${item}%'
  1292. </foreach>
  1293. </if>
  1294. <if test="materialTheoreticalWeight != null">
  1295. and
  1296. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1297. "materialTheoreticalWeight" like '%${item}%'
  1298. </foreach>
  1299. </if>
  1300. <if test="resultTareWeight != null">
  1301. and
  1302. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1303. "resultTareWeight" like '%${item}%'
  1304. </foreach>
  1305. </if>
  1306. <if test="resultPoundNo != null">
  1307. and
  1308. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1309. "resultPoundNo" like '%${item}%'
  1310. </foreach>
  1311. </if>
  1312. <if test="resultTareWeightTime != null">
  1313. and
  1314. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1315. "resultTareWeightTime" like '%${item}%'
  1316. </foreach>
  1317. </if>
  1318. <if test="resultNetWeight != null">
  1319. and
  1320. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1321. "resultNetWeight" like '%${item}%'
  1322. </foreach>
  1323. </if>
  1324. <if test="materialName != null">
  1325. and
  1326. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1327. "materialName" like '%${item}%'
  1328. </foreach>
  1329. </if>
  1330. <if test="consigneeCompanyName != null">
  1331. and
  1332. <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
  1333. "consigneeCompanyName" like '%${item}%'
  1334. </foreach>
  1335. </if>
  1336. <if test="orderNumber != null">
  1337. and
  1338. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1339. "orderNumber" like '%${item}%'
  1340. </foreach>
  1341. </if>
  1342. <if test="capacityNumber != null">
  1343. and
  1344. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1345. "capacityNumber" like '%${item}%'
  1346. </foreach>
  1347. </if>
  1348. <if test="truckCalculateNumber != null">
  1349. and
  1350. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1351. "truckCalculateNumber" like '%${item}%'
  1352. </foreach>
  1353. </if>
  1354. <if test="resultGrossWeight != null">
  1355. and
  1356. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1357. "resultGrossWeight" like '%${item}%'
  1358. </foreach>
  1359. </if>
  1360. <if test="shipperName != null">
  1361. and
  1362. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1363. "shipperName" like '%${item}%'
  1364. </foreach>
  1365. </if>
  1366. <if test="resultGrossWeightTime != null">
  1367. and
  1368. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1369. "resultGrossWeightTime" like '%${item}%'
  1370. </foreach>
  1371. </if>
  1372. </where>
  1373. <include refid="orderBy"></include>
  1374. <if test="orderField == null ">
  1375. order by "resultGrossWeightTime" desc
  1376. </if>
  1377. </select>
  1378. <!-- 通过物资名称和物资规格查询物资ID -->
  1379. <select id="getMaterialIdByMaterialNameAndSpe" parameterType="java.util.Map" resultType="java.lang.Integer">
  1380. select RM.MATERIAL_ID
  1381. from RMS_MATERIAL RM
  1382. <where>
  1383. <if test="materialName != null">
  1384. RM.MATERIAL_NAME = #{materialName}
  1385. </if>
  1386. <if test="materialSpecification != null">
  1387. and RM.MATERIAL_SPECIFICATION = #{materialSpecification}
  1388. </if>
  1389. <if test="materialModel != null">
  1390. and RM.MATERIAL_MODEL = #{materialModel}
  1391. </if>
  1392. </where>
  1393. </select>
  1394. <!-- 通过物资Id和运输订单id 查询计量实绩Id -->
  1395. <select id="getWeightIdBySQEAndOrderId" parameterType="java.util.Map" resultType="DECIMAL">
  1396. select *
  1397. from (
  1398. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId"
  1399. from OMSTRUCK_ORDER OO
  1400. left join TMSTRUCK_TOTAL_RESULT TTR
  1401. on OO.ORDER_ID = TTR.ORDER_ID
  1402. left join TMSTRUCK_WEIGHT_RESULT TWR
  1403. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1404. where OO.ORDER_ID = #{orderId}
  1405. and TWR.RESULT_NET_WEIGHT is null
  1406. order by TWR.TARE_SEGMENT_SQE
  1407. )
  1408. where rownum = 1
  1409. </select>
  1410. <!-- 通过运输订单号和查询订单Id 和物资ID (针对单拼) -->
  1411. <select id="getOrderIdAndMaterialIdByOrderNum" parameterType="string" resultType="java.util.Map">
  1412. select OO.ORDER_ID "orderId",
  1413. OOM.MATERIAL_ID "materialId"
  1414. from OMSTRUCK_ORDER OO
  1415. left join OMSTRUCK_ORDER_MATERIAL OOM
  1416. on OOM.ORDER_ID = OO.ORDER_ID
  1417. where OO.ORDER_NUMBER = #{orderNumber}
  1418. </select>
  1419. <!-- 查询内转到钢材到异地库计量实绩 -->
  1420. <select id="getSteelNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1421. SELECT *
  1422. FROM (
  1423. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1424. AROD.DAYPLAN_NO "dayplanNo",
  1425. OO.ORDER_NUMBER "orderNumber",
  1426. RC.CAPACITY_NUMBER "capacityNumber",
  1427. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1428. RM.MATERIAL_NAME "materialName",
  1429. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1430. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1431. RS.SHIPPER_NAME "shipperName",
  1432. RW.WAREHOUSE_NAME "warehouseName",
  1433. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1434. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime"
  1435. FROM TMSTRUCK_WEIGHT_RESULT TWR
  1436. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1437. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  1438. LEFT JOIN OMSTRUCK_ORDER OO
  1439. ON OO.ORDER_ID = TTR.ORDER_ID
  1440. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  1441. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  1442. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1443. ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
  1444. LEFT JOIN RMS_MATERIAL RM
  1445. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1446. LEFT JOIN RMS_SHIPPER RS
  1447. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  1448. LEFT JOIN RMS_WAREHOUSE RW
  1449. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  1450. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1451. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1452. LEFT JOIN RMS_CAPACITY RC
  1453. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1454. WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_TARE_WEIGHT IS NOT NULL
  1455. )
  1456. <where>
  1457. <if test="dayplanNo != null">
  1458. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  1459. "dayplanNo" like '%${item}%'
  1460. </foreach>
  1461. </if>
  1462. <if test="orderNumber != null">
  1463. and
  1464. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1465. "orderNumber" like '%${item}%'
  1466. </foreach>
  1467. </if>
  1468. <if test="capacityNumber != null">
  1469. and
  1470. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1471. "capacityNumber" like '%${item}%'
  1472. </foreach>
  1473. </if>
  1474. <if test="truckCalculateNumber != null">
  1475. and
  1476. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1477. "truckCalculateNumber" like '%${item}%'
  1478. </foreach>
  1479. </if>
  1480. <if test="materialName != null">
  1481. and
  1482. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1483. "materialName" like '%${item}%'
  1484. </foreach>
  1485. </if>
  1486. <if test="orderMaterialNumber != null">
  1487. and
  1488. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1489. "orderMaterialNumber" like '%${item}%'
  1490. </foreach>
  1491. </if>
  1492. <if test="materialTheoreticalWeight != null">
  1493. and
  1494. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1495. "materialTheoreticalWeight" like '%${item}%'
  1496. </foreach>
  1497. </if>
  1498. <if test="shipperName != null">
  1499. and
  1500. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1501. "shipperName" like '%${item}%'
  1502. </foreach>
  1503. </if>
  1504. <if test="warehouseName != null">
  1505. and
  1506. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1507. "warehouseName" like '%${item}%'
  1508. </foreach>
  1509. </if>
  1510. <if test="resultTareWeight != null">
  1511. and
  1512. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1513. "resultTareWeight" like '%${item}%'
  1514. </foreach>
  1515. </if>
  1516. <if test="resultTareWeightTime != null">
  1517. and
  1518. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1519. "resultTareWeightTime" like '%${item}%'
  1520. </foreach>
  1521. </if>
  1522. </where>
  1523. <include refid="orderBy"></include>
  1524. <if test="orderField == null ">
  1525. order by "resultTareWeightTime" desc
  1526. </if>
  1527. </select>
  1528. <!-- 查询内转钢材到异地库计毛实绩 -->
  1529. <select id="getSteelNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1530. SELECT *
  1531. FROM (
  1532. SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1533. AROD.DAYPLAN_NO "dayplanNo",
  1534. OO.ORDER_NUMBER "orderNumber",
  1535. RC.CAPACITY_NUMBER "capacityNumber",
  1536. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1537. RM.MATERIAL_NAME "materialName",
  1538. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  1539. RM.MATERIAL_THEORETICAL_WEIGHT "materialTheoreticalWeight",
  1540. RS.SHIPPER_NAME "shipperName",
  1541. RW.WAREHOUSE_NAME "warehouseName",
  1542. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1543. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1544. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  1545. FROM TMSTRUCK_WEIGHT_RESULT TWR
  1546. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  1547. ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  1548. LEFT JOIN OMSTRUCK_ORDER OO
  1549. ON OO.ORDER_ID = TTR.ORDER_ID
  1550. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  1551. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  1552. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
  1553. ON OO.ORDER_ID = OOM.ORDER_ID AND OOM.MATERIAL_ID = TWR.MATERIAL_ID
  1554. LEFT JOIN RMS_MATERIAL RM
  1555. ON RM.MATERIAL_ID = OOM.MATERIAL_ID
  1556. LEFT JOIN RMS_SHIPPER RS
  1557. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  1558. LEFT JOIN RMS_WAREHOUSE RW
  1559. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  1560. LEFT JOIN RMS_TRUCK_CALCULATE RTC
  1561. ON RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1562. LEFT JOIN RMS_CAPACITY RC
  1563. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  1564. WHERE OO.ORDER_TYPE = 4 AND TWR.RESULT_GROSS_WEIGHT IS NOT NULL
  1565. )
  1566. <where>
  1567. <if test="dayplanNo != null">
  1568. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  1569. "dayplanNo" like '%${item}%'
  1570. </foreach>
  1571. </if>
  1572. <if test="orderNumber != null">
  1573. and
  1574. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1575. "orderNumber" like '%${item}%'
  1576. </foreach>
  1577. </if>
  1578. <if test="capacityNumber != null">
  1579. and
  1580. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1581. "capacityNumber" like '%${item}%'
  1582. </foreach>
  1583. </if>
  1584. <if test="truckCalculateNumber != null">
  1585. and
  1586. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1587. "truckCalculateNumber" like '%${item}%'
  1588. </foreach>
  1589. </if>
  1590. <if test="materialName != null">
  1591. and
  1592. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1593. "materialName" like '%${item}%'
  1594. </foreach>
  1595. </if>
  1596. <if test="orderMaterialNumber != null">
  1597. and
  1598. <foreach collection="orderMaterialNumber" item="item" open="(" separator="or" close=")">
  1599. "orderMaterialNumber" like '%${item}%'
  1600. </foreach>
  1601. </if>
  1602. <if test="materialTheoreticalWeight != null">
  1603. and
  1604. <foreach collection="materialTheoreticalWeight" item="item" open="(" separator="or" close=")">
  1605. "materialTheoreticalWeight" like '%${item}%'
  1606. </foreach>
  1607. </if>
  1608. <if test="shipperName != null">
  1609. and
  1610. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  1611. "shipperName" like '%${item}%'
  1612. </foreach>
  1613. </if>
  1614. <if test="warehouseName != null">
  1615. and
  1616. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1617. "warehouseName" like '%${item}%'
  1618. </foreach>
  1619. </if>
  1620. <if test="resultGrossWeight != null">
  1621. and
  1622. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1623. "resultGrossWeight" like '%${item}%'
  1624. </foreach>
  1625. </if>
  1626. <if test="resultGrossWeightTime != null">
  1627. and
  1628. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1629. "resultGrossWeightTime" like '%${item}%'
  1630. </foreach>
  1631. </if>
  1632. <if test="insertUpdateRemark != null">
  1633. and
  1634. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  1635. "insertUpdateRemark" like '%${item}%'
  1636. </foreach>
  1637. </if>
  1638. </where>
  1639. <include refid="orderBy"></include>
  1640. <if test="orderField == null ">
  1641. order by "resultGrossWeightTime" desc
  1642. </if>
  1643. </select>
  1644. <!-- 查询国产矿进口矿计毛实绩 -->
  1645. <select id="getImportedDomesticNzJiMaoResult" parameterType="java.util.Map" resultType="java.util.Map">
  1646. SELECT *
  1647. FROM (
  1648. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1649. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1650. RM.MATERIAL_NAME "materialName",
  1651. OO.ORDER_NUMBER "orderNumber",
  1652. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1653. RC.CAPACITY_NUMBER "capacityNumber",
  1654. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1655. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1656. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1657. RS.SUPPLIER_NAME "supplierName",
  1658. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  1659. from TMSTRUCK_WEIGHT_RESULT TWR
  1660. left join TMSTRUCK_TOTAL_RESULT TTR
  1661. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1662. left join OMSTRUCK_ORDER OO
  1663. on TTR.ORDER_ID = OO.ORDER_ID
  1664. left join AMS_PURCHASE_ORDER APO
  1665. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1666. left join DIL_BATCH DB
  1667. ON DB.BATCH_ID = APO.BATCH_ID
  1668. left join RMS_CAPACITY RC
  1669. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1670. left join RMS_TRUCK_CALCULATE RTC
  1671. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1672. left join OMSTRUCK_ORDER_MATERIAL OOM
  1673. on OOM.ORDER_ID = OO.ORDER_ID
  1674. left join RMS_MATERIAL RM
  1675. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1676. left join RMS_SUPPLIER RS
  1677. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1678. left join RMS_CONSIGNEE RCON
  1679. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1680. where RESULT_GROSS_WEIGHT_TIME is not null
  1681. and OO.ORDER_TYPE = 9
  1682. )
  1683. <where>
  1684. <if test="purchaseOrderNo != null">
  1685. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1686. "purchaseOrderNo" like '%${item}%'
  1687. </foreach>
  1688. </if>
  1689. <if test="materialName != null">
  1690. and
  1691. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1692. "materialName" like '%${item}%'
  1693. </foreach>
  1694. </if>
  1695. <if test="orderNumber != null">
  1696. and
  1697. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1698. "orderNumber" like '%${item}%'
  1699. </foreach>
  1700. </if>
  1701. <if test="capacityNumber != null">
  1702. and
  1703. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1704. "capacityNumber" like '%${item}%'
  1705. </foreach>
  1706. </if>
  1707. <if test="truckCalculateNumber != null">
  1708. and
  1709. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1710. "truckCalculateNumber" like '%${item}%'
  1711. </foreach>
  1712. </if>
  1713. <if test="resultGrossWeight != null">
  1714. and
  1715. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1716. "resultGrossWeight" like '%${item}%'
  1717. </foreach>
  1718. </if>
  1719. <if test="supplierName != null">
  1720. and
  1721. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1722. "supplierName" like '%${item}%'
  1723. </foreach>
  1724. </if>
  1725. <if test="resultGrossWeightTime != null">
  1726. and
  1727. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1728. "resultGrossWeightTime" like '%${item}%'
  1729. </foreach>
  1730. </if>
  1731. <if test="resultForeignShipName != null">
  1732. and
  1733. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1734. "resultForeignShipName" like '%${item}%'
  1735. </foreach>
  1736. </if>
  1737. </where>
  1738. <include refid="orderBy"></include>
  1739. <if test="orderField == null ">
  1740. order by "resultGrossWeightTime" desc
  1741. </if>
  1742. </select>
  1743. <!-- 查询国产矿进口矿计皮实绩 -->
  1744. <select id="getImportedDomesticNzJiPiResult" parameterType="java.util.Map" resultType="java.util.Map">
  1745. select *
  1746. from (
  1747. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1748. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1749. RM.MATERIAL_NAME "materialName",
  1750. OO.ORDER_NUMBER "orderNumber",
  1751. RC.CAPACITY_NUMBER "capacityNumber",
  1752. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1753. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1754. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1755. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1756. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1757. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1758. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1759. TWR.RESULT_POUND_NO "resultPoundNo"
  1760. from TMSTRUCK_WEIGHT_RESULT TWR
  1761. left join TMSTRUCK_TOTAL_RESULT TTR
  1762. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1763. left join OMSTRUCK_ORDER OO
  1764. on TTR.ORDER_ID = OO.ORDER_ID
  1765. left join AMS_PURCHASE_ORDER APO
  1766. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  1767. left join DIL_BATCH DB
  1768. on DB.BATCH_ID = APO.BATCH_ID
  1769. left join RMS_CAPACITY RC
  1770. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1771. left join RMS_TRUCK_CALCULATE RTC
  1772. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1773. left join OMSTRUCK_ORDER_MATERIAL OOM
  1774. on OOM.ORDER_ID = OO.ORDER_ID
  1775. left join RMS_MATERIAL RM
  1776. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1777. where RESULT_TARE_WEIGHT_TIME is not null
  1778. and OO.ORDER_TYPE = 9
  1779. )
  1780. <where>
  1781. <if test="purchaseOrderNo != null">
  1782. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1783. "purchaseOrderNo" like '%${item}%'
  1784. </foreach>
  1785. </if>
  1786. <if test="materialName != null">
  1787. and
  1788. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1789. "materialName" like '%${item}%'
  1790. </foreach>
  1791. </if>
  1792. <if test="orderNumber != null">
  1793. and
  1794. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1795. "orderNumber" like '%${item}%'
  1796. </foreach>
  1797. </if>
  1798. <if test="capacityNumber != null">
  1799. and
  1800. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1801. "capacityNumber" like '%${item}%'
  1802. </foreach>
  1803. </if>
  1804. <if test="truckCalculateNumber != null">
  1805. and
  1806. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1807. "truckCalculateNumber" like '%${item}%'
  1808. </foreach>
  1809. </if>
  1810. <if test="resultGrossWeight != null">
  1811. and
  1812. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  1813. "resultGrossWeight" like '%${item}%'
  1814. </foreach>
  1815. </if>
  1816. <if test="resultForeignShipName != null">
  1817. and
  1818. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1819. "resultForeignShipName" like '%${item}%'
  1820. </foreach>
  1821. </if>
  1822. <if test="resultGrossWeightTime != null">
  1823. and
  1824. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  1825. "resultGrossWeightTime" like '%${item}%'
  1826. </foreach>
  1827. </if>
  1828. <if test="resultTareWeight != null">
  1829. and
  1830. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1831. "resultTareWeight" like '%${item}%'
  1832. </foreach>
  1833. </if>
  1834. <if test="resultPoundNo != null">
  1835. and
  1836. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1837. "resultPoundNo" like '%${item}%'
  1838. </foreach>
  1839. </if>
  1840. <if test="resultTareWeightTime != null">
  1841. and
  1842. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1843. "resultTareWeightTime" like '%${item}%'
  1844. </foreach>
  1845. </if>
  1846. <if test="resultNetWeight != null">
  1847. and
  1848. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1849. "resultNetWeight" like '%${item}%'
  1850. </foreach>
  1851. </if>
  1852. </where>
  1853. <include refid="orderBy"></include>
  1854. <if test="orderField == null ">
  1855. order by "resultTareWeightTime" desc
  1856. </if>
  1857. </select>
  1858. <!-- 查询国产矿进口矿计皮实绩(老区-厂内) -->
  1859. <select id="getImportedDomesticNzJiPi2Result" parameterType="java.util.Map" resultType="java.util.Map">
  1860. select *
  1861. from (
  1862. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1863. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1864. RM.MATERIAL_NAME "materialName",
  1865. OO.ORDER_NUMBER "orderNumber",
  1866. RC.CAPACITY_NUMBER "capacityNumber",
  1867. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1868. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  1869. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  1870. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  1871. TWR.RESULT_POUND_NO "resultPoundNo",
  1872. TWR.RESULT_NET_WEIGHT "netWeight"
  1873. from TMSTRUCK_WEIGHT_RESULT TWR
  1874. left join TMSTRUCK_TOTAL_RESULT TTR
  1875. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1876. left join OMSTRUCK_ORDER OO
  1877. on TTR.ORDER_ID = OO.ORDER_ID
  1878. left join amstruck_inward_plan aip
  1879. on aip.plan_id = oo.order_plan_id
  1880. left join amstruck_requirement_plan arp
  1881. on arp.plan_id = aip.plan_id
  1882. left join amstruck_inward_requirement air
  1883. on air.requirement_id = arp.requirement_id
  1884. left join AMS_PURCHASE_ORDER APO
  1885. on APO.PURCHASE_ORDER_ID = air.purchase_order_id
  1886. left join DIL_BATCH DB
  1887. on DB.BATCH_ID = APO.BATCH_ID
  1888. left join RMS_CAPACITY RC
  1889. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1890. left join RMS_TRUCK_CALCULATE RTC
  1891. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  1892. left join OMSTRUCK_ORDER_MATERIAL OOM
  1893. on OOM.ORDER_ID = OO.ORDER_ID
  1894. left join RMS_MATERIAL RM
  1895. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1896. where RESULT_TARE_WEIGHT_TIME is not null
  1897. and OO.ORDER_TYPE in (10,20,15,16)
  1898. <if test="userId!=null">
  1899. AND air.INSERT_USERNAME =#{userId}
  1900. </if>
  1901. )
  1902. <where>
  1903. <if test="purchaseOrderNo != null">
  1904. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  1905. "purchaseOrderNo" like '%${item}%'
  1906. </foreach>
  1907. </if>
  1908. <if test="materialName != null">
  1909. and
  1910. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1911. "materialName" like '%${item}%'
  1912. </foreach>
  1913. </if>
  1914. <if test="orderNumber != null">
  1915. and
  1916. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1917. "orderNumber" like '%${item}%'
  1918. </foreach>
  1919. </if>
  1920. <if test="capacityNumber != null">
  1921. and
  1922. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1923. "capacityNumber" like '%${item}%'
  1924. </foreach>
  1925. </if>
  1926. <if test="truckCalculateNumber != null">
  1927. and
  1928. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  1929. "truckCalculateNumber" like '%${item}%'
  1930. </foreach>
  1931. </if>
  1932. <if test="resultTareWeight != null">
  1933. and
  1934. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  1935. "resultTareWeight" like '%${item}%'
  1936. </foreach>
  1937. </if>
  1938. <if test="resultPoundNo != null">
  1939. and
  1940. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  1941. "resultPoundNo" like '%${item}%'
  1942. </foreach>
  1943. </if>
  1944. <if test="resultTareWeightTime != null">
  1945. and
  1946. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  1947. "resultTareWeightTime" like '%${item}%'
  1948. </foreach>
  1949. </if>
  1950. <if test="resultNetWeight != null">
  1951. and
  1952. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  1953. "resultNetWeight" like '%${item}%'
  1954. </foreach>
  1955. </if>
  1956. </where>
  1957. <include refid="orderBy"></include>
  1958. <if test="orderField == null ">
  1959. order by "resultTareWeightTime" desc
  1960. </if>
  1961. </select>
  1962. <!-- 查询国产矿进口矿计毛实绩(老区-厂内) -->
  1963. <select id="getImportedDomesticNzJiMao2Result" parameterType="java.util.Map" resultType="java.util.Map">
  1964. SELECT *
  1965. FROM (
  1966. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  1967. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1968. RM.MATERIAL_NAME "materialName",
  1969. OO.ORDER_NUMBER "orderNumber",
  1970. RC.CAPACITY_NUMBER "capacityNumber",
  1971. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  1972. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  1973. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  1974. RS.SUPPLIER_NAME "supplierName",
  1975. rsr.shipper_name "consigneeCompanyName"
  1976. from TMSTRUCK_WEIGHT_RESULT TWR
  1977. left join TMSTRUCK_TOTAL_RESULT TTR
  1978. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1979. left join OMSTRUCK_ORDER OO
  1980. on TTR.ORDER_ID = OO.ORDER_ID
  1981. left join AMSTRUCK_INWARD_PLAN AIP
  1982. on AIP.PLAN_ID = OO.ORDER_PLAN_ID
  1983. left join AMSTRUCK_REQUIREMENT_PLAN ARP
  1984. on ARP.PLAN_ID = AIP.PLAN_ID
  1985. left join AMSTRUCK_INWARD_REQUIREMENT AIR
  1986. on AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  1987. left join AMS_PURCHASE_ORDER APO
  1988. on APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
  1989. left join DIL_BATCH DB
  1990. ON DB.BATCH_ID = APO.BATCH_ID
  1991. left join RMS_CAPACITY RC
  1992. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1993. left join RMS_TRUCK_CALCULATE RTC
  1994. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  1995. left join OMSTRUCK_ORDER_MATERIAL OOM
  1996. on OOM.ORDER_ID = OO.ORDER_ID
  1997. left join RMS_MATERIAL RM
  1998. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1999. left join RMS_SUPPLIER RS
  2000. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  2001. left join rms_shipper rsr
  2002. on rsr.shipper_id = APO.RECEIVE_UNIT_ID
  2003. where RESULT_GROSS_WEIGHT_TIME is not null
  2004. and OO.ORDER_TYPE in (10,20,15,16)
  2005. <if test="userId !=null">
  2006. AND AIR.INSERT_USERNAME = #{userId}
  2007. </if>
  2008. )
  2009. <where>
  2010. <if test="purchaseOrderNo != null">
  2011. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2012. "purchaseOrderNo" like '%${item}%'
  2013. </foreach>
  2014. </if>
  2015. <if test="materialName != null">
  2016. and
  2017. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2018. "materialName" like '%${item}%'
  2019. </foreach>
  2020. </if>
  2021. <if test="orderNumber != null">
  2022. and
  2023. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2024. "orderNumber" like '%${item}%'
  2025. </foreach>
  2026. </if>
  2027. <if test="capacityNumber != null">
  2028. and
  2029. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2030. "capacityNumber" like '%${item}%'
  2031. </foreach>
  2032. </if>
  2033. <if test="truckCalculateNumber != null">
  2034. and
  2035. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2036. "truckCalculateNumber" like '%${item}%'
  2037. </foreach>
  2038. </if>
  2039. <if test="resultGrossWeight != null">
  2040. and
  2041. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2042. "resultGrossWeight" like '%${item}%'
  2043. </foreach>
  2044. </if>
  2045. <if test="supplierName != null">
  2046. and
  2047. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  2048. "supplierName" like '%${item}%'
  2049. </foreach>
  2050. </if>
  2051. <if test="resultGrossWeightTime != null">
  2052. and
  2053. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2054. "resultGrossWeightTime" like '%${item}%'
  2055. </foreach>
  2056. </if>
  2057. <if test="resultForeignShipName != null">
  2058. and
  2059. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2060. "resultForeignShipName" like '%${item}%'
  2061. </foreach>
  2062. </if>
  2063. </where>
  2064. <include refid="orderBy"></include>
  2065. <if test="orderField == null ">
  2066. order by "resultGrossWeightTime" desc
  2067. </if>
  2068. </select>
  2069. <!-- 查询内转厂内物资计量实绩 -->
  2070. <select id="getInFactoryJiLiangResult" parameterType="java.util.Map" resultType="java.util.Map">
  2071. select *
  2072. from (
  2073. select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2074. RM.MATERIAL_NAME "materialName",
  2075. OO.ORDER_NUMBER "orderNumber",
  2076. RC.CAPACITY_NUMBER "capacityNumber",
  2077. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2078. RTC1.TRUCK_CALCULATE_NUMBER "grossCalculateNumber",
  2079. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2080. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2081. GREATEST(TWR.RESULT_GROSS_WEIGHT_TIME,TWR.RESULT_TARE_WEIGHT_TIME) "netWeightTime",
  2082. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2083. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2084. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2085. TWR.RESULT_POUND_NO "resultPoundNo",
  2086. TWR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  2087. RC.CAPACITY_NUMBER || RM.MATERIAL_NAME "likeCon"
  2088. from TMSTRUCK_WEIGHT_RESULT TWR
  2089. left join TMSTRUCK_TOTAL_RESULT TTR
  2090. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2091. left join OMSTRUCK_ORDER OO
  2092. on TTR.ORDER_ID = OO.ORDER_ID
  2093. left join RMS_CAPACITY RC
  2094. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2095. left join RMS_TRUCK_CALCULATE RTC
  2096. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2097. left join RMS_TRUCK_CALCULATE RTC1
  2098. on RTC1.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2099. left join OMSTRUCK_ORDER_MATERIAL OOM
  2100. on OOM.ORDER_ID = OO.ORDER_ID
  2101. left join RMS_MATERIAL RM
  2102. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2103. where TWR.RESULT_NET_WEIGHT IS NOT NULL
  2104. and OO.ORDER_TYPE = #{orderTypee}
  2105. <if test="oneDate != null">
  2106. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
  2107. </if>
  2108. <if test="startDate != null">
  2109. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TWR.RESULT_GROSS_WEIGHT_TIME
  2110. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TWR.RESULT_GROSS_WEIGHT_TIME
  2111. </if>
  2112. )
  2113. <where>
  2114. <if test="con != null">
  2115. and "likeCon" like #{con}
  2116. </if>
  2117. <if test="materialName != null">
  2118. and <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2119. "materialName" like '%${item}%'
  2120. </foreach>
  2121. </if>
  2122. <if test="orderNumber != null">
  2123. and
  2124. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2125. "orderNumber" like '%${item}%'
  2126. </foreach>
  2127. </if>
  2128. <if test="capacityNumber != null">
  2129. and
  2130. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2131. "capacityNumber" like '%${item}%'
  2132. </foreach>
  2133. </if>
  2134. <if test="truckCalculateNumber != null">
  2135. and
  2136. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2137. "truckCalculateNumber" like '%${item}%'
  2138. </foreach>
  2139. </if>
  2140. </where>
  2141. <include refid="orderBy"></include>
  2142. <if test="orderField == null ">
  2143. order by "netWeightTime" desc
  2144. </if>
  2145. </select>
  2146. <!-- 根据运输订单Id获取计毛实绩-->
  2147. <select id="getSporadicSuppliesJiMiaoResult" resultType="java.util.Map">
  2148. select *
  2149. from (
  2150. select distinct
  2151. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2152. OO.ORDER_NUMBER "orderNumber",
  2153. RC.CAPACITY_NUMBER "capacityNumber",
  2154. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2155. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2156. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2157. TWR.RESULT_NET_WEIGHT "netWeight",
  2158. RM.MATERIAL_NAME "materialName",
  2159. OO.ORDER_ID "orderId",
  2160. OO.ORDER_STATUS "orderStatus"
  2161. from TMSTRUCK_WEIGHT_RESULT TWR
  2162. left join TMSTRUCK_TOTAL_RESULT TTR
  2163. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2164. left join OMSTRUCK_ORDER OO
  2165. on TTR.ORDER_ID = OO.ORDER_ID
  2166. left join AMSTRUCK_SPORADIC_ORDER ASO
  2167. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2168. left join OMSTRUCK_ORDER_MATERIAL OOM
  2169. on OOM.ORDER_ID=OO.ORDER_ID
  2170. left join RMS_MATERIAL RM
  2171. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2172. left join RMS_CAPACITY RC
  2173. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2174. left join RMS_TRUCK_CALCULATE RTC
  2175. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2176. where RESULT_GROSS_WEIGHT_TIME is not null
  2177. <if test="orderTypee != 100">
  2178. AND OO.ORDER_TYPE = #{orderTypee}
  2179. </if>
  2180. <if test="orderTypee == 100">
  2181. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  2182. </if>
  2183. <if test="userId!=null">
  2184. and ASO.INSERT_USERNAME=#{userId}
  2185. </if>
  2186. )
  2187. <where>
  2188. <if test="purchaseOrderNo != null">
  2189. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2190. "purchaseOrderNo" like '%${item}%'
  2191. </foreach>
  2192. </if>
  2193. <if test="orderNumber != null">
  2194. and
  2195. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2196. "orderNumber" like '%${item}%'
  2197. </foreach>
  2198. </if>
  2199. <if test="capacityNumber != null">
  2200. and
  2201. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2202. "capacityNumber" like '%${item}%'
  2203. </foreach>
  2204. </if>
  2205. <if test="truckCalculateNumber != null">
  2206. and
  2207. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2208. "truckCalculateNumber" like '%${item}%'
  2209. </foreach>
  2210. </if>
  2211. <if test="resultGrossWeight != null">
  2212. and
  2213. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2214. "resultGrossWeight" like '%${item}%'
  2215. </foreach>
  2216. </if>
  2217. <if test="resultGrossWeightTime != null">
  2218. and
  2219. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2220. "resultGrossWeightTime" like '%${item}%'
  2221. </foreach>
  2222. </if>
  2223. </where>
  2224. <include refid="orderBy"></include>
  2225. <if test="orderField == null ">
  2226. order by "resultGrossWeightTime" desc
  2227. </if>
  2228. </select>
  2229. <!-- 根据运输订单Id获取零星物资计皮实绩-->
  2230. <select id="getSporadicSuppliesJiPiResult" resultType="java.util.Map">
  2231. select *
  2232. from (
  2233. select
  2234. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2235. APO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2236. RM.MATERIAL_NAME "materialName",
  2237. OO.ORDER_NUMBER "orderNumber",
  2238. RC.CAPACITY_NUMBER "capacityNumber",
  2239. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2240. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2241. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2242. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2243. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2244. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2245. TWR.RESULT_POUND_NO "resultPoundNo"
  2246. from TMSTRUCK_WEIGHT_RESULT TWR
  2247. left join TMSTRUCK_TOTAL_RESULT TTR
  2248. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2249. left join OMSTRUCK_ORDER OO
  2250. on TTR.ORDER_ID = OO.ORDER_ID
  2251. left join AMSTRUCK_SPORADIC_ORDER APO
  2252. on APO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2253. left join RMS_CAPACITY RC
  2254. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2255. left join RMS_TRUCK_CALCULATE RTC
  2256. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2257. left join OMSTRUCK_ORDER_MATERIAL OOM
  2258. on OOM.ORDER_ID = OO.ORDER_ID
  2259. left join RMS_MATERIAL RM
  2260. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2261. where RESULT_TARE_WEIGHT_TIME is not null
  2262. and OO.ORDER_TYPE = 12
  2263. )
  2264. <where>
  2265. <if test="purchaseOrderNo != null">
  2266. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2267. "purchaseOrderNo" like '%${item}%'
  2268. </foreach>
  2269. </if>
  2270. <if test="materialName != null">
  2271. and
  2272. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2273. "materialName" like '%${item}%'
  2274. </foreach>
  2275. </if>
  2276. <if test="orderNumber != null">
  2277. and
  2278. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2279. "orderNumber" like '%${item}%'
  2280. </foreach>
  2281. </if>
  2282. <if test="capacityNumber != null">
  2283. and
  2284. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2285. "capacityNumber" like '%${item}%'
  2286. </foreach>
  2287. </if>
  2288. <if test="truckCalculateNumber != null">
  2289. and
  2290. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2291. "truckCalculateNumber" like '%${item}%'
  2292. </foreach>
  2293. </if>
  2294. <if test="resultGrossWeight != null">
  2295. and
  2296. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2297. "resultGrossWeight" like '%${item}%'
  2298. </foreach>
  2299. </if>
  2300. <if test="resultForeignShipName != null">
  2301. and
  2302. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2303. "resultForeignShipName" like '%${item}%'
  2304. </foreach>
  2305. </if>
  2306. <if test="resultGrossWeightTime != null">
  2307. and
  2308. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2309. "resultGrossWeightTime" like '%${item}%'
  2310. </foreach>
  2311. </if>
  2312. <if test="resultTareWeight != null">
  2313. and
  2314. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2315. "resultTareWeight" like '%${item}%'
  2316. </foreach>
  2317. </if>
  2318. <if test="resultPoundNo != null">
  2319. and
  2320. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2321. "resultPoundNo" like '%${item}%'
  2322. </foreach>
  2323. </if>
  2324. <if test="resultTareWeightTime != null">
  2325. and
  2326. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2327. "resultTareWeightTime" like '%${item}%'
  2328. </foreach>
  2329. </if>
  2330. <if test="resultNetWeight != null">
  2331. and
  2332. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2333. "resultNetWeight" like '%${item}%'
  2334. </foreach>
  2335. </if>
  2336. </where>
  2337. <include refid="orderBy"></include>
  2338. <if test="orderField == null ">
  2339. order by "resultTareWeightTime" desc
  2340. </if>
  2341. </select>
  2342. <!-- 一车多趟获取计重实绩(零星物资) -->
  2343. <select id="getFactorySkinSporadicWeight" resultType="java.util.Map">
  2344. select *
  2345. from (
  2346. select distinct
  2347. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2348. ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2349. RM.MATERIAL_NAME "materialName",
  2350. OO.ORDER_NUMBER "orderNumber",
  2351. RC.CAPACITY_NUMBER "capacityNumber",
  2352. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2353. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2354. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2355. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2356. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2357. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2358. TWR.RESULT_POUND_NO "resultPoundNo"
  2359. from TMSTRUCK_WEIGHT_RESULT TWR
  2360. left join TMSTRUCK_TOTAL_RESULT TTR
  2361. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2362. left join OMSTRUCK_ORDER OO
  2363. on TTR.ORDER_ID = OO.ORDER_ID
  2364. left join AMSTRUCK_SPORADIC_ORDER ASO
  2365. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2366. left join RMS_CAPACITY RC
  2367. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2368. left join RMS_TRUCK_CALCULATE RTC
  2369. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2370. left join OMSTRUCK_ORDER_MATERIAL OOM
  2371. on OOM.ORDER_ID = OO.ORDER_ID
  2372. left join RMS_MATERIAL RM
  2373. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  2374. where RESULT_TARE_WEIGHT_TIME is not null
  2375. <if test="orderTypee != 100">
  2376. AND OO.ORDER_TYPE = #{orderTypee}
  2377. </if>
  2378. <if test="orderTypee == 100">
  2379. AND OO.ORDER_TYPE in (12, 13 ,14,19)
  2380. </if>
  2381. <if test="userId!=null">
  2382. and ASO.INSERT_USERNAME=#{userId}
  2383. </if>
  2384. <if test="userIds!=null">
  2385. and ASO.UPDATE_USERNAME=#{userIds}
  2386. </if>
  2387. )
  2388. <where>
  2389. <if test="purchaseOrderNo != null">
  2390. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2391. "purchaseOrderNo" like '%${item}%'
  2392. </foreach>
  2393. </if>
  2394. <if test="materialName != null">
  2395. and
  2396. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  2397. "materialName" like '%${item}%'
  2398. </foreach>
  2399. </if>
  2400. <if test="orderNumber != null">
  2401. and
  2402. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2403. "orderNumber" like '%${item}%'
  2404. </foreach>
  2405. </if>
  2406. <if test="capacityNumber != null">
  2407. and
  2408. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2409. "capacityNumber" like '%${item}%'
  2410. </foreach>
  2411. </if>
  2412. <if test="truckCalculateNumber != null">
  2413. and
  2414. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2415. "truckCalculateNumber" like '%${item}%'
  2416. </foreach>
  2417. </if>
  2418. <if test="resultGrossWeight != null">
  2419. and
  2420. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2421. "resultGrossWeight" like '%${item}%'
  2422. </foreach>
  2423. </if>
  2424. <if test="resultForeignShipName != null">
  2425. and
  2426. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  2427. "resultForeignShipName" like '%${item}%'
  2428. </foreach>
  2429. </if>
  2430. <if test="resultGrossWeightTime != null">
  2431. and
  2432. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2433. "resultGrossWeightTime" like '%${item}%'
  2434. </foreach>
  2435. </if>
  2436. <if test="resultTareWeight != null">
  2437. and
  2438. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2439. "resultTareWeight" like '%${item}%'
  2440. </foreach>
  2441. </if>
  2442. <if test="resultPoundNo != null">
  2443. and
  2444. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2445. "resultPoundNo" like '%${item}%'
  2446. </foreach>
  2447. </if>
  2448. <if test="resultTareWeightTime != null">
  2449. and
  2450. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2451. "resultTareWeightTime" like '%${item}%'
  2452. </foreach>
  2453. </if>
  2454. <if test="resultNetWeight != null">
  2455. and
  2456. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2457. "resultNetWeight" like '%${item}%'
  2458. </foreach>
  2459. </if>
  2460. </where>
  2461. <include refid="orderBy"></include>
  2462. <if test="orderField == null ">
  2463. order by "resultTareWeightTime" desc
  2464. </if>
  2465. </select>
  2466. <!-- 根据运输订单Id获取计毛实绩-->
  2467. <select id="getFactorySkinSporadicJiMiao" resultType="java.util.Map">
  2468. select *
  2469. from (
  2470. select
  2471. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2472. OO.ORDER_NUMBER "orderNumber",
  2473. RC.CAPACITY_NUMBER "capacityNumber",
  2474. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2475. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2476. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2477. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2478. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2479. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2480. RM.MATERIAL_NAME "materialName"
  2481. from TMSTRUCK_WEIGHT_RESULT TWR
  2482. left join TMSTRUCK_TOTAL_RESULT TTR
  2483. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2484. left join OMSTRUCK_ORDER OO
  2485. on TTR.ORDER_ID = OO.ORDER_ID
  2486. left join OMSTRUCK_ORDER_MATERIAL OOM
  2487. on OOM.ORDER_ID=OO.ORDER_ID
  2488. left join RMS_MATERIAL RM
  2489. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2490. left join AMSTRUCK_SPORADIC_ORDER ASO
  2491. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2492. left join RMS_CAPACITY RC
  2493. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2494. left join RMS_TRUCK_CALCULATE RTC
  2495. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2496. where RESULT_GROSS_WEIGHT_TIME is not null and
  2497. OO.ORDER_TYPE = 13
  2498. )
  2499. <where>
  2500. <if test="purchaseOrderNo != null">
  2501. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2502. "purchaseOrderNo" like '%${item}%'
  2503. </foreach>
  2504. </if>
  2505. <if test="orderNumber != null">
  2506. and
  2507. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2508. "orderNumber" like '%${item}%'
  2509. </foreach>
  2510. </if>
  2511. <if test="capacityNumber != null">
  2512. and
  2513. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2514. "capacityNumber" like '%${item}%'
  2515. </foreach>
  2516. </if>
  2517. <if test="truckCalculateNumber != null">
  2518. and
  2519. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2520. "truckCalculateNumber" like '%${item}%'
  2521. </foreach>
  2522. </if>
  2523. <if test="resultGrossWeight != null">
  2524. and
  2525. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2526. "resultGrossWeight" like '%${item}%'
  2527. </foreach>
  2528. </if>
  2529. <if test="resultGrossWeightTime != null">
  2530. and
  2531. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2532. "resultGrossWeightTime" like '%${item}%'
  2533. </foreach>
  2534. </if>
  2535. <if test="resultTareWeight != null">
  2536. and
  2537. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2538. "resultTareWeight" like '%${item}%'
  2539. </foreach>
  2540. </if>
  2541. <if test="resultTareWeightTime != null">
  2542. and
  2543. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2544. "resultTareWeightTime" like '%${item}%'
  2545. </foreach>
  2546. </if>
  2547. <if test="resultNetWeight != null">
  2548. and
  2549. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2550. "resultNetWeight" like '%${item}%'
  2551. </foreach>
  2552. </if>
  2553. <if test="resultGrossWeightTime != null">
  2554. and
  2555. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2556. "resultGrossWeightTime" like '%${item}%'
  2557. </foreach>
  2558. </if>
  2559. </where>
  2560. <include refid="orderBy"></include>
  2561. <if test="orderField == null ">
  2562. order by "resultGrossWeightTime" desc
  2563. </if>
  2564. </select>
  2565. <!-- 根据运输订单id获取计量实绩-->
  2566. <select id="getFactorySporadicJiMiaoResult" resultType="java.util.Map">
  2567. select *
  2568. from (
  2569. select
  2570. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2571. OO.ORDER_NUMBER "orderNumber",
  2572. RC.CAPACITY_NUMBER "capacityNumber",
  2573. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2574. TWR.RESULT_GROSS_WEIGHT "resultGrossWeight",
  2575. TWR.RESULT_GROSS_WEIGHT_TIME "resultGrossWeightTime",
  2576. TWR.RESULT_NET_WEIGHT "resultNetWeight",
  2577. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2578. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2579. RM.MATERIAL_NAME "materialName"
  2580. from TMSTRUCK_WEIGHT_RESULT TWR
  2581. left join TMSTRUCK_TOTAL_RESULT TTR
  2582. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2583. left join OMSTRUCK_ORDER OO
  2584. on TTR.ORDER_ID = OO.ORDER_ID
  2585. left join OMSTRUCK_ORDER_MATERIAL OOM
  2586. on OOM.ORDER_ID=OO.ORDER_ID
  2587. left join RMS_MATERIAL RM
  2588. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2589. left join AMSTRUCK_SPORADIC_ORDER ASO
  2590. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2591. left join RMS_CAPACITY RC
  2592. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2593. left join RMS_TRUCK_CALCULATE RTC
  2594. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_GROSS_PLACE_ID
  2595. where RESULT_GROSS_WEIGHT_TIME is not null and
  2596. OO.ORDER_TYPE in (15,16)
  2597. )
  2598. <where>
  2599. <if test="purchaseOrderNo != null">
  2600. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2601. "purchaseOrderNo" like '%${item}%'
  2602. </foreach>
  2603. </if>
  2604. <if test="orderNumber != null">
  2605. and
  2606. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2607. "orderNumber" like '%${item}%'
  2608. </foreach>
  2609. </if>
  2610. <if test="capacityNumber != null">
  2611. and
  2612. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2613. "capacityNumber" like '%${item}%'
  2614. </foreach>
  2615. </if>
  2616. <if test="truckCalculateNumber != null">
  2617. and
  2618. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2619. "truckCalculateNumber" like '%${item}%'
  2620. </foreach>
  2621. </if>
  2622. <if test="resultGrossWeight != null">
  2623. and
  2624. <foreach collection="resultGrossWeight" item="item" open="(" separator="or" close=")">
  2625. "resultGrossWeight" like '%${item}%'
  2626. </foreach>
  2627. </if>
  2628. <if test="resultGrossWeightTime != null">
  2629. and
  2630. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2631. "resultGrossWeightTime" like '%${item}%'
  2632. </foreach>
  2633. </if>
  2634. <if test="resultTareWeight != null">
  2635. and
  2636. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2637. "resultTareWeight" like '%${item}%'
  2638. </foreach>
  2639. </if>
  2640. <if test="resultTareWeightTime != null">
  2641. and
  2642. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2643. "resultTareWeightTime" like '%${item}%'
  2644. </foreach>
  2645. </if>
  2646. <if test="resultNetWeight != null">
  2647. and
  2648. <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
  2649. "resultNetWeight" like '%${item}%'
  2650. </foreach>
  2651. </if>
  2652. <if test="resultGrossWeightTime != null">
  2653. and
  2654. <foreach collection="resultGrossWeightTime" item="item" open="(" separator="or" close=")">
  2655. "resultGrossWeightTime" like '%${item}%'
  2656. </foreach>
  2657. </if>
  2658. </where>
  2659. <include refid="orderBy"></include>
  2660. <if test="orderField == null ">
  2661. order by "resultGrossWeightTime" desc
  2662. </if>
  2663. </select>
  2664. <!-- 零星计皮 -->
  2665. <select id="getFactorySkinSporadicJIPi" parameterType="java.util.Map" resultType="java.util.Map">
  2666. select *
  2667. from (
  2668. select
  2669. TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
  2670. ASO.SPORADIC_ORDER_NO "purchaseOrderNo",
  2671. OO.ORDER_NUMBER "orderNumber",
  2672. RC.CAPACITY_NUMBER "capacityNumber",
  2673. RTC.TRUCK_CALCULATE_NUMBER "truckCalculateNumber",
  2674. TWR.RESULT_TARE_WEIGHT "resultTareWeight",
  2675. TWR.RESULT_TARE_WEIGHT_TIME "resultTareWeightTime",
  2676. TWR.RESULT_POUND_NO "resultPoundNo",
  2677. RM.MATERIAL_NAME "materialName"
  2678. from TMSTRUCK_WEIGHT_RESULT TWR
  2679. left join TMSTRUCK_TOTAL_RESULT TTR
  2680. on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2681. left join OMSTRUCK_ORDER OO
  2682. on TTR.ORDER_ID = OO.ORDER_ID
  2683. left join OMSTRUCK_ORDER_MATERIAL OOM
  2684. on OO.ORDER_ID=OOM.ORDER_ID
  2685. left join RMS_MATERIAL RM
  2686. on RM.MATERIAL_ID=OOM.MATERIAL_ID
  2687. left join AMSTRUCK_SPORADIC_ORDER ASO
  2688. on ASO.SPORADIC_ORDER_ID = OO.ORDER_PLAN_ID
  2689. left join RMS_CAPACITY RC
  2690. on RC.CAPACITY_ID = OO.CAPACITY_ID
  2691. left join RMS_TRUCK_CALCULATE RTC
  2692. on RTC.TRUCK_CALCULATE_ID = TWR.RESULT_TARE_PLACE_ID
  2693. where RESULT_TARE_WEIGHT_TIME is not null
  2694. and OO.ORDER_TYPE = 13
  2695. )
  2696. <where>
  2697. <if test="purchaseOrderNo != null">
  2698. <foreach collection="purchaseOrderNo" item="item" open="(" separator="or" close=")">
  2699. "purchaseOrderNo" like '%${item}%'
  2700. </foreach>
  2701. </if>
  2702. <if test="orderNumber != null">
  2703. and
  2704. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  2705. "orderNumber" like '%${item}%'
  2706. </foreach>
  2707. </if>
  2708. <if test="capacityNumber != null">
  2709. and
  2710. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  2711. "capacityNumber" like '%${item}%'
  2712. </foreach>
  2713. </if>
  2714. <if test="truckCalculateNumber != null">
  2715. and
  2716. <foreach collection="truckCalculateNumber" item="item" open="(" separator="or" close=")">
  2717. "truckCalculateNumber" like '%${item}%'
  2718. </foreach>
  2719. </if>
  2720. <if test="resultTareWeight != null">
  2721. and
  2722. <foreach collection="resultTareWeight" item="item" open="(" separator="or" close=")">
  2723. "resultTareWeight" like '%${item}%'
  2724. </foreach>
  2725. </if>
  2726. <if test="resultPoundNo != null">
  2727. and
  2728. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2729. "resultPoundNo" like '%${item}%'
  2730. </foreach>
  2731. </if>
  2732. <if test="resultTareWeightTime != null">
  2733. and
  2734. <foreach collection="resultTareWeightTime" item="item" open="(" separator="or" close=")">
  2735. "resultTareWeightTime" like '%${item}%'
  2736. </foreach>
  2737. </if>
  2738. <if test="resultPoundNo != null">
  2739. and
  2740. <foreach collection="resultPoundNo" item="item" open="(" separator="or" close=")">
  2741. "resultPoundNo" like '%${item}%'
  2742. </foreach>
  2743. </if>
  2744. </where>
  2745. <include refid="orderBy"></include>
  2746. <if test="orderField == null ">
  2747. order by "resultTareWeightTime" desc
  2748. </if>
  2749. </select>
  2750. <!-- 通过总实绩ID查询订单类型 -->
  2751. <select id="getOrderTypeByTotalId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  2752. select OO.ORDER_TYPE
  2753. from OMSTRUCK_ORDER OO
  2754. where OO.ORDER_ID =
  2755. (select TTR.ORDER_ID from TMSTRUCK_TOTAL_RESULT TTR where TTR.RESULT_TOTAL_ID = #{resultTotalId})
  2756. </select>
  2757. <select id="getOldWeightMes" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  2758. select MAX(TWR.GROSS_SEGMENT_SQE) "maxGrossSqe",
  2759. TTR.RESULT_TOTAL_ID "resultTotalId"
  2760. from TMSTRUCK_TOTAL_RESULT TTR
  2761. left join TMSTRUCK_WEIGHT_RESULT TWR on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
  2762. where TTR.ORDER_ID = #{orderId}
  2763. group by TTR.RESULT_TOTAL_ID
  2764. </select>
  2765. <update id="updateLeaveFactorySqe" parameterType="com.steerinfo.dil.model.TmstruckLeaveFactoryResult">
  2766. update TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  2767. set TLFR.SEGMENT_SQE = #{segmentSqe}
  2768. where TLFR.RESULT_TOTAL_ID = #{resultTotalId}
  2769. </update>
  2770. <select id="getOutBoundResult" resultType="java.math.BigDecimal" parameterType="java.math.BigDecimal">
  2771. select WOR.RESULT_ID
  2772. from WMSP_OUTBOUND_RESULT WOR
  2773. WHERE WOR.BILL_LADING_ID = #{orderId}
  2774. </select>
  2775. <delete id="deleteWeightResult">
  2776. delete
  2777. from TMSTRUCK_WEIGHT_RESULT TWR
  2778. where TWR.RESULT_TOTAL_ID = #{resultTotalId}
  2779. and TWR.GROSS_SEGMENT_SQE = #{sqe}
  2780. </delete>
  2781. <delete id="deleteLoadResult">
  2782. delete
  2783. from TMSTRUCK_LOAD_RESULT TLR
  2784. where TLR.RESULT_TOTAL_ID = #{resultTotalId}
  2785. and TLR.SEGMENT_SQE = #{sqe}
  2786. </delete>
  2787. <delete id="deleteOutBoundResult">
  2788. delete
  2789. from WMSP_OUTBOUND_RESULT_MATERIAL
  2790. where OUTBOUND_RESULT_ID = #{boundResultId}
  2791. and MATERIAL_ID = #{deleteMaterialId}
  2792. </delete>
  2793. <insert id="addOutBoundResult" parameterType="map">
  2794. insert into WMSP_OUTBOUND_RESULT_MATERIAL (RESULT_MATERIAL_ID, OUTBOUND_RESULT_ID, INSERT_USERNAME, INSERT_TIME,
  2795. MATERIAL_ID, MATERIAL_NUMBER, STATUS)
  2796. values (#{resultMaterialId}, #{boundResultId}, 'admin', SYSDATE,#{materialId}, #{materialNumber}, 1)
  2797. </insert>
  2798. <update id="updateOutBoundResult" parameterType="map">
  2799. update WMSP_OUTBOUND_RESULT_MATERIAL
  2800. set MATERIAL_NUMBER = #{materialNumber}
  2801. where OUTBOUND_RESULT_ID = #{boundResultId} and MATERIAL_ID = #{materialId}
  2802. </update>
  2803. </mapper>