TmstruckWeightResultMapper.xml 132 KB

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