QmsQueueResultMapper.xml 107 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273
  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.QmsQueueResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.QmsQueueResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
  8. <result column="RESULT_APPLYFOR_TIME" jdbcType="TIMESTAMP" property="resultApplyforTime" />
  9. <result column="RESULT_APPLYFOR_LOCATION" jdbcType="VARCHAR" property="resultApplyforLocation" />
  10. <result column="GRID_ID" jdbcType="DECIMAL" property="gridId" />
  11. <result column="RESULT_DOWN_TIME" jdbcType="TIMESTAMP" property="resultDownTime" />
  12. <result column="RESULT_ACCEPT_TIME" jdbcType="TIMESTAMP" property="resultAcceptTime" />
  13. <result column="RESULT_START_TIME" jdbcType="TIMESTAMP" property="resultStartTime" />
  14. <result column="RESULT_END_TIME" jdbcType="TIMESTAMP" property="resultEndTime" />
  15. <result column="RESULT_CANCEL_TIME" jdbcType="TIMESTAMP" property="resultCancelTime" />
  16. <result column="RESULT_CANCEL_REASON" jdbcType="VARCHAR" property="resultCancelReason" />
  17. <result column="RESULT_INSERT_TIME" jdbcType="TIMESTAMP" property="resultInsertTime" />
  18. <result column="RESULT_INSERT_REASON" jdbcType="VARCHAR" property="resultInsertReason" />
  19. <result column="RESULT_TRANSFER_TIME" jdbcType="TIMESTAMP" property="resultTransferTime" />
  20. <result column="RESULT_TRANSFER_REASON" jdbcType="VARCHAR" property="resultTransferReason" />
  21. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  22. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  23. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  24. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  25. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  26. <result column="LIST_ID" jdbcType="DECIMAL" property="listId" />
  27. <result column="AREA_ID" jdbcType="VARCHAR" property="areaId" />
  28. <result column="IS_SPELLING" jdbcType="DECIMAL" property="isSpelling" />
  29. <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
  30. </resultMap>
  31. <sql id="columns">
  32. RESULT_ID, RESULT_TOTAL_ID, CAPACITY_ID, RESULT_APPLYFOR_TIME, RESULT_APPLYFOR_LOCATION,
  33. GRID_ID, RESULT_DOWN_TIME, RESULT_ACCEPT_TIME, RESULT_START_TIME, RESULT_END_TIME,
  34. RESULT_CANCEL_TIME, RESULT_CANCEL_REASON, RESULT_INSERT_TIME, RESULT_INSERT_REASON,
  35. RESULT_TRANSFER_TIME, RESULT_TRANSFER_REASON, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  36. UPDATE_TIME, INSERT_UPDATE_REMARK, LIST_ID, AREA_ID, IS_SPELLING, GATEPOST_ID
  37. </sql>
  38. <sql id="columns_alias">
  39. t.RESULT_ID, t.RESULT_TOTAL_ID, t.CAPACITY_ID, t.RESULT_APPLYFOR_TIME, t.RESULT_APPLYFOR_LOCATION,
  40. t.GRID_ID, t.RESULT_DOWN_TIME, t.RESULT_ACCEPT_TIME, t.RESULT_START_TIME, t.RESULT_END_TIME,
  41. t.RESULT_CANCEL_TIME, t.RESULT_CANCEL_REASON, t.RESULT_INSERT_TIME, t.RESULT_INSERT_REASON,
  42. t.RESULT_TRANSFER_TIME, t.RESULT_TRANSFER_REASON, t.INSERT_USERNAME, t.INSERT_TIME,
  43. t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.LIST_ID, t.AREA_ID, t.IS_SPELLING,
  44. t.GATEPOST_ID
  45. </sql>
  46. <sql id="select">
  47. SELECT <include refid="columns" /> FROM QMS_QUEUE_RESULT
  48. </sql>
  49. <sql id="select_alias">
  50. SELECT <include refid="columns_alias" /> FROM QMS_QUEUE_RESULT t
  51. </sql>
  52. <sql id="where">
  53. <where>
  54. <if test="resultId != null">
  55. and RESULT_ID = #{resultId}
  56. </if>
  57. <if test="resultTotalId != null">
  58. and RESULT_TOTAL_ID = #{resultTotalId}
  59. </if>
  60. <if test="capacityId != null">
  61. and CAPACITY_ID = #{capacityId}
  62. </if>
  63. <if test="resultApplyforTime != null">
  64. and TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = #{resultApplyforTime}
  65. </if>
  66. <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
  67. and RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation}
  68. </if>
  69. <if test="gridId != null">
  70. and GRID_ID = #{gridId}
  71. </if>
  72. <if test="resultDownTime != null">
  73. and TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = #{resultDownTime}
  74. </if>
  75. <if test="resultAcceptTime != null">
  76. and TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = #{resultAcceptTime}
  77. </if>
  78. <if test="resultStartTime != null">
  79. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  80. </if>
  81. <if test="resultEndTime != null">
  82. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  83. </if>
  84. <if test="resultCancelTime != null">
  85. and TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = #{resultCancelTime}
  86. </if>
  87. <if test="resultCancelReason != null and resultCancelReason != ''">
  88. and RESULT_CANCEL_REASON = #{resultCancelReason}
  89. </if>
  90. <if test="resultInsertTime != null">
  91. and TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = #{resultInsertTime}
  92. </if>
  93. <if test="resultInsertReason != null and resultInsertReason != ''">
  94. and RESULT_INSERT_REASON = #{resultInsertReason}
  95. </if>
  96. <if test="resultTransferTime != null">
  97. and TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = #{resultTransferTime}
  98. </if>
  99. <if test="resultTransferReason != null and resultTransferReason != ''">
  100. and RESULT_TRANSFER_REASON = #{resultTransferReason}
  101. </if>
  102. <if test="insertUsername != null and insertUsername != ''">
  103. and INSERT_USERNAME = #{insertUsername}
  104. </if>
  105. <if test="insertTime != null">
  106. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  107. </if>
  108. <if test="updateUsername != null and updateUsername != ''">
  109. and UPDATE_USERNAME = #{updateUsername}
  110. </if>
  111. <if test="updateTime != null">
  112. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  113. </if>
  114. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  115. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  116. </if>
  117. <if test="listId != null">
  118. and LIST_ID = #{listId}
  119. </if>
  120. <if test="areaId != null and areaId != ''">
  121. and AREA_ID = #{areaId}
  122. </if>
  123. <if test="isSpelling != null">
  124. and IS_SPELLING = #{isSpelling}
  125. </if>
  126. <if test="gatepostId != null">
  127. and GATEPOST_ID = #{gatepostId}
  128. </if>
  129. </where>
  130. </sql>
  131. <sql id="whereLike">
  132. <where>
  133. <if test="resultId != null">
  134. and RESULT_ID = #{resultId}
  135. </if>
  136. <if test="resultTotalId != null">
  137. and RESULT_TOTAL_ID = #{resultTotalId}
  138. </if>
  139. <if test="capacityId != null">
  140. and CAPACITY_ID = #{capacityId}
  141. </if>
  142. <if test="resultApplyforTime != null">
  143. and TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = #{resultApplyforTime}
  144. </if>
  145. <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
  146. and RESULT_APPLYFOR_LOCATION LIKE '%${resultApplyforLocation}%'
  147. </if>
  148. <if test="gridId != null">
  149. and GRID_ID = #{gridId}
  150. </if>
  151. <if test="resultDownTime != null">
  152. and TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = #{resultDownTime}
  153. </if>
  154. <if test="resultAcceptTime != null">
  155. and TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = #{resultAcceptTime}
  156. </if>
  157. <if test="resultStartTime != null">
  158. and TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = #{resultStartTime}
  159. </if>
  160. <if test="resultEndTime != null">
  161. and TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = #{resultEndTime}
  162. </if>
  163. <if test="resultCancelTime != null">
  164. and TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = #{resultCancelTime}
  165. </if>
  166. <if test="resultCancelReason != null and resultCancelReason != ''">
  167. and RESULT_CANCEL_REASON LIKE '%${resultCancelReason}%'
  168. </if>
  169. <if test="resultInsertTime != null">
  170. and TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = #{resultInsertTime}
  171. </if>
  172. <if test="resultInsertReason != null and resultInsertReason != ''">
  173. and RESULT_INSERT_REASON LIKE '%${resultInsertReason}%'
  174. </if>
  175. <if test="resultTransferTime != null">
  176. and TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = #{resultTransferTime}
  177. </if>
  178. <if test="resultTransferReason != null and resultTransferReason != ''">
  179. and RESULT_TRANSFER_REASON LIKE '%${resultTransferReason}%'
  180. </if>
  181. <if test="insertUsername != null and insertUsername != ''">
  182. and INSERT_USERNAME LIKE '%${insertUsername}%'
  183. </if>
  184. <if test="insertTime != null">
  185. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  186. </if>
  187. <if test="updateUsername != null and updateUsername != ''">
  188. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  189. </if>
  190. <if test="updateTime != null">
  191. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  192. </if>
  193. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  194. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  195. </if>
  196. <if test="listId != null">
  197. and LIST_ID = #{listId}
  198. </if>
  199. <if test="areaId != null and areaId != ''">
  200. and AREA_ID LIKE '%${areaId}%'
  201. </if>
  202. <if test="isSpelling != null">
  203. and IS_SPELLING = #{isSpelling}
  204. </if>
  205. <if test="gatepostId != null">
  206. and GATEPOST_ID = #{gatepostId}
  207. </if>
  208. </where>
  209. </sql>
  210. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  211. delete from QMS_QUEUE_RESULT
  212. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  213. </delete>
  214. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  215. delete from QMS_QUEUE_RESULT
  216. where 1!=1
  217. <if test="resultTotalId != null">
  218. or RESULT_TOTAL_ID = #{resultTotalId}
  219. </if>
  220. <if test="capacityId != null">
  221. or CAPACITY_ID = #{capacityId}
  222. </if>
  223. <if test="resultApplyforTime != null">
  224. or TO_CHAR(RESULT_APPLYFOR_TIME,'yyyy-MM-dd') = '#{resultApplyforTime}'
  225. </if>
  226. <if test="resultApplyforLocation != null and resultApplyforLocation != ''">
  227. or RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation}
  228. </if>
  229. <if test="gridId != null">
  230. or GRID_ID = #{gridId}
  231. </if>
  232. <if test="resultDownTime != null">
  233. or TO_CHAR(RESULT_DOWN_TIME,'yyyy-MM-dd') = '#{resultDownTime}'
  234. </if>
  235. <if test="resultAcceptTime != null">
  236. or TO_CHAR(RESULT_ACCEPT_TIME,'yyyy-MM-dd') = '#{resultAcceptTime}'
  237. </if>
  238. <if test="resultStartTime != null">
  239. or TO_CHAR(RESULT_START_TIME,'yyyy-MM-dd') = '#{resultStartTime}'
  240. </if>
  241. <if test="resultEndTime != null">
  242. or TO_CHAR(RESULT_END_TIME,'yyyy-MM-dd') = '#{resultEndTime}'
  243. </if>
  244. <if test="resultCancelTime != null">
  245. or TO_CHAR(RESULT_CANCEL_TIME,'yyyy-MM-dd') = '#{resultCancelTime}'
  246. </if>
  247. <if test="resultCancelReason != null and resultCancelReason != ''">
  248. or RESULT_CANCEL_REASON = #{resultCancelReason}
  249. </if>
  250. <if test="resultInsertTime != null">
  251. or TO_CHAR(RESULT_INSERT_TIME,'yyyy-MM-dd') = '#{resultInsertTime}'
  252. </if>
  253. <if test="resultInsertReason != null and resultInsertReason != ''">
  254. or RESULT_INSERT_REASON = #{resultInsertReason}
  255. </if>
  256. <if test="resultTransferTime != null">
  257. or TO_CHAR(RESULT_TRANSFER_TIME,'yyyy-MM-dd') = '#{resultTransferTime}'
  258. </if>
  259. <if test="resultTransferReason != null and resultTransferReason != ''">
  260. or RESULT_TRANSFER_REASON = #{resultTransferReason}
  261. </if>
  262. <if test="insertUsername != null and insertUsername != ''">
  263. or INSERT_USERNAME = #{insertUsername}
  264. </if>
  265. <if test="insertTime != null">
  266. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  267. </if>
  268. <if test="updateUsername != null and updateUsername != ''">
  269. or UPDATE_USERNAME = #{updateUsername}
  270. </if>
  271. <if test="updateTime != null">
  272. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  273. </if>
  274. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  275. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  276. </if>
  277. <if test="listId != null">
  278. or LIST_ID = #{listId}
  279. </if>
  280. <if test="areaId != null and areaId != ''">
  281. or AREA_ID = #{areaId}
  282. </if>
  283. <if test="isSpelling != null">
  284. or IS_SPELLING = #{isSpelling}
  285. </if>
  286. <if test="gatepostId != null">
  287. or GATEPOST_ID = #{gatepostId}
  288. </if>
  289. </delete>
  290. <insert id="insert" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  291. insert into QMS_QUEUE_RESULT (RESULT_ID, RESULT_TOTAL_ID, CAPACITY_ID,
  292. RESULT_APPLYFOR_TIME, RESULT_APPLYFOR_LOCATION,
  293. GRID_ID, RESULT_DOWN_TIME, RESULT_ACCEPT_TIME,
  294. RESULT_START_TIME, RESULT_END_TIME, RESULT_CANCEL_TIME,
  295. RESULT_CANCEL_REASON, RESULT_INSERT_TIME,
  296. RESULT_INSERT_REASON, RESULT_TRANSFER_TIME,
  297. RESULT_TRANSFER_REASON, INSERT_USERNAME, INSERT_TIME,
  298. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  299. LIST_ID, AREA_ID, IS_SPELLING,
  300. GATEPOST_ID)
  301. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL},
  302. #{resultApplyforTime,jdbcType=TIMESTAMP}, #{resultApplyforLocation,jdbcType=VARCHAR},
  303. #{gridId,jdbcType=DECIMAL}, #{resultDownTime,jdbcType=TIMESTAMP}, #{resultAcceptTime,jdbcType=TIMESTAMP},
  304. #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultCancelTime,jdbcType=TIMESTAMP},
  305. #{resultCancelReason,jdbcType=VARCHAR}, #{resultInsertTime,jdbcType=TIMESTAMP},
  306. #{resultInsertReason,jdbcType=VARCHAR}, #{resultTransferTime,jdbcType=TIMESTAMP},
  307. #{resultTransferReason,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  308. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  309. #{listId,jdbcType=DECIMAL}, #{areaId,jdbcType=VARCHAR}, #{isSpelling,jdbcType=DECIMAL},
  310. #{gatepostId,jdbcType=DECIMAL})
  311. </insert>
  312. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  313. insert into QMS_QUEUE_RESULT
  314. <trim prefix="(" suffix=")" suffixOverrides=",">
  315. <if test="resultId != null">
  316. RESULT_ID,
  317. </if>
  318. <if test="resultTotalId != null">
  319. RESULT_TOTAL_ID,
  320. </if>
  321. <if test="capacityId != null">
  322. CAPACITY_ID,
  323. </if>
  324. <if test="resultApplyforTime != null">
  325. RESULT_APPLYFOR_TIME,
  326. </if>
  327. <if test="resultApplyforLocation != null">
  328. RESULT_APPLYFOR_LOCATION,
  329. </if>
  330. <if test="gridId != null">
  331. GRID_ID,
  332. </if>
  333. <if test="resultDownTime != null">
  334. RESULT_DOWN_TIME,
  335. </if>
  336. <if test="resultAcceptTime != null">
  337. RESULT_ACCEPT_TIME,
  338. </if>
  339. <if test="resultStartTime != null">
  340. RESULT_START_TIME,
  341. </if>
  342. <if test="resultEndTime != null">
  343. RESULT_END_TIME,
  344. </if>
  345. <if test="resultCancelTime != null">
  346. RESULT_CANCEL_TIME,
  347. </if>
  348. <if test="resultCancelReason != null">
  349. RESULT_CANCEL_REASON,
  350. </if>
  351. <if test="resultInsertTime != null">
  352. RESULT_INSERT_TIME,
  353. </if>
  354. <if test="resultInsertReason != null">
  355. RESULT_INSERT_REASON,
  356. </if>
  357. <if test="resultTransferTime != null">
  358. RESULT_TRANSFER_TIME,
  359. </if>
  360. <if test="resultTransferReason != null">
  361. RESULT_TRANSFER_REASON,
  362. </if>
  363. <if test="insertUsername != null">
  364. INSERT_USERNAME,
  365. </if>
  366. <if test="insertTime != null">
  367. INSERT_TIME,
  368. </if>
  369. <if test="updateUsername != null">
  370. UPDATE_USERNAME,
  371. </if>
  372. <if test="updateTime != null">
  373. UPDATE_TIME,
  374. </if>
  375. <if test="insertUpdateRemark != null">
  376. INSERT_UPDATE_REMARK,
  377. </if>
  378. <if test="listId != null">
  379. LIST_ID,
  380. </if>
  381. <if test="areaId != null">
  382. AREA_ID,
  383. </if>
  384. <if test="isSpelling != null">
  385. IS_SPELLING,
  386. </if>
  387. <if test="gatepostId != null">
  388. GATEPOST_ID,
  389. </if>
  390. </trim>
  391. <trim prefix="values (" suffix=")" suffixOverrides=",">
  392. <if test="resultId != null">
  393. #{resultId,jdbcType=DECIMAL},
  394. </if>
  395. <if test="resultTotalId != null">
  396. #{resultTotalId,jdbcType=DECIMAL},
  397. </if>
  398. <if test="capacityId != null">
  399. #{capacityId,jdbcType=DECIMAL},
  400. </if>
  401. <if test="resultApplyforTime != null">
  402. #{resultApplyforTime,jdbcType=TIMESTAMP},
  403. </if>
  404. <if test="resultApplyforLocation != null">
  405. #{resultApplyforLocation,jdbcType=VARCHAR},
  406. </if>
  407. <if test="gridId != null">
  408. #{gridId,jdbcType=DECIMAL},
  409. </if>
  410. <if test="resultDownTime != null">
  411. #{resultDownTime,jdbcType=TIMESTAMP},
  412. </if>
  413. <if test="resultAcceptTime != null">
  414. #{resultAcceptTime,jdbcType=TIMESTAMP},
  415. </if>
  416. <if test="resultStartTime != null">
  417. #{resultStartTime,jdbcType=TIMESTAMP},
  418. </if>
  419. <if test="resultEndTime != null">
  420. #{resultEndTime,jdbcType=TIMESTAMP},
  421. </if>
  422. <if test="resultCancelTime != null">
  423. #{resultCancelTime,jdbcType=TIMESTAMP},
  424. </if>
  425. <if test="resultCancelReason != null">
  426. #{resultCancelReason,jdbcType=VARCHAR},
  427. </if>
  428. <if test="resultInsertTime != null">
  429. #{resultInsertTime,jdbcType=TIMESTAMP},
  430. </if>
  431. <if test="resultInsertReason != null">
  432. #{resultInsertReason,jdbcType=VARCHAR},
  433. </if>
  434. <if test="resultTransferTime != null">
  435. #{resultTransferTime,jdbcType=TIMESTAMP},
  436. </if>
  437. <if test="resultTransferReason != null">
  438. #{resultTransferReason,jdbcType=VARCHAR},
  439. </if>
  440. <if test="insertUsername != null">
  441. #{insertUsername,jdbcType=VARCHAR},
  442. </if>
  443. <if test="insertTime != null">
  444. #{insertTime,jdbcType=TIMESTAMP},
  445. </if>
  446. <if test="updateUsername != null">
  447. #{updateUsername,jdbcType=VARCHAR},
  448. </if>
  449. <if test="updateTime != null">
  450. #{updateTime,jdbcType=TIMESTAMP},
  451. </if>
  452. <if test="insertUpdateRemark != null">
  453. #{insertUpdateRemark,jdbcType=VARCHAR},
  454. </if>
  455. <if test="listId != null">
  456. #{listId,jdbcType=DECIMAL},
  457. </if>
  458. <if test="areaId != null">
  459. #{areaId,jdbcType=VARCHAR},
  460. </if>
  461. <if test="isSpelling != null">
  462. #{isSpelling,jdbcType=DECIMAL},
  463. </if>
  464. <if test="gatepostId != null">
  465. #{gatepostId,jdbcType=DECIMAL},
  466. </if>
  467. </trim>
  468. </insert>
  469. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  470. update QMS_QUEUE_RESULT
  471. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  472. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  473. RESULT_APPLYFOR_TIME = #{resultApplyforTime,jdbcType=TIMESTAMP},
  474. RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation,jdbcType=VARCHAR},
  475. GRID_ID = #{gridId,jdbcType=DECIMAL},
  476. RESULT_DOWN_TIME = #{resultDownTime,jdbcType=TIMESTAMP},
  477. RESULT_ACCEPT_TIME = #{resultAcceptTime,jdbcType=TIMESTAMP},
  478. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  479. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  480. RESULT_CANCEL_TIME = #{resultCancelTime,jdbcType=TIMESTAMP},
  481. RESULT_CANCEL_REASON = #{resultCancelReason,jdbcType=VARCHAR},
  482. RESULT_INSERT_TIME = #{resultInsertTime,jdbcType=TIMESTAMP},
  483. RESULT_INSERT_REASON = #{resultInsertReason,jdbcType=VARCHAR},
  484. RESULT_TRANSFER_TIME = #{resultTransferTime,jdbcType=TIMESTAMP},
  485. RESULT_TRANSFER_REASON = #{resultTransferReason,jdbcType=VARCHAR},
  486. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  487. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  488. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  489. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  490. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  491. LIST_ID = #{listId,jdbcType=DECIMAL},
  492. AREA_ID = #{areaId,jdbcType=VARCHAR},
  493. IS_SPELLING = #{isSpelling,jdbcType=DECIMAL},
  494. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL}
  495. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  496. </update>
  497. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  498. update QMS_QUEUE_RESULT
  499. <set>
  500. <if test="resultTotalId != null">
  501. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  502. </if>
  503. <if test="capacityId != null">
  504. CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
  505. </if>
  506. <if test="resultApplyforTime != null">
  507. RESULT_APPLYFOR_TIME = #{resultApplyforTime,jdbcType=TIMESTAMP},
  508. </if>
  509. <if test="resultApplyforLocation != null">
  510. RESULT_APPLYFOR_LOCATION = #{resultApplyforLocation,jdbcType=VARCHAR},
  511. </if>
  512. <if test="gridId != null">
  513. GRID_ID = #{gridId,jdbcType=DECIMAL},
  514. </if>
  515. <if test="resultDownTime != null">
  516. RESULT_DOWN_TIME = #{resultDownTime,jdbcType=TIMESTAMP},
  517. </if>
  518. <if test="resultAcceptTime != null">
  519. RESULT_ACCEPT_TIME = #{resultAcceptTime,jdbcType=TIMESTAMP},
  520. </if>
  521. <if test="resultStartTime != null">
  522. RESULT_START_TIME = #{resultStartTime,jdbcType=TIMESTAMP},
  523. </if>
  524. <if test="resultEndTime != null">
  525. RESULT_END_TIME = #{resultEndTime,jdbcType=TIMESTAMP},
  526. </if>
  527. <if test="resultCancelTime != null">
  528. RESULT_CANCEL_TIME = #{resultCancelTime,jdbcType=TIMESTAMP},
  529. </if>
  530. <if test="resultCancelReason != null">
  531. RESULT_CANCEL_REASON = #{resultCancelReason,jdbcType=VARCHAR},
  532. </if>
  533. <if test="resultInsertTime != null">
  534. RESULT_INSERT_TIME = #{resultInsertTime,jdbcType=TIMESTAMP},
  535. </if>
  536. <if test="resultInsertReason != null">
  537. RESULT_INSERT_REASON = #{resultInsertReason,jdbcType=VARCHAR},
  538. </if>
  539. <if test="resultTransferTime != null">
  540. RESULT_TRANSFER_TIME = #{resultTransferTime,jdbcType=TIMESTAMP},
  541. </if>
  542. <if test="resultTransferReason != null">
  543. RESULT_TRANSFER_REASON = #{resultTransferReason,jdbcType=VARCHAR},
  544. </if>
  545. <if test="insertUsername != null">
  546. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  547. </if>
  548. <if test="insertTime != null">
  549. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  550. </if>
  551. <if test="updateUsername != null">
  552. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  553. </if>
  554. <if test="updateTime != null">
  555. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  556. </if>
  557. <if test="insertUpdateRemark != null">
  558. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  559. </if>
  560. <if test="listId != null">
  561. LIST_ID = #{listId,jdbcType=DECIMAL},
  562. </if>
  563. <if test="areaId != null">
  564. AREA_ID = #{areaId,jdbcType=VARCHAR},
  565. </if>
  566. <if test="isSpelling != null">
  567. IS_SPELLING = #{isSpelling,jdbcType=DECIMAL},
  568. </if>
  569. <if test="gatepostId != null">
  570. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  571. </if>
  572. </set>
  573. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  574. </update>
  575. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  576. <include refid="select" />
  577. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  578. </select>
  579. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  580. <include refid="select" />
  581. <include refid="where" />
  582. </select>
  583. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  584. <include refid="select" />
  585. <include refid="whereLike" />
  586. </select>
  587. <insert id="batchInsert" parameterType="java.util.List">
  588. insert into QMS_QUEUE_RESULT
  589. (RESULT_ID,
  590. RESULT_TOTAL_ID, CAPACITY_ID, RESULT_APPLYFOR_TIME,
  591. RESULT_APPLYFOR_LOCATION, GRID_ID,
  592. RESULT_DOWN_TIME, RESULT_ACCEPT_TIME,
  593. RESULT_START_TIME, RESULT_END_TIME,
  594. RESULT_CANCEL_TIME, RESULT_CANCEL_REASON,
  595. RESULT_INSERT_TIME, RESULT_INSERT_REASON,
  596. RESULT_TRANSFER_TIME, RESULT_TRANSFER_REASON,
  597. INSERT_USERNAME, INSERT_TIME,
  598. UPDATE_USERNAME, UPDATE_TIME,
  599. INSERT_UPDATE_REMARK, LIST_ID, AREA_ID,
  600. IS_SPELLING, GATEPOST_ID)
  601. ( <foreach collection="list" item="item" separator="union all">
  602. select
  603. #{item.resultId,jdbcType=DECIMAL},
  604. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.capacityId,jdbcType=DECIMAL}, #{item.resultApplyforTime,jdbcType=TIMESTAMP},
  605. #{item.resultApplyforLocation,jdbcType=VARCHAR}, #{item.gridId,jdbcType=DECIMAL},
  606. #{item.resultDownTime,jdbcType=TIMESTAMP}, #{item.resultAcceptTime,jdbcType=TIMESTAMP},
  607. #{item.resultStartTime,jdbcType=TIMESTAMP}, #{item.resultEndTime,jdbcType=TIMESTAMP},
  608. #{item.resultCancelTime,jdbcType=TIMESTAMP}, #{item.resultCancelReason,jdbcType=VARCHAR},
  609. #{item.resultInsertTime,jdbcType=TIMESTAMP}, #{item.resultInsertReason,jdbcType=VARCHAR},
  610. #{item.resultTransferTime,jdbcType=TIMESTAMP}, #{item.resultTransferReason,jdbcType=VARCHAR},
  611. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  612. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  613. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.listId,jdbcType=DECIMAL}, #{item.areaId,jdbcType=VARCHAR},
  614. #{item.isSpelling,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL} from dual
  615. </foreach> )
  616. </insert>
  617. <update id="batchUpdate" parameterType="java.util.List">
  618. update QMS_QUEUE_RESULT
  619. set
  620. RESULT_ID=
  621. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  622. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  623. </foreach>
  624. ,RESULT_TOTAL_ID=
  625. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  626. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  627. </foreach>
  628. ,CAPACITY_ID=
  629. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  630. when #{item.resultId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
  631. </foreach>
  632. ,RESULT_APPLYFOR_TIME=
  633. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  634. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApplyforTime,jdbcType=TIMESTAMP}
  635. </foreach>
  636. ,RESULT_APPLYFOR_LOCATION=
  637. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  638. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultApplyforLocation,jdbcType=VARCHAR}
  639. </foreach>
  640. ,GRID_ID=
  641. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  642. when #{item.resultId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
  643. </foreach>
  644. ,RESULT_DOWN_TIME=
  645. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  646. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultDownTime,jdbcType=TIMESTAMP}
  647. </foreach>
  648. ,RESULT_ACCEPT_TIME=
  649. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  650. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultAcceptTime,jdbcType=TIMESTAMP}
  651. </foreach>
  652. ,RESULT_START_TIME=
  653. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  654. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultStartTime,jdbcType=TIMESTAMP}
  655. </foreach>
  656. ,RESULT_END_TIME=
  657. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  658. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEndTime,jdbcType=TIMESTAMP}
  659. </foreach>
  660. ,RESULT_CANCEL_TIME=
  661. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  662. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCancelTime,jdbcType=TIMESTAMP}
  663. </foreach>
  664. ,RESULT_CANCEL_REASON=
  665. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  666. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultCancelReason,jdbcType=VARCHAR}
  667. </foreach>
  668. ,RESULT_INSERT_TIME=
  669. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  670. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultInsertTime,jdbcType=TIMESTAMP}
  671. </foreach>
  672. ,RESULT_INSERT_REASON=
  673. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  674. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultInsertReason,jdbcType=VARCHAR}
  675. </foreach>
  676. ,RESULT_TRANSFER_TIME=
  677. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  678. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTransferTime,jdbcType=TIMESTAMP}
  679. </foreach>
  680. ,RESULT_TRANSFER_REASON=
  681. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  682. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTransferReason,jdbcType=VARCHAR}
  683. </foreach>
  684. ,INSERT_USERNAME=
  685. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  686. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  687. </foreach>
  688. ,INSERT_TIME=
  689. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  690. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  691. </foreach>
  692. ,UPDATE_USERNAME=
  693. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  694. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  695. </foreach>
  696. ,UPDATE_TIME=
  697. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  698. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  699. </foreach>
  700. ,INSERT_UPDATE_REMARK=
  701. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  702. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  703. </foreach>
  704. ,LIST_ID=
  705. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  706. when #{item.resultId,jdbcType=DECIMAL} then #{item.listId,jdbcType=DECIMAL}
  707. </foreach>
  708. ,AREA_ID=
  709. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  710. when #{item.resultId,jdbcType=DECIMAL} then #{item.areaId,jdbcType=VARCHAR}
  711. </foreach>
  712. ,IS_SPELLING=
  713. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  714. when #{item.resultId,jdbcType=DECIMAL} then #{item.isSpelling,jdbcType=DECIMAL}
  715. </foreach>
  716. ,GATEPOST_ID=
  717. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  718. when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
  719. </foreach>
  720. where RESULT_ID in
  721. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  722. #{item.resultId,jdbcType=DECIMAL}
  723. </foreach>
  724. </update>
  725. <delete id="batchDelete" parameterType="java.util.List">
  726. delete from QMS_QUEUE_RESULT
  727. where RESULT_ID in
  728. <foreach close=")" collection="list" item="id" open="(" separator=",">
  729. #{id}
  730. </foreach>
  731. </delete>
  732. <!-- 友情提示!!!-->
  733. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  734. <!-- 排序 -->
  735. <sql id="orderBy">
  736. <if test="orderField != null and orderField != ''">
  737. order by "${orderField}"
  738. <if test="orderType != null and orderType != ''">
  739. ${orderType}
  740. </if>
  741. </if>
  742. </sql>
  743. <!-- 车辆进入电子围栏后触发排队申请 -->
  744. <select id="queryCIdAndTIdByOrderNumber" parameterType="string" resultType="java.util.Map">
  745. select OO.ORDER_ID "orderId",
  746. OO.CAPACITY_ID "capacityId",
  747. TTR.RESULT_TOTAL_ID "resultTotalId",
  748. OO.ORDER_TYPE "orderType"
  749. from OMSTRUCK_ORDER OO
  750. left join TMSTRUCK_TOTAL_RESULT TTR
  751. on TTR.ORDER_ID = OO.ORDER_ID
  752. where OO.ORDER_NUMBER = #{orderNumber}
  753. </select>
  754. <!-- 人工添加排队申请查询所有执行中订单 订单状态 :1 -->
  755. <!-- <select id="getAllExecutionOrder" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  756. <!-- select *-->
  757. <!-- from (-->
  758. <!-- select OO.ORDER_ID "orderId",-->
  759. <!-- OO.ORDER_NUMBER "orderNumber",-->
  760. <!-- OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",-->
  761. <!-- RM.MATERIAL_NAME "materialName",-->
  762. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  763. <!-- RCD.DRIVER_NAME "driverName",-->
  764. <!-- OO.INSERT_TIME "insertTime"-->
  765. <!-- from OMSTRUCK_ORDER OO-->
  766. <!-- join OMSTRUCK_ORDER_MATERIAL OOM-->
  767. <!-- on OOM.ORDER_ID = OO.ORDER_ID-->
  768. <!-- join RMS_MATERIAL RM-->
  769. <!-- on RM.MATERIAL_ID = OOM.ORDER_MATERIAL_ID-->
  770. <!-- join RMS_CAPACITY RC-->
  771. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  772. <!-- join RMS_DRIVER_CAPACITY RDC-->
  773. <!-- on RDC.CAPACITY_ID = RC.CAPACITY_ID-->
  774. <!-- join RMS_CAR_DRIVER RCD-->
  775. <!-- on RDC.DRIVER_ID = RCD.DRIVER_ID-->
  776. <!-- join TMSTRUCK_TOTAL_RESULT TTR-->
  777. <!-- on TTR.ORDER_ID = OO.ORDER_ID-->
  778. <!-- where OO.ORDER_STATUS = #{orderStatus}-->
  779. <!-- and OO.ORDER_TYPE = #{orderTypee}-->
  780. <!-- and TTR.RESULT_TOTAL_ID not in (select QQR.RESULT_TOTAL_ID from QMS_QUEUE_RESULT QQR)-->
  781. <!-- )-->
  782. <!-- <where>-->
  783. <!-- <if test="orderNumber != null">-->
  784. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  785. <!-- "orderNumber" like '%${item}%'-->
  786. <!-- </foreach>-->
  787. <!-- </if>-->
  788. <!-- <if test="orderMaterialWeight != null">-->
  789. <!-- and-->
  790. <!-- <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">-->
  791. <!-- "orderMaterialWeight" like '%${item}%'-->
  792. <!-- </foreach>-->
  793. <!-- </if>-->
  794. <!-- <if test="materialName != null">-->
  795. <!-- and-->
  796. <!-- <foreach collection="materialName" item="item" open="(" separator="or" close=")">-->
  797. <!-- "materialName" like '%${item}%'-->
  798. <!-- </foreach>-->
  799. <!-- </if>-->
  800. <!-- <if test="capacityNumber != null">-->
  801. <!-- and-->
  802. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  803. <!-- "capacityNumber" like '%${item}%'-->
  804. <!-- </foreach>-->
  805. <!-- </if>-->
  806. <!-- <if test="driverName != null">-->
  807. <!-- and-->
  808. <!-- <foreach collection="driverName" item="item" open="(" separator="or" close=")">-->
  809. <!-- "driverName" like '%${item}%'-->
  810. <!-- </foreach>-->
  811. <!-- </if>-->
  812. <!-- </where>-->
  813. <!-- <include refid="orderBy"></include>-->
  814. <!-- <if test="orderField == null ">-->
  815. <!-- order by "insertTime" desc-->
  816. <!-- </if>-->
  817. <!-- </select>-->
  818. <!-- 根据运单Id查询物资Id-->
  819. <select id="queryOrderMesByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  820. select OOM.MATERIAL_ID "materialId"
  821. from OMSTRUCK_ORDER OO
  822. left join OMSTRUCK_ORDER_MATERIAL OOM
  823. on OO.ORDER_ID = OOM.ORDER_ID
  824. where OO.ORDER_ID = #{orderId}
  825. </select>
  826. <!-- 通过门岗名称查询门岗ID -->
  827. <!-- <select id="getGatepostIdByGatepostName" parameterType="string" resultType="java.math.BigDecimal">-->
  828. <!-- select RG.GATEPOST_ID "gatepostId"-->
  829. <!-- from RMS_GATEPOST RG-->
  830. <!-- where RG.GATEPOST_NAME = #{gatepostName}-->
  831. <!-- </select>-->
  832. <!-- 通过门岗名称查询门岗ID -->
  833. <!-- <select id="getPlatformIdByPlatformName" parameterType="string" resultType="java.math.BigDecimal">-->
  834. <!-- select RPP.PLATFORM_ID-->
  835. <!-- from RMS_PWAREHOUSE_PLATFORM RPP-->
  836. <!-- where RPP.PLATFORM_NAME = #{platformName}-->
  837. <!-- </select>-->
  838. <!-- 查询排队开始 -->
  839. <select id="getQueueListByQueueUp" parameterType="java.util.Map" resultType="java.util.Map">
  840. SELECT P0.*,ROWNUM "ROW_ID" FROM (
  841. SELECT
  842. QQR.RESULT_ID "resultId",
  843. QQR.RESULT_TOTAL_ID "resultTotalId",
  844. QQR.RESULT_START_TIME "resultStartTime",
  845. RCE.CONSIGNEE_COMPANY_NAME "consigneeName",
  846. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "grid",
  847. RM.MATERIAL_ID "materialId",
  848. RM.MATERIAL_NAME "materialName",
  849. RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')' "materialSpecification",
  850. RM.MATERIAL_MODEL "materialModel",
  851. QQL.LIST_ID "listId",
  852. RC.CAPACITY_NUMBER "capacityNumber",
  853. RC.CAPACITY_ID "capacityId",
  854. QQL.ENTRY_SURE_TIME "sureTime",
  855. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  856. OOM.MATERIAL_PRIORITY "id",
  857. OO.DRIVER_TEL "driverTel",
  858. OO.ORDER_ID "orderId",
  859. RG.GATEPOST_NAME "gatepostName",
  860. ASM.STEEL_METER "steelMeter",
  861. (
  862. select COUNT(QQL2.LIST_ID)
  863. from QMS_QUEUE_LIST QQL2
  864. where QQL2.GRID_ID = QQL.GRID_ID
  865. and QQL2.LIST_NODE_ORDER &lt;= QQL.LIST_NODE_ORDER
  866. ) || (case when QQL.IS_VIP is not null then ' 优先进厂' else '' end ) "listNodeOrder"
  867. FROM QMS_QUEUE_LIST QQL
  868. LEFT JOIN QMS_QUEUE_RESULT QQR ON QQL.QUEUE_RESULT_ID = QQR.RESULT_ID
  869. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  870. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON TTR.ORDER_ID = OOM.ORDER_ID
  871. LEFT JOIN RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
  872. LEFT JOIN RMS_CAPACITY RC ON QQL.CAPACITY_ID = RC.CAPACITY_ID
  873. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  874. LEFT JOIN RMS_GATEPOST RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
  875. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  876. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  877. LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
  878. LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
  879. ON ASTM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
  880. LEFT JOIN AMS_SALE_MATERIAL ASM
  881. ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
  882. where oo.ORDER_STATUS = 5
  883. AND ASO.SALE_ORDER_STATUS = 4
  884. AND RM.MATERIAL_ID||'' NOT IN (SELECT DISTINCT SPECTIONS_MODEL FROM QMS_MODEL_UNROOLED)
  885. <if test="capacityNumber != null">
  886. and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
  887. </if>
  888. <if test="materialList != null">
  889. and RM.MATERIAL_ID in
  890. <foreach collection="materialList" item="item" open="(" separator="," close=")">
  891. ${item}
  892. </foreach>
  893. </if>
  894. <if test="locationId != null">
  895. and QQL.GRID_ID = #{locationId}
  896. ORDER BY QQL.ENTRY_SURE_TIME DESC, QQL.IS_VIP, "listNodeOrder"
  897. </if>
  898. <if test="locationId == null">
  899. ORDER BY QQL.ENTRY_SURE_TIME DESC, QQR.RESULT_START_TIME
  900. </if>
  901. ) P0
  902. </select>
  903. <!--查询已派车车数-->
  904. <select id="querySentCarNumber" resultType="java.lang.Integer">
  905. select
  906. count(*) ORDER_ID
  907. from OMSTRUCK_ORDER OO
  908. where OO.ORDER_TYPE=1
  909. and to_char(OO.INSERT_TIME,'yyyy-mm-dd hh24:mi:ss')
  910. between to_char(trunc(sysdate,'dd'),'yyyy-mm-dd hh24:mi:ss')
  911. and to_char(trunc(sysdate,'dd')+23/24+59/24/60+59/24/60/60,'yyyy-mm-dd hh24:mi:ss')
  912. </select>
  913. <!--查询已扫码进厂车数-->
  914. <select id="queryIntoFactoryNumber" resultType="java.lang.Integer">
  915. select COUNT(*) RESULT_ID
  916. from OMSTRUCK_ORDER OO
  917. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  918. ON TTR.ORDER_ID=OO.ORDER_ID
  919. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  920. ON TER.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  921. LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  922. ON TLFR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  923. where OO.ORDER_TYPE =1
  924. and TER.INSERT_TIME IS NOT NULL
  925. and to_char(OO.INSERT_TIME,'yyyy-mm-dd hh24:mi:ss')
  926. between to_char(trunc(sysdate,'dd'),'yyyy-mm-dd hh24:mi:ss')
  927. and to_char(trunc(sysdate,'dd')+23/24+59/24/60+59/24/60/60,'yyyy-mm-dd hh24:mi:ss')
  928. </select>
  929. <!--查询已扫码出厂车数-->
  930. <select id="queryLeaveFactoryNumber" resultType="java.lang.Integer">
  931. select COUNT(*) RESULT_ID
  932. from OMSTRUCK_ORDER OO
  933. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  934. ON TTR.ORDER_ID=OO.ORDER_ID
  935. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  936. ON TER.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  937. LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  938. ON TLFR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  939. where OO.ORDER_TYPE =1
  940. and TER.INSERT_TIME IS NOT NULL
  941. and TLFR.INSERT_TIME IS NOT NULL
  942. and to_char(OO.INSERT_TIME,'yyyy-mm-dd hh24:mi:ss')
  943. between to_char(trunc(sysdate,'dd'),'yyyy-mm-dd hh24:mi:ss')
  944. and to_char(trunc(sysdate,'dd')+23/24+59/24/60+59/24/60/60,'yyyy-mm-dd hh24:mi:ss')
  945. </select>
  946. <!--查询待进厂车数-->
  947. <update id="updateCancelResult" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  948. update QMS_QUEUE_RESULT
  949. set RESULT_CANCEL_TIME = SYSDATE,
  950. RESULT_START_TIME = null,
  951. RESULT_CANCEL_REASON = #{resultCancelReason}
  952. where RESULT_ID = #{resultId}
  953. </update>
  954. <select id="getQueueListByQueueUpSpelling" parameterType="map" resultType="java.util.LinkedHashMap">
  955. select QQR.RESULT_ID "resultId",
  956. QQR.RESULT_TOTAL_ID "resultTotalId",
  957. QQR.RESULT_START_TIME "resultStartTime",
  958. RC.CAPACITY_NUMBER "capacityNumber",
  959. QQSL.SPELILING_NUM "grid",
  960. QQSL.SPELLING_RESULT_ID "spellingResultId",
  961. RM.MATERIAL_ID "materialId",
  962. RM.MATERIAL_NAME "materialName",
  963. RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')' "materialSpecification",
  964. RC.CAPACITY_ID "capacityId",
  965. RM.MATERIAL_MODEL "materialModel",
  966. QQSL.ENTRY_SURE_TIME "sureTime",
  967. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  968. OOM.MATERIAL_PRIORITY "id",
  969. OO.DRIVER_TEL "driverTel",
  970. OO.ORDER_ID "orderId",
  971. RG.GATEPOST_NAME "gatepostName",
  972. RCE.CONSIGNEE_COMPANY_NAME "consigneeName",
  973. (
  974. select count(QQSL2.SPELLING_RESULT_ID) from QMS_QUEUE_SPELLING_LIST QQSL2
  975. where QQSL.SPELILING_NUM = QQSL2.SPELILING_NUM
  976. and QQSL.SPELLING_SURE_TIME &lt;= QQSL2.SPELLING_SURE_TIME
  977. ) "listNodeOrder"
  978. from QMS_QUEUE_SPELLING_LIST QQSL
  979. left join QMS_QUEUE_RESULT QQR ON QQSL.QUEUE_RESULT_ID = QQR.RESULT_ID
  980. left join RMS_CAPACITY RC ON QQR.CAPACITY_ID = RC.CAPACITY_ID
  981. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  982. left join OMSTRUCK_ORDER_MATERIAL OOM on TTR.ORDER_ID = OOM.ORDER_ID
  983. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  984. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  985. LEFT JOIN RMS_GATEPOST RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
  986. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  987. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  988. LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
  989. where oo.ORDER_STATUS = 5
  990. AND ASO.SALE_ORDER_STATUS = 4
  991. AND OO.ORDER_ID NOT IN (
  992. select OO.ORDER_ID
  993. from OMSTRUCK_ORDER OO
  994. left join OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID=OOM.ORDER_ID
  995. left join RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
  996. where OO.ORDER_STATUS=5 and
  997. RM.MATERIAL_ID||'' in (select SPECTIONS_MODEL from QMS_MODEL_UNROOLED)
  998. )
  999. <if test="capacityNumber != null">
  1000. and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
  1001. </if>
  1002. <if test="materialList != null">
  1003. and
  1004. EXISTS (
  1005. SELECT OO2.ORDER_ID
  1006. from OMSTRUCK_ORDER OO2 left join OMSTRUCK_ORDER_MATERIAL OOM2 on OO2.ORDER_ID = OOM2.ORDER_ID
  1007. where OO2.ORDER_ID = OO.ORDER_ID and OOM2.MATERIAL_ID in
  1008. <foreach collection="materialList" item="item" open="(" separator="," close=")">
  1009. ${item}
  1010. </foreach>
  1011. )
  1012. </if>
  1013. <if test="locationId != null">
  1014. and QQSL.SPELILING_NUM = #{locationId}
  1015. ORDER BY QQSL.ENTRY_SURE_TIME DESC, QQSL.IS_VIP, "listNodeOrder"
  1016. </if>
  1017. <if test="locationId == null">
  1018. ORDER BY QQSL.ENTRY_SURE_TIME DESC, QQR.RESULT_START_TIME
  1019. </if>
  1020. </select>
  1021. <select id="getMaterialId" resultType="java.util.Map">
  1022. select
  1023. distinct
  1024. AMS.MATERIAL_ID "materialId",
  1025. AMS.STEEL_METER "steelmeter"
  1026. from OMSTRUCK_ORDER_MATERIAL OOM
  1027. LEFT JOIN OMSTRUCK_ORDER OO
  1028. ON OO.ORDER_ID = OOM.ORDER_ID
  1029. LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
  1030. ON ASTM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  1031. LEFT JOIN AMS_SALE_MATERIAL AMS
  1032. ON AMS.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
  1033. WHERE OOM.ORDER_ID=#{orderId}
  1034. </select>
  1035. <!-- 查看进厂排队详情 -->
  1036. <!-- <select id="getQueueMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  1037. <!-- select *-->
  1038. <!-- from (-->
  1039. <!-- select-->
  1040. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1041. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1042. <!-- RG.GATEPOST_NAME "gatepostName",-->
  1043. <!-- (-->
  1044. <!-- <![CDATA[-->
  1045. <!-- select-->
  1046. <!-- count(*)-->
  1047. <!-- from-->
  1048. <!-- QMS_QUEUE_LIST QQL2-->
  1049. <!-- join QMS_QUEUE_GRID QQG2-->
  1050. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1051. <!-- where-->
  1052. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1053. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1054. <!-- and QQL2.DELETED = 0-->
  1055. <!-- ]]>-->
  1056. <!-- ) "listNodeOrder",-->
  1057. <!-- QQR.RESULT_ID "resultId",-->
  1058. <!-- QQL.LIST_ID "listId",-->
  1059. <!-- RC.CAPACITY_VIP "capacityVip",-->
  1060. <!-- QQR.RESULT_START_TIME "resultStartTime"-->
  1061. <!-- from OMSTRUCK_ORDER OO-->
  1062. <!-- left join RMS_CAPACITY RC-->
  1063. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1064. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1065. <!-- on TTR.ORDER_ID = OO.ORDER_ID-->
  1066. <!-- left join QMS_QUEUE_RESULT QQR-->
  1067. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1068. <!-- left join QMS_QUEUE_LIST QQL-->
  1069. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1070. <!-- left join QMS_QUEUE_GRID QQG-->
  1071. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1072. <!-- left join RMS_GATEPOST RG-->
  1073. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  1074. <!-- where-->
  1075. <!-- QQR.RESULT_START_TIME is not null-->
  1076. <!-- and QQL.DELETED = 0-->
  1077. <!-- <if test="orderNum != null">-->
  1078. <!-- and OO.ORDER_NUMBER = #{orderNum}-->
  1079. <!-- </if>-->
  1080. <!-- <if test="gatepostId != null">-->
  1081. <!-- and RG.GATEPOST_ID = #{gatepostId}-->
  1082. <!-- </if>-->
  1083. <!-- )-->
  1084. <!-- <where>-->
  1085. <!-- <if test="orderNumber != null">-->
  1086. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1087. <!-- "orderNumber" like '%${item}%'-->
  1088. <!-- </foreach>-->
  1089. <!-- </if>-->
  1090. <!-- <if test="capacityNumber != null">-->
  1091. <!-- and-->
  1092. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1093. <!-- "capacityNumber" like '%${item}%'-->
  1094. <!-- </foreach>-->
  1095. <!-- </if>-->
  1096. <!-- <if test="platformName != null">-->
  1097. <!-- and-->
  1098. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1099. <!-- "platformName" like '%${item}%'-->
  1100. <!-- </foreach>-->
  1101. <!-- </if>-->
  1102. <!-- <if test="listNodeOrder != null">-->
  1103. <!-- and-->
  1104. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1105. <!-- "listNodeOrder" like '%${item}%'-->
  1106. <!-- </foreach>-->
  1107. <!-- </if>-->
  1108. <!-- <if test="capacityVip != null">-->
  1109. <!-- and-->
  1110. <!-- <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">-->
  1111. <!-- "capacityVip" like '%${item}%'-->
  1112. <!-- </foreach>-->
  1113. <!-- </if>-->
  1114. <!-- </where>-->
  1115. <!-- <include refid="orderBy"></include>-->
  1116. <!-- <if test="orderField == null ">-->
  1117. <!-- order by "gatepostName" desc, "listNodeOrder" asc-->
  1118. <!-- </if>-->
  1119. <!-- </select>-->
  1120. <!-- 查询排队申请 一对多由前端处理 -->
  1121. <select id="getQueueApply" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1122. select
  1123. QQR.RESULT_ID "resultId",
  1124. OO.ORDER_NUMBER "orderNumber",
  1125. RC.CAPACITY_NUMBER "capacityNumber",
  1126. QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
  1127. QQR.RESULT_DOWN_TIME "resultDownTime",
  1128. RM.MATERIAL_NAME "materialName",
  1129. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1130. RM.MATERIAL_MODEL "materialModel",
  1131. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber"
  1132. from QMS_QUEUE_RESULT QQR
  1133. left join TMSTRUCK_TOTAL_RESULT TTR on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
  1134. left join OMSTRUCK_ORDER OO on OO.ORDER_ID = TTR.ORDER_ID
  1135. left join RMS_CAPACITY RC on RC.CAPACITY_ID = QQR.CAPACITY_ID
  1136. left join QMS_QUEUE_GRID QQG on QQG.GRID_ID = QQR.GRID_ID
  1137. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1138. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1139. <where>
  1140. <if test="index != null">
  1141. instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1142. </if>
  1143. <if test="oneDate != null">
  1144. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_DOWN_TIME
  1145. </if>
  1146. <if test="startDate != null">
  1147. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_DOWN_TIME
  1148. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_DOWN_TIME
  1149. </if>
  1150. </where>
  1151. </select>
  1152. <!-- 通过接收时间判断是否已接收 查询判断条件:是否结束进厂 -->
  1153. <!-- <select id="getOrderReceive" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1154. <!-- select-->
  1155. <!-- *-->
  1156. <!-- from QMS_QUEUE_RESULT QQR-->
  1157. <!-- left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1158. <!-- </select>-->
  1159. <!-- 通过实绩Id查询链表ID -->
  1160. <select id="getListIdByResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  1161. select LIST_ID "listId",
  1162. CAPACITY_ID "capacityId"
  1163. from QMS_QUEUE_RESULT QQR
  1164. where QQR.RESULT_ID = #{resultId}
  1165. </select>
  1166. <!-- 查看排队转移详情 -->
  1167. <!-- <select id="getChangeQueueMes" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1168. <!-- select-->
  1169. <!-- *-->
  1170. <!-- from(-->
  1171. <!-- select-->
  1172. <!-- QQR.RESULT_ID "resultId",-->
  1173. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1174. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1175. <!-- RG1.GATEPOST_NAME "gatepostName1",-->
  1176. <!-- RG2.GATEPOST_NAME "gatepostName2",-->
  1177. <!-- QQR.RESULT_TRANSFER_TIME "resultTransferTime",-->
  1178. <!-- QQR.RESULT_TRANSFER_REASON "resultTransferReason",-->
  1179. <!-- (-->
  1180. <!-- <![CDATA[-->
  1181. <!-- select-->
  1182. <!-- count(*)-->
  1183. <!-- from-->
  1184. <!-- QMS_QUEUE_LIST QL-->
  1185. <!-- join QMS_QUEUE_GRID QG-->
  1186. <!-- on QG.GRID_ID = QL.GRID_ID-->
  1187. <!-- where-->
  1188. <!-- QL.LIST_NODE_ORDER <= QQL.list_node_order-->
  1189. <!-- and QL.GRID_ID = QQL.GRID_ID-->
  1190. <!-- and QL.DELETED = 0-->
  1191. <!-- ]]>-->
  1192. <!-- ) "listNodeOrder"-->
  1193. <!-- from QMS_QUEUE_RESULT QQR-->
  1194. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1195. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1196. <!-- left join OMSTRUCK_ORDER OO-->
  1197. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1198. <!-- left join RMS_CAPACITY RC-->
  1199. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1200. <!-- left join QMS_QUEUE_LIST QQL-->
  1201. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  1202. <!-- left join QMS_QUEUE_GRID QQG1 &#45;&#45;转移后门岗ID-->
  1203. <!-- on QQG1.GRID_ID = QQL.GRID_ID-->
  1204. <!-- left join RMS_GATEPOST RG1 &#45;&#45;转移后门岗-->
  1205. <!-- on QQG1.QUEUE_LOCATION_ID = RG1.GATEPOST_ID-->
  1206. <!-- left join QMS_QUEUE_GRID QQG2 &#45;&#45; 转移前门岗ID-->
  1207. <!-- on QQG2.GRID_ID = QQR.GRID_ID-->
  1208. <!-- left join RMS_GATEPOST RG2 &#45;&#45;转移前门岗-->
  1209. <!-- on RG2.GATEPOST_ID = QQG2.QUEUE_LOCATION_ID-->
  1210. <!-- where QQR.RESULT_TRANSFER_TIME is not null-->
  1211. <!--&#45;&#45; and QQL.DELETED = 0-->
  1212. <!-- and QQG1.GRID_TYPE = 3-->
  1213. <!-- )-->
  1214. <!-- <where>-->
  1215. <!-- <if test="orderNumber != null">-->
  1216. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1217. <!-- "orderNumber" like '%${item}%'-->
  1218. <!-- </foreach>-->
  1219. <!-- </if>-->
  1220. <!-- <if test="capacityNumber != null">-->
  1221. <!-- and-->
  1222. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1223. <!-- "capacityNumber" like '%${item}%'-->
  1224. <!-- </foreach>-->
  1225. <!-- </if>-->
  1226. <!-- <if test="gatepostName1 != null">-->
  1227. <!-- and-->
  1228. <!-- <foreach collection="gatepostName1" item="item" open="(" separator="or" close=")">-->
  1229. <!-- "gatepostName1" like '%${item}%'-->
  1230. <!-- </foreach>-->
  1231. <!-- </if>-->
  1232. <!-- <if test="gatepostName2 != null">-->
  1233. <!-- and-->
  1234. <!-- <foreach collection="gatepostName2" item="item" open="(" separator="or" close=")">-->
  1235. <!-- "gatepostName2" like '%${item}%'-->
  1236. <!-- </foreach>-->
  1237. <!-- </if>-->
  1238. <!-- <if test="resultTransferTime != null">-->
  1239. <!-- and-->
  1240. <!-- <foreach collection="resultTransferTime" item="item" open="(" separator="or" close=")">-->
  1241. <!-- "resultTransferTime" like '%${item}%'-->
  1242. <!-- </foreach>-->
  1243. <!-- </if>-->
  1244. <!-- <if test="resultTransferReason != null">-->
  1245. <!-- and-->
  1246. <!-- <foreach collection="resultTransferReason" item="item" open="(" separator="or" close=")">-->
  1247. <!-- "resultTransferReason" like '%${item}%'-->
  1248. <!-- </foreach>-->
  1249. <!-- </if>-->
  1250. <!-- </where>-->
  1251. <!-- <include refid="orderBy"></include>-->
  1252. <!-- <if test="orderField == null ">-->
  1253. <!-- order by "resultTransferTime" desc-->
  1254. <!-- </if>-->
  1255. <!-- </select>-->
  1256. <!-- 查询排队取消 -->
  1257. <select id="getQueueCancel" parameterType="java.util.Map" resultType="java.util.Map">
  1258. select
  1259. QQR.RESULT_ID "resultId",
  1260. OO.ORDER_NUMBER "orderNumber",
  1261. RC.CAPACITY_NUMBER "capacityNumber",
  1262. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1263. QQR.RESULT_CANCEL_REASON "resultCancelReason",
  1264. RM.MATERIAL_NAME "materialName",
  1265. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1266. RM.MATERIAL_MODEL "materialModel",
  1267. RG.GATEPOST_NAME "gatepostName"
  1268. from QMS_QUEUE_RESULT QQR
  1269. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1270. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1271. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1272. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1273. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1274. left join RMS_GATEPOST RG on QQR.GATEPOST_ID = RG.GATEPOST_ID
  1275. where
  1276. QQR.RESULT_CANCEL_TIME > to_date('2022-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
  1277. <if test="index != null">
  1278. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1279. </if>
  1280. <if test="oneDate != null">
  1281. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_CANCEL_TIME
  1282. </if>
  1283. <if test="startDate != null">
  1284. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_CANCEL_TIME
  1285. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_CANCEL_TIME
  1286. </if>
  1287. </select>
  1288. <!-- 通过实绩Id 查询数据 取消排队使用-->
  1289. <select id="getQueueCancelByResultId" parameterType="int" resultType="java.util.Map">
  1290. select OO.ORDER_NUMBER "orderNumber",
  1291. RC.CAPACITY_NUMBER "capacityNumber",
  1292. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1293. QQR.RESULT_CANCEL_REASON "resultCancelReason"
  1294. from QMS_QUEUE_RESULT QQR
  1295. left join TMSTRUCK_TOTAL_RESULT TTR
  1296. on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1297. left join OMSTRUCK_ORDER OO
  1298. on OO.ORDER_ID = TTR.ORDER_ID
  1299. left join RMS_CAPACITY RC
  1300. on RC.CAPACITY_ID = QQR.CAPACITY_ID
  1301. left join QMS_QUEUE_LIST QQL
  1302. on QQL.LIST_ID = QQR.LIST_ID
  1303. left join QMS_QUEUE_GRID QQG
  1304. on QQG.GRID_ID = QQL.GRID_ID
  1305. left join RMS_GATEPOST RG
  1306. on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
  1307. where RESULT_ID = #{resultId}
  1308. </select>
  1309. <!-- 查询插队实绩-->
  1310. <!-- <select id="getQueueInsert" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1311. <!-- select *-->
  1312. <!-- from (-->
  1313. <!-- select QQR.RESULT_ID "resultId",-->
  1314. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1315. <!-- RG.GATEPOST_NAME "gatepostName",-->
  1316. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1317. <!-- QQR.RESULT_INSERT_TIME "resultInsertTime",-->
  1318. <!-- QQR.RESULT_INSERT_REASON "resultInsertReason",-->
  1319. <!-- (-->
  1320. <!-- select count(*) from QMS_QUEUE_LIST QQL2-->
  1321. <!-- where QQL2.GRID_ID = QQL.GRID_ID and QQL.DELETED = 0-->
  1322. <!-- ) "queueNumber"-->
  1323. <!-- from QMS_QUEUE_RESULT QQR-->
  1324. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1325. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1326. <!-- left join OMSTRUCK_ORDER OO-->
  1327. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1328. <!-- left join QMS_QUEUE_LIST QQL-->
  1329. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1330. <!-- left join QMS_QUEUE_GRID QQG-->
  1331. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1332. <!-- left join RMS_GATEPOST RG-->
  1333. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  1334. <!-- left join RMS_CAPACITY RC-->
  1335. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1336. <!-- where QQR.RESULT_INSERT_TIME is not null-->
  1337. <!--&#45;&#45; and QQR.RESULT_END_TIME is null-->
  1338. <!-- )-->
  1339. <!-- <where>-->
  1340. <!-- <if test="orderNumber != null">-->
  1341. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1342. <!-- "orderNumber" like '%${item}%'-->
  1343. <!-- </foreach>-->
  1344. <!-- </if>-->
  1345. <!-- <if test="gatepostName != null">-->
  1346. <!-- and-->
  1347. <!-- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">-->
  1348. <!-- "gatepostName" like '%${item}%'-->
  1349. <!-- </foreach>-->
  1350. <!-- </if>-->
  1351. <!-- <if test="capacityNumber != null">-->
  1352. <!-- and-->
  1353. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1354. <!-- "capacityNumber" like '%${item}%'-->
  1355. <!-- </foreach>-->
  1356. <!-- </if>-->
  1357. <!-- <if test="resultInsertTime != null">-->
  1358. <!-- and-->
  1359. <!-- <foreach collection="resultInsertTime" item="item" open="(" separator="or" close=")">-->
  1360. <!-- "resultInsertTime" like '%${item}%'-->
  1361. <!-- </foreach>-->
  1362. <!-- </if>-->
  1363. <!-- <if test="resultInsertReason != null">-->
  1364. <!-- and-->
  1365. <!-- <foreach collection="resultInsertReason" item="item" open="(" separator="or" close=")">-->
  1366. <!-- "resultInsertReason" like '%${item}%'-->
  1367. <!-- </foreach>-->
  1368. <!-- </if>-->
  1369. <!-- </where>-->
  1370. <!-- <include refid="orderBy"></include>-->
  1371. <!-- <if test="orderField == null ">-->
  1372. <!-- order by "resultInsertTime" desc-->
  1373. <!-- </if>-->
  1374. <!-- </select>-->
  1375. <!-- 查询所有排队结束 -->
  1376. <select id="getQueueEndResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1377. select
  1378. QQR.RESULT_ID "resultId",
  1379. OO.ORDER_NUMBER "orderNumber",
  1380. RC.CAPACITY_NUMBER "capacityNumber",
  1381. QQR.RESULT_END_TIME "resultEndTime",
  1382. RM.MATERIAL_NAME "materialName",
  1383. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1384. RM.MATERIAL_MODEL "materialModel"
  1385. from QMS_QUEUE_RESULT QQR
  1386. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1387. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1388. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1389. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1390. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1391. where
  1392. QQR.RESULT_END_TIME > to_date('2022-01-01 00:00:00', 'yyyy', 'yyyy-mm-dd hh24:mi:ss')
  1393. <if test="index != null">
  1394. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1395. </if>
  1396. <if test="oneDate != null">
  1397. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1398. </if>
  1399. <if test="startDate != null">
  1400. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1401. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_START_TIME
  1402. </if>
  1403. </select>
  1404. <!-- 排序 -->
  1405. <sql id="orderByEndTime">
  1406. <if test="orderField != null and orderField != ''">
  1407. order by "${orderField}"
  1408. <if test="orderType != null and orderType != ''">
  1409. ${orderType}
  1410. </if>
  1411. </if>
  1412. <if test="orderField == null ">
  1413. order by "resultEndTime" desc
  1414. </if>
  1415. </sql>
  1416. <!-- 汽车监控 -->
  1417. <select id="capacityMonitor" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1418. select
  1419. QQR.RESULT_ID "resultId",
  1420. OO.ORDER_NUMBER "orderNumber",
  1421. RC.CAPACITY_NUMBER "capacityNumber",
  1422. QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
  1423. QQR.RESULT_START_TIME "resultStartTime",
  1424. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1425. QQR.RESULT_CANCEL_REASON "resultCancelReason",
  1426. QQR.RESULT_END_TIME "resultEndTime",
  1427. RM.MATERIAL_NAME "materialName",
  1428. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1429. RM.MATERIAL_MODEL "materialModel"
  1430. from QMS_QUEUE_RESULT QQR
  1431. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1432. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1433. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1434. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1435. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1436. where
  1437. QQR.RESULT_START_TIME > to_date('2022-01-01 00:00:00', 'yyyy', 'yyyy-mm-dd hh24:mi:ss')
  1438. <if test="index != null">
  1439. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1440. </if>
  1441. <if test="oneDate != null">
  1442. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1443. </if>
  1444. <if test="startDate != null">
  1445. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1446. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_START_TIME
  1447. </if>
  1448. </select>
  1449. <!-- 通过门岗查询排队车数 -->
  1450. <!-- <select id="getQueueListByGatepost" parameterType="java.math.BigDecimal" resultType="java.util.Map">-->
  1451. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1452. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1453. <!-- rg.GATEPOST_NAME as "gatepostName",-->
  1454. <!-- (-->
  1455. <!-- <![CDATA[-->
  1456. <!-- select count(*)-->
  1457. <!-- from QMS_QUEUE_LIST QQL2-->
  1458. <!-- join QMS_QUEUE_GRID QQG2-->
  1459. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1460. <!-- where QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1461. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1462. <!-- and QQL2.DELETED = 0-->
  1463. <!-- ]]>-->
  1464. <!--) "listNodeOrder"-->
  1465. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1466. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1467. <!-- ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID-->
  1468. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1469. <!-- ON oo.ORDER_ID = ttr.ORDER_ID-->
  1470. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1471. <!-- ON rc.CAPACITY_ID = qqr.CAPACITY_ID-->
  1472. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1473. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1474. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1475. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1476. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1477. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1478. <!-- WHERE rg.GATEPOST_ID = #{gatepostId}-->
  1479. <!-- AND qql.DELETED = 0-->
  1480. <!-- </select>-->
  1481. <!-- 查询排队取消列表 -->
  1482. <!-- <select id="getQueueCancelList" resultType="java.util.Map">-->
  1483. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1484. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1485. <!-- qqr.RESULT_CANCEL_TIME as "resultCancelTime",-->
  1486. <!-- qqr.RESULT_CANCEL_REASON as "resultCancelReason",-->
  1487. <!-- rg.GATEPOST_NAME as "gatepostName"-->
  1488. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1489. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1490. <!-- ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID-->
  1491. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1492. <!-- ON oo.ORDER_ID = ttr.ORDER_ID-->
  1493. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1494. <!-- ON rc.CAPACITY_ID = qqr.CAPACITY_ID-->
  1495. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1496. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1497. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1498. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1499. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1500. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1501. <!-- WHERE qqr.RESULT_CANCEL_REASON IS NOT NULL-->
  1502. <!-- </select>-->
  1503. <!-- 查看各个门岗,仓库的实时状态 -->
  1504. <!-- <select id="getQueueStatusList" resultType="java.util.Map">-->
  1505. <!-- select RG.GATEPOST_NAME "gatepostName",-->
  1506. <!-- count(QQL.LIST_NODE_ORDER) "count"-->
  1507. <!-- from RMS_GATEPOST RG-->
  1508. <!-- LEFT JOIN QMS_QUEUE_LIST QQL-->
  1509. <!-- on QQL.GRID_ID = RG.GATEPOST_ID and QQL.DELETED = 0-->
  1510. <!-- group by RG.GATEPOST_NAME-->
  1511. <!-- </select>-->
  1512. <!-- 查询指令接收 -->
  1513. <!-- <select id="getOrderReceiveList" resultType="java.util.Map">-->
  1514. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1515. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1516. <!-- qqr.RESULT_ACCEPT_TIME as "resultAcceptTime",-->
  1517. <!-- rg.GATEPOST_NAME as "gatepostName"-->
  1518. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1519. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1520. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1521. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1522. <!-- ON rc.CAPACITY_ID = qql.CAPACITY_ID-->
  1523. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1524. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1525. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1526. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1527. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1528. <!-- ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID-->
  1529. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1530. <!-- ON ttr.ORDER_ID = oo.ORDER_ID-->
  1531. <!-- </select>-->
  1532. <!-- 根据车牌号查询指令接收 -->
  1533. <select id="getOrderReceive2" resultType="java.util.Map" parameterType="java.util.Map">
  1534. SELECT DISTINCT oo.ORDER_NUMBER as "orderNumber",
  1535. rc.CAPACITY_NUMBER as "capacityNumber",
  1536. rg.GATEPOST_NAME as "gatepostName",
  1537. (
  1538. SELECT count(*)
  1539. FROM QMS_QUEUE_LIST qql
  1540. WHERE qql.DELETED = 0
  1541. AND qql.GRID_ID = #{gridId}
  1542. ) "count",
  1543. (
  1544. <![CDATA[
  1545. select count(*)
  1546. from QMS_QUEUE_LIST QQL2
  1547. join QMS_QUEUE_GRID QQG2
  1548. on QQG2.GRID_ID = QQL2.GRID_ID
  1549. where QQL2.LIST_NODE_ORDER <= QQL.list_node_order
  1550. and QQL2.GRID_ID = QQL.GRID_ID
  1551. and QQL2.DELETED = 0
  1552. ]]>) "listNodeOrder"
  1553. FROM QMS_QUEUE_RESULT qqr
  1554. LEFT JOIN RMS_CAPACITY rc
  1555. ON rc.CAPACITY_ID = qqr.CAPACITY_ID
  1556. LEFT JOIN QMS_QUEUE_GRID qqg
  1557. ON qqg.GRID_ID = qqr.GRID_ID
  1558. LEFT JOIN QMS_QUEUE_LIST qql
  1559. ON qqr.LIST_ID = qql.LIST_ID
  1560. LEFT JOIN RMS_GATEPOST rg
  1561. ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
  1562. LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
  1563. ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID
  1564. LEFT JOIN OMSTRUCK_ORDER oo
  1565. ON ttr.ORDER_ID = oo.ORDER_ID
  1566. WHERE rc.CAPACITY_NUMBER = #{capacityNumber}
  1567. and OO.ORDER_STATUS = 1
  1568. </select>
  1569. <!-- 通过车牌号查询网格id -->
  1570. <!-- <select id="getGridId" parameterType="java.lang.String" resultType="DECIMAL">-->
  1571. <!-- SELECT qqg.GRID_ID as "gridId"-->
  1572. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1573. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1574. <!-- ON qqr.GRID_ID = qqg.GRID_ID-->
  1575. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1576. <!-- ON qqr.CAPACITY_ID = rc.CAPACITY_ID-->
  1577. <!-- WHERE qqr.RESULT_START_TIME IS NULL-->
  1578. <!-- AND rc.CAPACITY_NUMBER = #{capacityNumber}-->
  1579. <!-- </select>-->
  1580. <!-- <select id="getGridIdNotNull" parameterType="java.lang.String" resultType="DECIMAL">-->
  1581. <!-- SELECT qqg.GRID_ID as "gridId"-->
  1582. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1583. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1584. <!-- ON qqr.GRID_ID = qqg.GRID_ID-->
  1585. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1586. <!-- ON qqr.CAPACITY_ID = rc.CAPACITY_ID-->
  1587. <!-- WHERE qqr.RESULT_END_TIME IS NULL-->
  1588. <!-- AND qqr.RESULT_CANCEL_TIME IS NULL-->
  1589. <!-- AND rc.CAPACITY_NUMBER = #{capacityNumber}-->
  1590. <!-- </select>-->
  1591. <!-- 通过运单号得到总实绩id -->
  1592. <select id="getResultTotalId" parameterType="java.lang.String" resultType="DECIMAL">
  1593. SELECT ttr.RESULT_TOTAL_ID
  1594. FROM TMSTRUCK_TOTAL_RESULT ttr
  1595. LEFT JOIN OMSTRUCK_ORDER oo
  1596. ON ttr.ORDER_ID = oo.ORDER_ID
  1597. WHERE oo.ORDER_NUMBER = #{orderNumber}
  1598. </select>
  1599. <!-- 通过车牌号得到实绩id -->
  1600. <select id="getResultIdByCapacityId" parameterType="java.lang.String" resultType="DECIMAL">
  1601. SELECT qqr.RESULT_ID
  1602. FROM QMS_QUEUE_RESULT qqr
  1603. LEFT JOIN RMS_CAPACITY rc
  1604. ON rc.CAPACITY_ID = qqr.CAPACITY_ID
  1605. WHERE rc.CAPACITY_NUMBER = #{capacityNumber}
  1606. AND qqr.RESULT_END_TIME IS NULL
  1607. </select>
  1608. <!-- 通过运力id和总实绩id查询排队实绩id -->
  1609. <select id="getQueueResultId" parameterType="java.util.Map" resultType="DECIMAL">
  1610. SELECT qqr.RESULT_ID as "resultId"
  1611. FROM QMS_QUEUE_RESULT qqr
  1612. WHERE qqr.CAPACITY_ID = #{capacityId}
  1613. AND qqr.RESULT_TOTAL_ID = #{resultTotalId}
  1614. </select>
  1615. <!-- ====================================仓库排队=============================================== -->
  1616. <!-- 查询仓库排队申请 -->
  1617. <!-- <select id="getWarehouseQueueApply" parameterType="java.util.Map" resultType="java.util.Map">-->
  1618. <!-- select *-->
  1619. <!-- from (-->
  1620. <!-- select OO.ORDER_NUMBER "orderNumber",-->
  1621. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1622. <!-- QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",-->
  1623. <!-- RPP.PLATFORM_NAME "platformName",-->
  1624. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  1625. <!-- QQR.RESULT_DOWN_TIME "resultDownTime"-->
  1626. <!-- from QMS_QUEUE_RESULT QQR-->
  1627. <!-- left join QMS_QUEUE_GRID QQG-->
  1628. <!-- on QQG.GRID_ID = QQR.GRID_ID-->
  1629. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1630. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1631. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1632. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1633. <!-- left join OMSTRUCK_ORDER OO-->
  1634. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1635. <!-- join RMS_WAREHOUSE RW-->
  1636. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1637. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1638. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  1639. <!-- left join RMS_CAPACITY RC-->
  1640. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1641. <!-- where QQR.RESULT_ACCEPT_TIME is null-->
  1642. <!-- and QQG.GRID_TYPE = 1-->
  1643. <!-- )-->
  1644. <!-- <where>-->
  1645. <!-- <if test="orderNumber != null">-->
  1646. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1647. <!-- "orderNumber" like '%${item}%'-->
  1648. <!-- </foreach>-->
  1649. <!-- </if>-->
  1650. <!-- <if test="capacityNumber != null">-->
  1651. <!-- and-->
  1652. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1653. <!-- "capacityNumber" like '%${item}%'-->
  1654. <!-- </foreach>-->
  1655. <!-- </if>-->
  1656. <!-- <if test="resultApplyforTime != null">-->
  1657. <!-- and-->
  1658. <!-- <foreach collection="resultApplyforTime" item="item" open="(" separator="or" close=")">-->
  1659. <!-- "resultApplyforTime" like '%${item}%'-->
  1660. <!-- </foreach>-->
  1661. <!-- </if>-->
  1662. <!-- <if test="platformName != null">-->
  1663. <!-- and-->
  1664. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1665. <!-- "platformName" like '%${item}%'-->
  1666. <!-- </foreach>-->
  1667. <!-- </if>-->
  1668. <!-- <if test="warehouseName != null">-->
  1669. <!-- and-->
  1670. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  1671. <!-- "warehouseName" like '%${item}%'-->
  1672. <!-- </foreach>-->
  1673. <!-- </if>-->
  1674. <!-- </where>-->
  1675. <!-- <include refid="orderBy"></include>-->
  1676. <!-- <if test="orderField == null ">-->
  1677. <!-- order by "resultApplyforTime" desc-->
  1678. <!-- </if>-->
  1679. <!-- </select>-->
  1680. <!-- 查询仓库司机指令接收 -->
  1681. <!-- <select id="getWarehouseOrderReceive" parameterType="java.util.Map" resultType="java.util.Map">-->
  1682. <!-- select *-->
  1683. <!-- from (-->
  1684. <!-- select-->
  1685. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1686. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1687. <!-- QQR.RESULT_ACCEPT_TIME "resultAcceptTime",-->
  1688. <!-- RPP.PLATFORM_NAME "platformName",-->
  1689. <!-- QQR.RESULT_DOWN_TIME "resultDownTime"-->
  1690. <!-- from QMS_QUEUE_RESULT QQR-->
  1691. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1692. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1693. <!-- left join OMSTRUCK_ORDER OO-->
  1694. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1695. <!-- left join RMS_CAPACITY RC-->
  1696. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1697. <!-- left join QMS_QUEUE_GRID QQG-->
  1698. <!-- on QQG.GRID_ID = QQR.GRID_ID-->
  1699. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1700. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1701. <!-- where QQR.RESULT_END_TIME is null and QQG.GRID_TYPE = 1-->
  1702. <!-- )-->
  1703. <!-- <where>-->
  1704. <!-- <if test="capacityNumber != null">-->
  1705. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1706. <!-- "capacityNumber" like '%${item}%'-->
  1707. <!-- </foreach>-->
  1708. <!-- </if>-->
  1709. <!-- <if test="orderNumber != null">-->
  1710. <!-- and-->
  1711. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1712. <!-- "orderNumber" like '%${item}%'-->
  1713. <!-- </foreach>-->
  1714. <!-- </if>-->
  1715. <!-- <if test="platformName != null">-->
  1716. <!-- and-->
  1717. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1718. <!-- "platformName" like '%${item}%'-->
  1719. <!-- </foreach>-->
  1720. <!-- </if>-->
  1721. <!-- <if test="resultAcceptTime != null">-->
  1722. <!-- and-->
  1723. <!-- <foreach collection="resultAcceptTime" item="item" open="(" separator="or" close=")">-->
  1724. <!-- "resultAcceptTime" like '%${item}%'-->
  1725. <!-- </foreach>-->
  1726. <!-- </if>-->
  1727. <!-- <if test="resultDownTime != null">-->
  1728. <!-- and-->
  1729. <!-- <foreach collection="resultDownTime" item="item" open="(" separator="or" close=")">-->
  1730. <!-- "resultDownTime" like '%${item}%'-->
  1731. <!-- </foreach>-->
  1732. <!-- </if>-->
  1733. <!-- </where>-->
  1734. <!-- <include refid="orderBy"></include>-->
  1735. <!-- <if test="orderField == null ">-->
  1736. <!-- order by "resultDownTime" desc-->
  1737. <!-- </if>-->
  1738. <!-- </select>-->
  1739. <!-- 查询仓库排队开始 -->
  1740. <!-- <select id="getWarehouseQueueListByQueueUp" parameterType="java.util.Map" resultType="java.util.Map">-->
  1741. <!-- select-->
  1742. <!-- *-->
  1743. <!-- from(-->
  1744. <!-- select-->
  1745. <!-- QQR.RESULT_ID "resultId",-->
  1746. <!-- ASO.SALE_NUMBER "orderNo",-->
  1747. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1748. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1749. <!-- QQR.RESULT_START_TIME "resultStartTime",-->
  1750. <!-- RPP.PLATFORM_NAME "platformName",-->
  1751. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  1752. <!-- (-->
  1753. <!-- <![CDATA[-->
  1754. <!-- select-->
  1755. <!-- count(*)-->
  1756. <!-- from-->
  1757. <!-- QMS_QUEUE_LIST QQL2-->
  1758. <!-- join QMS_QUEUE_GRID QQG2-->
  1759. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1760. <!-- where-->
  1761. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1762. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1763. <!-- and QQL2.DELETED = 0-->
  1764. <!-- ]]>-->
  1765. <!-- ) "listNodeOrder",-->
  1766. <!-- RC.CAPACITY_VIP "capacityVip"-->
  1767. <!-- from QMS_QUEUE_RESULT QQR-->
  1768. <!-- left join QMS_QUEUE_LIST QQL-->
  1769. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1770. <!-- left join QMS_QUEUE_GRID QQG-->
  1771. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1772. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1773. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1774. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1775. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1776. <!-- left join OMSTRUCK_ORDER OO-->
  1777. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1778. <!-- left join AMS_SALE_ORDER ASO-->
  1779. <!-- on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID-->
  1780. <!-- left join RMS_CAPACITY RC-->
  1781. <!-- on QQR.CAPACITY_ID = RC.CAPACITY_ID-->
  1782. <!-- join RMS_WAREHOUSE RW-->
  1783. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1784. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1785. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  1786. <!-- where QQR.RESULT_START_TIME is not null-->
  1787. <!-- and QQL.DELETED = 0-->
  1788. <!-- <if test="gridId != null">-->
  1789. <!-- and QQL.GRID_ID = #{gridId}-->
  1790. <!-- </if>-->
  1791. <!-- )-->
  1792. <!-- <where>-->
  1793. <!-- <if test="saleNumber != null">-->
  1794. <!-- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
  1795. <!-- "saleNumber" like '%${item}%'-->
  1796. <!-- </foreach>-->
  1797. <!-- </if>-->
  1798. <!-- <if test="orderNumber != null">-->
  1799. <!-- and-->
  1800. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1801. <!-- "orderNumber" like '%${item}%'-->
  1802. <!-- </foreach>-->
  1803. <!-- </if>-->
  1804. <!-- <if test="capacityNumber != null">-->
  1805. <!-- and-->
  1806. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1807. <!-- "capacityNumber" like '%${item}%'-->
  1808. <!-- </foreach>-->
  1809. <!-- </if>-->
  1810. <!-- <if test="resultStartTime != null">-->
  1811. <!-- and-->
  1812. <!-- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">-->
  1813. <!-- "resultStartTime" like '%${item}%'-->
  1814. <!-- </foreach>-->
  1815. <!-- </if>-->
  1816. <!-- <if test="platformName != null">-->
  1817. <!-- and-->
  1818. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1819. <!-- "platformName" like '%${item}%'-->
  1820. <!-- </foreach>-->
  1821. <!-- </if>-->
  1822. <!-- <if test="listNodeOrder != null">-->
  1823. <!-- and-->
  1824. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1825. <!-- "listNodeOrder" like '%${item}%'-->
  1826. <!-- </foreach>-->
  1827. <!-- </if>-->
  1828. <!-- <if test="warehouseName != null">-->
  1829. <!-- and-->
  1830. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  1831. <!-- "warehouseName" like '%${item}%'-->
  1832. <!-- </foreach>-->
  1833. <!-- </if>-->
  1834. <!-- </where>-->
  1835. <!-- <include refid="orderBy"></include>-->
  1836. <!-- <if test="orderField == null ">-->
  1837. <!-- order by "resultStartTime" desc-->
  1838. <!-- </if>-->
  1839. <!-- </select>-->
  1840. <!-- 查看仓库排队详情 -->
  1841. <!-- <select id="getWarehouseQueueMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  1842. <!-- select *-->
  1843. <!-- from (-->
  1844. <!-- select-->
  1845. <!-- QQR.RESULT_ID "resultId",-->
  1846. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1847. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1848. <!-- RPP.PLATFORM_NAME "platformName",-->
  1849. <!-- RC.CAPACITY_VIP "capacityVip",-->
  1850. <!-- (-->
  1851. <!-- <![CDATA[-->
  1852. <!-- select-->
  1853. <!-- count(*)-->
  1854. <!-- from-->
  1855. <!-- QMS_QUEUE_LIST QQL2-->
  1856. <!-- join QMS_QUEUE_GRID QQG2-->
  1857. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1858. <!-- where-->
  1859. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1860. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1861. <!-- and QQL2.DELETED = 0-->
  1862. <!-- ]]>-->
  1863. <!-- ) "listNodeOrder",-->
  1864. <!-- QQR.RESULT_START_TIME "resultStartTime"-->
  1865. <!-- from OMSTRUCK_ORDER OO-->
  1866. <!-- left join RMS_CAPACITY RC-->
  1867. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1868. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1869. <!-- on TTR.ORDER_ID = OO.ORDER_ID-->
  1870. <!-- left join QMS_QUEUE_RESULT QQR-->
  1871. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1872. <!-- left join QMS_QUEUE_LIST QQL-->
  1873. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1874. <!-- left join QMS_QUEUE_GRID QQG-->
  1875. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1876. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1877. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1878. <!-- where-->
  1879. <!-- QQR.RESULT_START_TIME is not null-->
  1880. <!-- and QQG.GRID_TYPE in (1, 2)-->
  1881. <!-- and QQL.DELETED = 0-->
  1882. <!-- <if test="orderNum != null">-->
  1883. <!-- and OO.ORDER_NUMBER = #{orderNum}-->
  1884. <!-- </if>-->
  1885. <!-- <if test="platformId != null">-->
  1886. <!-- and RPP.PLATFORM_ID = #{platformId}-->
  1887. <!-- </if>-->
  1888. <!-- )-->
  1889. <!-- <where>-->
  1890. <!-- <if test="orderNumber != null">-->
  1891. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1892. <!-- "orderNumber" like '%${item}%'-->
  1893. <!-- </foreach>-->
  1894. <!-- </if>-->
  1895. <!-- <if test="capacityNumber != null">-->
  1896. <!-- and-->
  1897. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1898. <!-- "capacityNumber" like '%${item}%'-->
  1899. <!-- </foreach>-->
  1900. <!-- </if>-->
  1901. <!-- <if test="platformName != null">-->
  1902. <!-- and-->
  1903. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1904. <!-- "platformName" like '%${item}%'-->
  1905. <!-- </foreach>-->
  1906. <!-- </if>-->
  1907. <!-- <if test="listNodeOrder != null">-->
  1908. <!-- and-->
  1909. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1910. <!-- "listNodeOrder" like '%${item}%'-->
  1911. <!-- </foreach>-->
  1912. <!-- </if>-->
  1913. <!-- </where>-->
  1914. <!-- <include refid="orderBy"></include>-->
  1915. <!-- <if test="orderField == null ">-->
  1916. <!-- order by "resultStartTime" desc-->
  1917. <!-- </if>-->
  1918. <!-- </select>-->
  1919. <!-- 查询排队转移 -->
  1920. <!-- <select id="getWarehouseQueueChange" resultType="java.util.Map" parameterType="java.util.Map">-->
  1921. <!-- select-->
  1922. <!-- *-->
  1923. <!-- from(-->
  1924. <!-- select-->
  1925. <!-- QQR.RESULT_ID "resultId",-->
  1926. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1927. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1928. <!-- RPP2.PLATFORM_NAME "platformName2",-->
  1929. <!-- RW2.WAREHOUSE_NAME "warehouseName2",-->
  1930. <!-- RPP1.PLATFORM_NAME "platformName1",-->
  1931. <!-- RW1.WAREHOUSE_NAME "warehouseName1",-->
  1932. <!-- QQR.RESULT_TRANSFER_TIME "resultTransferTime",-->
  1933. <!-- QQR.RESULT_TRANSFER_REASON "resultTransferReason",-->
  1934. <!-- (-->
  1935. <!-- <![CDATA[-->
  1936. <!-- select-->
  1937. <!-- count(*)-->
  1938. <!-- from-->
  1939. <!-- QMS_QUEUE_LIST QL-->
  1940. <!-- join QMS_QUEUE_GRID QG-->
  1941. <!-- on QG.GRID_ID = QL.GRID_ID-->
  1942. <!-- where-->
  1943. <!-- QL.LIST_NODE_ORDER <= QQL.list_node_order-->
  1944. <!-- and QL.GRID_ID = QQL.GRID_ID-->
  1945. <!-- and QL.DELETED = 0-->
  1946. <!-- ]]>-->
  1947. <!-- ) "listNodeOrder"-->
  1948. <!-- from QMS_QUEUE_RESULT QQR-->
  1949. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1950. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1951. <!-- left join OMSTRUCK_ORDER OO-->
  1952. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1953. <!-- left join RMS_CAPACITY RC-->
  1954. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1955. <!-- left join QMS_QUEUE_LIST QQL-->
  1956. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  1957. <!-- left join QMS_QUEUE_GRID QQG1 &#45;&#45;转移后网格ID-->
  1958. <!-- on QQG1.GRID_ID = QQL.GRID_ID-->
  1959. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP1 &#45;&#45;转移后月台名称-->
  1960. <!-- on RPP1.PLATFORM_ID = QQG1.QUEUE_LOCATION_ID-->
  1961. <!-- join RMS_WAREHOUSE RW1 &#45;&#45;转移后仓库名称-->
  1962. <!-- on RW1.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1963. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1964. <!-- where RPG.PLATFORM_ID = QQG1.QUEUE_LOCATION_ID)-->
  1965. <!-- left join QMS_QUEUE_GRID QQG2 &#45;&#45;转移前网格ID-->
  1966. <!-- on QQG2.GRID_ID = QQR.GRID_ID-->
  1967. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP2 &#45;&#45;转移前月台名称-->
  1968. <!-- on RPP2.PLATFORM_ID = QQG2.QUEUE_LOCATION_ID-->
  1969. <!-- join RMS_WAREHOUSE RW2 &#45;&#45;转移前仓库名称-->
  1970. <!-- on RW2.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1971. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1972. <!-- where RPG.PLATFORM_ID = QQG2.QUEUE_LOCATION_ID)-->
  1973. <!-- where QQR.RESULT_TRANSFER_TIME is not null-->
  1974. <!--&#45;&#45; and QQL.DELETED = 0-->
  1975. <!-- and QQG1.GRID_TYPE = 1-->
  1976. <!-- )-->
  1977. <!-- <where>-->
  1978. <!-- <if test="orderNumber != null">-->
  1979. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1980. <!-- "orderNumber" like '%${item}%'-->
  1981. <!-- </foreach>-->
  1982. <!-- </if>-->
  1983. <!-- <if test="capacityNumber != null">-->
  1984. <!-- and-->
  1985. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1986. <!-- "capacityNumber" like '%${item}%'-->
  1987. <!-- </foreach>-->
  1988. <!-- </if>-->
  1989. <!-- <if test="platformName2 != null">-->
  1990. <!-- and-->
  1991. <!-- <foreach collection="platformName2" item="item" open="(" separator="or" close=")">-->
  1992. <!-- "platformName2" like '%${item}%'-->
  1993. <!-- </foreach>-->
  1994. <!-- </if>-->
  1995. <!-- <if test="capacityNumber != null">-->
  1996. <!-- and-->
  1997. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1998. <!-- "capacityNumber" like '%${item}%'-->
  1999. <!-- </foreach>-->
  2000. <!-- </if>-->
  2001. <!-- <if test="platformName1 != null">-->
  2002. <!-- and-->
  2003. <!-- <foreach collection="platformName1" item="item" open="(" separator="or" close=")">-->
  2004. <!-- "platformName1" like '%${item}%'-->
  2005. <!-- </foreach>-->
  2006. <!-- </if>-->
  2007. <!-- <if test="warehouseName1 != null">-->
  2008. <!-- and-->
  2009. <!-- <foreach collection="warehouseName1" item="item" open="(" separator="or" close=")">-->
  2010. <!-- "warehouseName1" like '%${item}%'-->
  2011. <!-- </foreach>-->
  2012. <!-- </if>-->
  2013. <!-- <if test="resultTransferTime != null">-->
  2014. <!-- and-->
  2015. <!-- <foreach collection="resultTransferTime" item="item" open="(" separator="or" close=")">-->
  2016. <!-- "resultTransferTime" like '%${item}%'-->
  2017. <!-- </foreach>-->
  2018. <!-- </if>-->
  2019. <!-- <if test="resultTransferReason != null">-->
  2020. <!-- and-->
  2021. <!-- <foreach collection="resultTransferReason" item="item" open="(" separator="or" close=")">-->
  2022. <!-- "resultTransferReason" like '%${item}%'-->
  2023. <!-- </foreach>-->
  2024. <!-- </if>-->
  2025. <!-- </where>-->
  2026. <!-- <include refid="orderBy"></include>-->
  2027. <!-- <if test="orderField == null ">-->
  2028. <!-- order by "resultTransferTime" desc-->
  2029. <!-- </if>-->
  2030. <!-- </select>-->
  2031. <!-- 查询仓库排队结束 -->
  2032. <!-- <select id="getWarehouseQueueEndMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  2033. <!-- select *-->
  2034. <!-- from (-->
  2035. <!-- select QQR.RESULT_ID "resultId",-->
  2036. <!-- OO.ORDER_NUMBER "orderNumber",-->
  2037. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  2038. <!-- QQR.RESULT_END_TIME "resultEndTime",-->
  2039. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  2040. <!-- RPP.PLATFORM_NAME "platformName"-->
  2041. <!-- from QMS_QUEUE_RESULT QQR-->
  2042. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  2043. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  2044. <!-- left join OMSTRUCK_ORDER OO-->
  2045. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  2046. <!-- left join RMS_CAPACITY RC-->
  2047. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  2048. <!-- left join QMS_QUEUE_LIST QQL-->
  2049. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  2050. <!-- left join QMS_QUEUE_GRID QQG-->
  2051. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  2052. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  2053. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  2054. <!-- join RMS_WAREHOUSE RW-->
  2055. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  2056. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  2057. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  2058. <!-- where QQR.RESULT_END_TIME is not null-->
  2059. <!-- and QQG.GRID_TYPE = 1-->
  2060. <!-- )-->
  2061. <!-- <where>-->
  2062. <!-- <if test="orderNumber != null">-->
  2063. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  2064. <!-- "orderNumber" like '%${item}%'-->
  2065. <!-- </foreach>-->
  2066. <!-- </if>-->
  2067. <!-- <if test="capacityNumber != null">-->
  2068. <!-- and-->
  2069. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  2070. <!-- "capacityNumber" like '%${item}%'-->
  2071. <!-- </foreach>-->
  2072. <!-- </if>-->
  2073. <!-- <if test="resultEndTime != null">-->
  2074. <!-- and-->
  2075. <!-- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">-->
  2076. <!-- "resultEndTime" like '%${item}%'-->
  2077. <!-- </foreach>-->
  2078. <!-- </if>-->
  2079. <!-- <if test="warehouseName != null">-->
  2080. <!-- and-->
  2081. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  2082. <!-- "warehouseName" like '%${item}%'-->
  2083. <!-- </foreach>-->
  2084. <!-- </if>-->
  2085. <!-- <if test="platformName != null">-->
  2086. <!-- and-->
  2087. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  2088. <!-- "platformName" like '%${item}%'-->
  2089. <!-- </foreach>-->
  2090. <!-- </if>-->
  2091. <!-- </where>-->
  2092. <!-- <include refid="orderBy"></include>-->
  2093. <!-- <if test="orderField == null ">-->
  2094. <!-- order by "resultEndTime" desc-->
  2095. <!-- </if>-->
  2096. <!-- </select>-->
  2097. <!--&lt;!&ndash; 通过运输订单Id查询推送给司机的数据 &ndash;&gt;-->
  2098. <!-- <select id="sendEnFactoryMesToWebSocket" parameterType="int" resultType="java.util.Map">-->
  2099. <!-- select-->
  2100. <!-- OO.ORDER_ID "orderId",-->
  2101. <!-- OO.ORDER_NUMBER "orderNumber",-->
  2102. <!-- RC.CAPACITY_NUMBER "capacityNumber"-->
  2103. <!-- from OMSTRUCK_ORDER OO-->
  2104. <!-- LEFT JOIN RMS_CAPACITY RC-->
  2105. <!-- ON RC.CAPACITY_ID = OO.CAPACITY_ID-->
  2106. <!-- WHERE ORDER_ID = #{orderId}-->
  2107. <!-- </select>-->
  2108. <!-- 通过网格Id查询进厂门岗名称 -->
  2109. <!-- <select id="queryGatepostNameByGridId" parameterType="int" resultType="java.util.Map">-->
  2110. <!-- select RG.GATEPOST_NAME "gatepostName"-->
  2111. <!-- from QMS_QUEUE_GRID QQG-->
  2112. <!-- left join RMS_GATEPOST RG-->
  2113. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  2114. <!-- where QQG.GRID_ID = #{gridId}-->
  2115. <!-- </select>-->
  2116. <!-- 通过运输订单Id查询司机仓库排队的数据 -->
  2117. <!-- <select id="sendWarehouseMesToWebSocket" parameterType="int" resultType="java.util.Map">-->
  2118. <!-- select-->
  2119. <!-- OO.ORDER_ID "orderId",-->
  2120. <!-- OO.ORDER_NUMBER "orderNumber",-->
  2121. <!-- RCD.DRIVER_NAME "driverName",-->
  2122. <!-- RC.CAPACITY_NUMBER "capacityNumber"-->
  2123. <!-- from OMSTRUCK_ORDER OO-->
  2124. <!-- LEFT JOIN RMS_CAPACITY RC-->
  2125. <!-- ON RC.CAPACITY_ID = OO.CAPACITY_ID-->
  2126. <!-- LEFT JOIN RMS_CAR_DRIVER RCD-->
  2127. <!-- ON RCD.DRIVER_ID = OO.DRIVER_ID-->
  2128. <!-- WHERE ORDER_ID = #{orderId}-->
  2129. <!-- </select>-->
  2130. <!-- 通过月台网格ID查询仓库名称 和 月台名称 -->
  2131. <!-- <select id="queryWarehouseNameByPlatformId" parameterType="int" resultType="java.util.Map">-->
  2132. <!-- select RPP.PLATFORM_NAME "platformName",-->
  2133. <!-- ( SELECT DISTINCT-->
  2134. <!-- RW.WAREHOUSE_NAME-->
  2135. <!-- FROM "RMS_PWAREHOUSE_GRID" RPG-->
  2136. <!-- JOIN RMS_WAREHOUSE RW-->
  2137. <!-- ON RW.WAREHOUSE_ID = RPG.WAREHOUSE_ID-->
  2138. <!-- WHERE RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID AND PLATFORM_ID IS NOT NULL )-->
  2139. <!-- "warehouseName"-->
  2140. <!-- from QMS_QUEUE_GRID QQG-->
  2141. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  2142. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  2143. <!-- where QQG.GRID_ID = #{gridId}-->
  2144. <!-- </select>-->
  2145. <!-- 通过订单Id查询物资下面的仓储网格ID -->
  2146. <select id="getGridIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  2147. select QQR.GRID_ID "grid"
  2148. from OMSTRUCK_ORDER_MATERIAL OOM
  2149. left join QMS_QUEUE_GRID QQR on OOM.MATERIAL_ID = QQR.QUEUE_LOCATION_ID
  2150. where OOM.ORDER_ID = #{orderId} and QQR.GRID_TYPE = 4
  2151. </select>
  2152. <select id="getMaterialIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  2153. select OOM.MATERIAL_ID from OMSTRUCK_ORDER_MATERIAL OOM where OOM.ORDER_ID = #{orderId}
  2154. </select>
  2155. <select id="getQueueResultByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  2156. select QQR.RESULT_ID "resultId",
  2157. QQR.RESULT_END_TIME "resultEndTime",
  2158. QQR.GRID_ID "gridId",
  2159. QQR.RESULT_DOWN_TIME "resultDownTime",
  2160. QQR.RESULT_START_TIME "resultStartTime",
  2161. QQR.IS_SPELLING "isSpelling",
  2162. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  2163. QQR.RESULT_INSERT_TIME "resultInsertTime",
  2164. QQR.LIST_ID "listId",
  2165. RG.GATEPOST_NAME "gatepostName",
  2166. (case
  2167. when QQR.IS_SPELLING = 0
  2168. then (select QQL.ENTRY_SURE_TIME
  2169. from QMS_QUEUE_LIST QQL
  2170. where QQR.RESULT_ID = QQL.QUEUE_RESULT_ID)
  2171. when QQR.IS_SPELLING = 1
  2172. then (select QQSL.ENTRY_SURE_TIME
  2173. from QMS_QUEUE_SPELLING_LIST QQSL
  2174. where QQR.RESULT_ID = QQSL.QUEUE_RESULT_ID)
  2175. end) "entrySureTime"
  2176. from QMS_QUEUE_RESULT QQR
  2177. left join RMS_GATEPOST RG on QQR.GATEPOST_ID = RG.GATEPOST_ID
  2178. where QQR.RESULT_TOTAL_ID = #{resultTotalId}
  2179. </select>
  2180. <select id="getResultMesByTotalId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  2181. select QQR.RESULT_ID "resultId",
  2182. QQR.IS_SPELLING "isSpelling"
  2183. from QMS_QUEUE_RESULT QQR
  2184. where QQR.RESULT_TOTAL_ID = #{resultTotalId}
  2185. </select>
  2186. <select id="getStoreQueueList" resultType="java.util.Map">
  2187. SELECT
  2188. o2.material_priority "materialPriority",
  2189. rw.WAREHOUSE_NAME "warehouseName",
  2190. count( 1 ) "carQueue"
  2191. FROM
  2192. Omstruck_Order o1
  2193. LEFT JOIN Omstruck_Order_Material o2 ON o1.order_id = o2.order_id
  2194. LEFT JOIN rms_warehouse rw ON rw.warehouse_id = o2.material_priority
  2195. LEFT JOIN tmstruck_total_result ttr ON ttr.order_id = o1.order_id
  2196. LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  2197. AND O2.MATERIAL_ID = TWR.MATERIAL_ID
  2198. WHERE
  2199. o1.order_status = 5
  2200. AND o1.order_type = 1
  2201. AND TWR.RESULT_NET_WEIGHT IS NULL
  2202. AND rw.WAREHOUSE_NAME IS NOT NULL
  2203. GROUP BY
  2204. o2.material_priority,
  2205. rw.WAREHOUSE_NAME
  2206. </select>
  2207. </mapper>