TmstruckWeightResultMapper.xml 127 KB

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