QmsQueueResultMapper.xml 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175
  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 QQR.RESULT_ID "resultId",
  841. QQR.RESULT_TOTAL_ID "resultTotalId",
  842. QQR.RESULT_START_TIME "resultStartTime",
  843. RCE.CONSIGNEE_COMPANY_NAME "consigneeName",
  844. RM.MATERIAL_NAME || RM.MATERIAL_SPECIFICATION || RM.MATERIAL_MODEL "grid",
  845. RM.MATERIAL_ID "materialId",
  846. RM.MATERIAL_NAME "materialName",
  847. RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')' "materialSpecification",
  848. RM.MATERIAL_MODEL "materialModel",
  849. QQL.LIST_ID "listId",
  850. RC.CAPACITY_NUMBER "capacityNumber",
  851. RC.CAPACITY_ID "capacityId",
  852. QQL.ENTRY_SURE_TIME "sureTime",
  853. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  854. OOM.MATERIAL_PRIORITY "id",
  855. OO.DRIVER_TEL "driverTel",
  856. OO.ORDER_ID "orderId",
  857. RG.GATEPOST_NAME "gatepostName",
  858. (
  859. select COUNT(QQL2.LIST_ID)
  860. from QMS_QUEUE_LIST QQL2
  861. where QQL2.GRID_ID = QQL.GRID_ID
  862. and QQL2.LIST_NODE_ORDER &lt;= QQL.LIST_NODE_ORDER
  863. ) || (case when QQL.IS_VIP is not null then ' 优先进厂' else '' end ) "listNodeOrder"
  864. FROM QMS_QUEUE_LIST QQL
  865. LEFT JOIN QMS_QUEUE_RESULT QQR ON QQL.QUEUE_RESULT_ID = QQR.RESULT_ID
  866. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  867. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON TTR.ORDER_ID = OOM.ORDER_ID
  868. LEFT JOIN RMS_MATERIAL RM ON OOM.MATERIAL_ID = RM.MATERIAL_ID
  869. LEFT JOIN RMS_CAPACITY RC ON QQL.CAPACITY_ID = RC.CAPACITY_ID
  870. LEFT JOIN OMSTRUCK_ORDER OO ON TTR.ORDER_ID = OO.ORDER_ID
  871. LEFT JOIN RMS_GATEPOST RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
  872. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  873. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  874. LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
  875. where oo.ORDER_STATUS = 5
  876. <if test="capacityNumber != null">
  877. and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
  878. </if>
  879. <if test="materialList != null">
  880. and RM.MATERIAL_ID in
  881. <foreach collection="materialList" item="item" open="(" separator="," close=")">
  882. ${item}
  883. </foreach>
  884. </if>
  885. <if test="locationId != null">
  886. and QQL.GRID_ID = #{locationId}
  887. ORDER BY QQL.ENTRY_SURE_TIME DESC, QQL.IS_VIP, "listNodeOrder"
  888. </if>
  889. <if test="locationId == null">
  890. ORDER BY QQL.ENTRY_SURE_TIME DESC, QQL.IS_VIP, "materialName" DESC, "listNodeOrder"
  891. </if>
  892. </select>
  893. <update id="updateCancelResult" parameterType="com.steerinfo.dil.model.QmsQueueResult">
  894. update QMS_QUEUE_RESULT
  895. set RESULT_CANCEL_TIME = SYSDATE,
  896. RESULT_START_TIME = null,
  897. RESULT_CANCEL_REASON = #{resultCancelReason}
  898. where RESULT_ID = #{resultId}
  899. </update>
  900. <select id="getQueueListByQueueUpSpelling" parameterType="map" resultType="java.util.LinkedHashMap">
  901. select QQR.RESULT_ID "resultId",
  902. QQR.RESULT_TOTAL_ID "resultTotalId",
  903. QQR.RESULT_START_TIME "resultStartTime",
  904. RC.CAPACITY_NUMBER "capacityNumber",
  905. QQSL.SPELILING_NUM "grid",
  906. QQSL.SPELLING_RESULT_ID "spellingResultId",
  907. RM.MATERIAL_ID "materialId",
  908. RM.MATERIAL_NAME "materialName",
  909. RM.MATERIAL_SPECIFICATION||'('||RM.MATERIAL_MODEL||')' "materialSpecification",
  910. RC.CAPACITY_ID "capacityId",
  911. RM.MATERIAL_MODEL "materialModel",
  912. QQSL.ENTRY_SURE_TIME "sureTime",
  913. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  914. OOM.MATERIAL_PRIORITY "id",
  915. OO.DRIVER_TEL "driverTel",
  916. OO.ORDER_ID "orderId",
  917. RG.GATEPOST_NAME "gatepostName",
  918. RCE.CONSIGNEE_COMPANY_NAME "consigneeName",
  919. (
  920. select count(QQSL2.SPELLING_RESULT_ID) from QMS_QUEUE_SPELLING_LIST QQSL2
  921. where QQSL.SPELILING_NUM = QQSL2.SPELILING_NUM
  922. and QQSL.SPELLING_SURE_TIME &lt;= QQSL2.SPELLING_SURE_TIME
  923. ) "listNodeOrder"
  924. from QMS_QUEUE_SPELLING_LIST QQSL
  925. left join QMS_QUEUE_RESULT QQR ON QQSL.QUEUE_RESULT_ID = QQR.RESULT_ID
  926. left join RMS_CAPACITY RC ON QQR.CAPACITY_ID = RC.CAPACITY_ID
  927. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  928. left join OMSTRUCK_ORDER_MATERIAL OOM on TTR.ORDER_ID = OOM.ORDER_ID
  929. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  930. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  931. LEFT JOIN RMS_GATEPOST RG ON QQR.GATEPOST_ID = RG.GATEPOST_ID
  932. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  933. LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  934. LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
  935. where oo.ORDER_STATUS = 5
  936. <if test="capacityNumber != null">
  937. and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
  938. </if>
  939. <if test="materialList != null">
  940. and
  941. EXISTS (
  942. SELECT OO2.ORDER_ID
  943. from OMSTRUCK_ORDER OO2 left join OMSTRUCK_ORDER_MATERIAL OOM2 on OO2.ORDER_ID = OOM2.ORDER_ID
  944. where OO2.ORDER_ID = OO.ORDER_ID and OOM2.MATERIAL_ID in
  945. <foreach collection="materialList" item="item" open="(" separator="," close=")">
  946. ${item}
  947. </foreach>
  948. )
  949. </if>
  950. <if test="locationId != null">
  951. and QQSL.SPELILING_NUM = #{locationId}
  952. ORDER BY QQSL.ENTRY_SURE_TIME DESC, QQSL.IS_VIP, "listNodeOrder"
  953. </if>
  954. <if test="locationId == null">
  955. order by QQSL.ENTRY_SURE_TIME DESC, QQSL.IS_VIP, QQSL.SPELILING_NUM DESC, "listNodeOrder"
  956. </if>
  957. </select>
  958. <!-- 查看进厂排队详情 -->
  959. <!-- <select id="getQueueMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  960. <!-- select *-->
  961. <!-- from (-->
  962. <!-- select-->
  963. <!-- OO.ORDER_NUMBER "orderNumber",-->
  964. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  965. <!-- RG.GATEPOST_NAME "gatepostName",-->
  966. <!-- (-->
  967. <!-- <![CDATA[-->
  968. <!-- select-->
  969. <!-- count(*)-->
  970. <!-- from-->
  971. <!-- QMS_QUEUE_LIST QQL2-->
  972. <!-- join QMS_QUEUE_GRID QQG2-->
  973. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  974. <!-- where-->
  975. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  976. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  977. <!-- and QQL2.DELETED = 0-->
  978. <!-- ]]>-->
  979. <!-- ) "listNodeOrder",-->
  980. <!-- QQR.RESULT_ID "resultId",-->
  981. <!-- QQL.LIST_ID "listId",-->
  982. <!-- RC.CAPACITY_VIP "capacityVip",-->
  983. <!-- QQR.RESULT_START_TIME "resultStartTime"-->
  984. <!-- from OMSTRUCK_ORDER OO-->
  985. <!-- left join RMS_CAPACITY RC-->
  986. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  987. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  988. <!-- on TTR.ORDER_ID = OO.ORDER_ID-->
  989. <!-- left join QMS_QUEUE_RESULT QQR-->
  990. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  991. <!-- left join QMS_QUEUE_LIST QQL-->
  992. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  993. <!-- left join QMS_QUEUE_GRID QQG-->
  994. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  995. <!-- left join RMS_GATEPOST RG-->
  996. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  997. <!-- where-->
  998. <!-- QQR.RESULT_START_TIME is not null-->
  999. <!-- and QQL.DELETED = 0-->
  1000. <!-- <if test="orderNum != null">-->
  1001. <!-- and OO.ORDER_NUMBER = #{orderNum}-->
  1002. <!-- </if>-->
  1003. <!-- <if test="gatepostId != null">-->
  1004. <!-- and RG.GATEPOST_ID = #{gatepostId}-->
  1005. <!-- </if>-->
  1006. <!-- )-->
  1007. <!-- <where>-->
  1008. <!-- <if test="orderNumber != null">-->
  1009. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1010. <!-- "orderNumber" like '%${item}%'-->
  1011. <!-- </foreach>-->
  1012. <!-- </if>-->
  1013. <!-- <if test="capacityNumber != null">-->
  1014. <!-- and-->
  1015. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1016. <!-- "capacityNumber" like '%${item}%'-->
  1017. <!-- </foreach>-->
  1018. <!-- </if>-->
  1019. <!-- <if test="platformName != null">-->
  1020. <!-- and-->
  1021. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1022. <!-- "platformName" like '%${item}%'-->
  1023. <!-- </foreach>-->
  1024. <!-- </if>-->
  1025. <!-- <if test="listNodeOrder != null">-->
  1026. <!-- and-->
  1027. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1028. <!-- "listNodeOrder" like '%${item}%'-->
  1029. <!-- </foreach>-->
  1030. <!-- </if>-->
  1031. <!-- <if test="capacityVip != null">-->
  1032. <!-- and-->
  1033. <!-- <foreach collection="capacityVip" item="item" open="(" separator="or" close=")">-->
  1034. <!-- "capacityVip" like '%${item}%'-->
  1035. <!-- </foreach>-->
  1036. <!-- </if>-->
  1037. <!-- </where>-->
  1038. <!-- <include refid="orderBy"></include>-->
  1039. <!-- <if test="orderField == null ">-->
  1040. <!-- order by "gatepostName" desc, "listNodeOrder" asc-->
  1041. <!-- </if>-->
  1042. <!-- </select>-->
  1043. <!-- 查询排队申请 一对多由前端处理 -->
  1044. <select id="getQueueApply" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1045. select
  1046. QQR.RESULT_ID "resultId",
  1047. OO.ORDER_NUMBER "orderNumber",
  1048. RC.CAPACITY_NUMBER "capacityNumber",
  1049. QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
  1050. QQR.RESULT_DOWN_TIME "resultDownTime",
  1051. RM.MATERIAL_NAME "materialName",
  1052. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1053. RM.MATERIAL_MODEL "materialModel",
  1054. OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber"
  1055. from QMS_QUEUE_RESULT QQR
  1056. left join TMSTRUCK_TOTAL_RESULT TTR on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID
  1057. left join OMSTRUCK_ORDER OO on OO.ORDER_ID = TTR.ORDER_ID
  1058. left join RMS_CAPACITY RC on RC.CAPACITY_ID = QQR.CAPACITY_ID
  1059. left join QMS_QUEUE_GRID QQG on QQG.GRID_ID = QQR.GRID_ID
  1060. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1061. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1062. <where>
  1063. <if test="index != null">
  1064. instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1065. </if>
  1066. <if test="oneDate != null">
  1067. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_DOWN_TIME
  1068. </if>
  1069. <if test="startDate != null">
  1070. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_DOWN_TIME
  1071. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_DOWN_TIME
  1072. </if>
  1073. </where>
  1074. </select>
  1075. <!-- 通过接收时间判断是否已接收 查询判断条件:是否结束进厂 -->
  1076. <!-- <select id="getOrderReceive" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1077. <!-- select-->
  1078. <!-- *-->
  1079. <!-- from QMS_QUEUE_RESULT QQR-->
  1080. <!-- left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1081. <!-- </select>-->
  1082. <!-- 通过实绩Id查询链表ID -->
  1083. <select id="getListIdByResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  1084. select LIST_ID "listId",
  1085. CAPACITY_ID "capacityId"
  1086. from QMS_QUEUE_RESULT QQR
  1087. where QQR.RESULT_ID = #{resultId}
  1088. </select>
  1089. <!-- 查看排队转移详情 -->
  1090. <!-- <select id="getChangeQueueMes" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1091. <!-- select-->
  1092. <!-- *-->
  1093. <!-- from(-->
  1094. <!-- select-->
  1095. <!-- QQR.RESULT_ID "resultId",-->
  1096. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1097. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1098. <!-- RG1.GATEPOST_NAME "gatepostName1",-->
  1099. <!-- RG2.GATEPOST_NAME "gatepostName2",-->
  1100. <!-- QQR.RESULT_TRANSFER_TIME "resultTransferTime",-->
  1101. <!-- QQR.RESULT_TRANSFER_REASON "resultTransferReason",-->
  1102. <!-- (-->
  1103. <!-- <![CDATA[-->
  1104. <!-- select-->
  1105. <!-- count(*)-->
  1106. <!-- from-->
  1107. <!-- QMS_QUEUE_LIST QL-->
  1108. <!-- join QMS_QUEUE_GRID QG-->
  1109. <!-- on QG.GRID_ID = QL.GRID_ID-->
  1110. <!-- where-->
  1111. <!-- QL.LIST_NODE_ORDER <= QQL.list_node_order-->
  1112. <!-- and QL.GRID_ID = QQL.GRID_ID-->
  1113. <!-- and QL.DELETED = 0-->
  1114. <!-- ]]>-->
  1115. <!-- ) "listNodeOrder"-->
  1116. <!-- from QMS_QUEUE_RESULT QQR-->
  1117. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1118. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1119. <!-- left join OMSTRUCK_ORDER OO-->
  1120. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1121. <!-- left join RMS_CAPACITY RC-->
  1122. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1123. <!-- left join QMS_QUEUE_LIST QQL-->
  1124. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  1125. <!-- left join QMS_QUEUE_GRID QQG1 &#45;&#45;转移后门岗ID-->
  1126. <!-- on QQG1.GRID_ID = QQL.GRID_ID-->
  1127. <!-- left join RMS_GATEPOST RG1 &#45;&#45;转移后门岗-->
  1128. <!-- on QQG1.QUEUE_LOCATION_ID = RG1.GATEPOST_ID-->
  1129. <!-- left join QMS_QUEUE_GRID QQG2 &#45;&#45; 转移前门岗ID-->
  1130. <!-- on QQG2.GRID_ID = QQR.GRID_ID-->
  1131. <!-- left join RMS_GATEPOST RG2 &#45;&#45;转移前门岗-->
  1132. <!-- on RG2.GATEPOST_ID = QQG2.QUEUE_LOCATION_ID-->
  1133. <!-- where QQR.RESULT_TRANSFER_TIME is not null-->
  1134. <!--&#45;&#45; and QQL.DELETED = 0-->
  1135. <!-- and QQG1.GRID_TYPE = 3-->
  1136. <!-- )-->
  1137. <!-- <where>-->
  1138. <!-- <if test="orderNumber != null">-->
  1139. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1140. <!-- "orderNumber" like '%${item}%'-->
  1141. <!-- </foreach>-->
  1142. <!-- </if>-->
  1143. <!-- <if test="capacityNumber != null">-->
  1144. <!-- and-->
  1145. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1146. <!-- "capacityNumber" like '%${item}%'-->
  1147. <!-- </foreach>-->
  1148. <!-- </if>-->
  1149. <!-- <if test="gatepostName1 != null">-->
  1150. <!-- and-->
  1151. <!-- <foreach collection="gatepostName1" item="item" open="(" separator="or" close=")">-->
  1152. <!-- "gatepostName1" like '%${item}%'-->
  1153. <!-- </foreach>-->
  1154. <!-- </if>-->
  1155. <!-- <if test="gatepostName2 != null">-->
  1156. <!-- and-->
  1157. <!-- <foreach collection="gatepostName2" item="item" open="(" separator="or" close=")">-->
  1158. <!-- "gatepostName2" like '%${item}%'-->
  1159. <!-- </foreach>-->
  1160. <!-- </if>-->
  1161. <!-- <if test="resultTransferTime != null">-->
  1162. <!-- and-->
  1163. <!-- <foreach collection="resultTransferTime" item="item" open="(" separator="or" close=")">-->
  1164. <!-- "resultTransferTime" like '%${item}%'-->
  1165. <!-- </foreach>-->
  1166. <!-- </if>-->
  1167. <!-- <if test="resultTransferReason != null">-->
  1168. <!-- and-->
  1169. <!-- <foreach collection="resultTransferReason" item="item" open="(" separator="or" close=")">-->
  1170. <!-- "resultTransferReason" like '%${item}%'-->
  1171. <!-- </foreach>-->
  1172. <!-- </if>-->
  1173. <!-- </where>-->
  1174. <!-- <include refid="orderBy"></include>-->
  1175. <!-- <if test="orderField == null ">-->
  1176. <!-- order by "resultTransferTime" desc-->
  1177. <!-- </if>-->
  1178. <!-- </select>-->
  1179. <!-- 查询排队取消 -->
  1180. <select id="getQueueCancel" parameterType="java.util.Map" resultType="java.util.Map">
  1181. select
  1182. QQR.RESULT_ID "resultId",
  1183. OO.ORDER_NUMBER "orderNumber",
  1184. RC.CAPACITY_NUMBER "capacityNumber",
  1185. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1186. QQR.RESULT_CANCEL_REASON "resultCancelReason",
  1187. RM.MATERIAL_NAME "materialName",
  1188. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1189. RM.MATERIAL_MODEL "materialModel",
  1190. RG.GATEPOST_NAME "gatepostName"
  1191. from QMS_QUEUE_RESULT QQR
  1192. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1193. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1194. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1195. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1196. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1197. left join RMS_GATEPOST RG on QQR.GATEPOST_ID = RG.GATEPOST_ID
  1198. where
  1199. QQR.RESULT_CANCEL_TIME > to_date('2022-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
  1200. <if test="index != null">
  1201. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1202. </if>
  1203. <if test="oneDate != null">
  1204. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_CANCEL_TIME
  1205. </if>
  1206. <if test="startDate != null">
  1207. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_CANCEL_TIME
  1208. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_CANCEL_TIME
  1209. </if>
  1210. </select>
  1211. <!-- 通过实绩Id 查询数据 取消排队使用-->
  1212. <select id="getQueueCancelByResultId" parameterType="int" resultType="java.util.Map">
  1213. select OO.ORDER_NUMBER "orderNumber",
  1214. RC.CAPACITY_NUMBER "capacityNumber",
  1215. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1216. QQR.RESULT_CANCEL_REASON "resultCancelReason"
  1217. from QMS_QUEUE_RESULT QQR
  1218. left join TMSTRUCK_TOTAL_RESULT TTR
  1219. on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1220. left join OMSTRUCK_ORDER OO
  1221. on OO.ORDER_ID = TTR.ORDER_ID
  1222. left join RMS_CAPACITY RC
  1223. on RC.CAPACITY_ID = QQR.CAPACITY_ID
  1224. left join QMS_QUEUE_LIST QQL
  1225. on QQL.LIST_ID = QQR.LIST_ID
  1226. left join QMS_QUEUE_GRID QQG
  1227. on QQG.GRID_ID = QQL.GRID_ID
  1228. left join RMS_GATEPOST RG
  1229. on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID
  1230. where RESULT_ID = #{resultId}
  1231. </select>
  1232. <!-- 查询插队实绩-->
  1233. <!-- <select id="getQueueInsert" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">-->
  1234. <!-- select *-->
  1235. <!-- from (-->
  1236. <!-- select QQR.RESULT_ID "resultId",-->
  1237. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1238. <!-- RG.GATEPOST_NAME "gatepostName",-->
  1239. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1240. <!-- QQR.RESULT_INSERT_TIME "resultInsertTime",-->
  1241. <!-- QQR.RESULT_INSERT_REASON "resultInsertReason",-->
  1242. <!-- (-->
  1243. <!-- select count(*) from QMS_QUEUE_LIST QQL2-->
  1244. <!-- where QQL2.GRID_ID = QQL.GRID_ID and QQL.DELETED = 0-->
  1245. <!-- ) "queueNumber"-->
  1246. <!-- from QMS_QUEUE_RESULT QQR-->
  1247. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1248. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1249. <!-- left join OMSTRUCK_ORDER OO-->
  1250. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1251. <!-- left join QMS_QUEUE_LIST QQL-->
  1252. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1253. <!-- left join QMS_QUEUE_GRID QQG-->
  1254. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1255. <!-- left join RMS_GATEPOST RG-->
  1256. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  1257. <!-- left join RMS_CAPACITY RC-->
  1258. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1259. <!-- where QQR.RESULT_INSERT_TIME is not null-->
  1260. <!--&#45;&#45; and QQR.RESULT_END_TIME is null-->
  1261. <!-- )-->
  1262. <!-- <where>-->
  1263. <!-- <if test="orderNumber != null">-->
  1264. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1265. <!-- "orderNumber" like '%${item}%'-->
  1266. <!-- </foreach>-->
  1267. <!-- </if>-->
  1268. <!-- <if test="gatepostName != null">-->
  1269. <!-- and-->
  1270. <!-- <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">-->
  1271. <!-- "gatepostName" like '%${item}%'-->
  1272. <!-- </foreach>-->
  1273. <!-- </if>-->
  1274. <!-- <if test="capacityNumber != null">-->
  1275. <!-- and-->
  1276. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1277. <!-- "capacityNumber" like '%${item}%'-->
  1278. <!-- </foreach>-->
  1279. <!-- </if>-->
  1280. <!-- <if test="resultInsertTime != null">-->
  1281. <!-- and-->
  1282. <!-- <foreach collection="resultInsertTime" item="item" open="(" separator="or" close=")">-->
  1283. <!-- "resultInsertTime" like '%${item}%'-->
  1284. <!-- </foreach>-->
  1285. <!-- </if>-->
  1286. <!-- <if test="resultInsertReason != null">-->
  1287. <!-- and-->
  1288. <!-- <foreach collection="resultInsertReason" item="item" open="(" separator="or" close=")">-->
  1289. <!-- "resultInsertReason" like '%${item}%'-->
  1290. <!-- </foreach>-->
  1291. <!-- </if>-->
  1292. <!-- </where>-->
  1293. <!-- <include refid="orderBy"></include>-->
  1294. <!-- <if test="orderField == null ">-->
  1295. <!-- order by "resultInsertTime" desc-->
  1296. <!-- </if>-->
  1297. <!-- </select>-->
  1298. <!-- 查询所有排队结束 -->
  1299. <select id="getQueueEndResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1300. select
  1301. QQR.RESULT_ID "resultId",
  1302. OO.ORDER_NUMBER "orderNumber",
  1303. RC.CAPACITY_NUMBER "capacityNumber",
  1304. QQR.RESULT_END_TIME "resultEndTime",
  1305. RM.MATERIAL_NAME "materialName",
  1306. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1307. RM.MATERIAL_MODEL "materialModel"
  1308. from QMS_QUEUE_RESULT QQR
  1309. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1310. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1311. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1312. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1313. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1314. where
  1315. QQR.RESULT_END_TIME > to_date('2022-01-01 00:00:00', 'yyyy', 'yyyy-mm-dd hh24:mi:ss')
  1316. <if test="index != null">
  1317. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1318. </if>
  1319. <if test="oneDate != null">
  1320. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1321. </if>
  1322. <if test="startDate != null">
  1323. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1324. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_START_TIME
  1325. </if>
  1326. </select>
  1327. <!-- 排序 -->
  1328. <sql id="orderByEndTime">
  1329. <if test="orderField != null and orderField != ''">
  1330. order by "${orderField}"
  1331. <if test="orderType != null and orderType != ''">
  1332. ${orderType}
  1333. </if>
  1334. </if>
  1335. <if test="orderField == null ">
  1336. order by "resultEndTime" desc
  1337. </if>
  1338. </sql>
  1339. <!-- 汽车监控 -->
  1340. <select id="capacityMonitor" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  1341. select
  1342. QQR.RESULT_ID "resultId",
  1343. OO.ORDER_NUMBER "orderNumber",
  1344. RC.CAPACITY_NUMBER "capacityNumber",
  1345. QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",
  1346. QQR.RESULT_START_TIME "resultStartTime",
  1347. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  1348. QQR.RESULT_CANCEL_REASON "resultCancelReason",
  1349. QQR.RESULT_END_TIME "resultEndTime",
  1350. RM.MATERIAL_NAME "materialName",
  1351. RM.MATERIAL_SPECIFICATION "materialSpecification",
  1352. RM.MATERIAL_MODEL "materialModel"
  1353. from QMS_QUEUE_RESULT QQR
  1354. left join TMSTRUCK_TOTAL_RESULT TTR on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1355. left join OMSTRUCK_ORDER OO on TTR.ORDER_ID = OO.ORDER_ID
  1356. left join RMS_CAPACITY RC on QQR.CAPACITY_ID = RC.CAPACITY_ID
  1357. left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
  1358. left join RMS_MATERIAL RM on OOM.MATERIAL_ID = RM.MATERIAL_ID
  1359. where
  1360. QQR.RESULT_START_TIME > to_date('2022-01-01 00:00:00', 'yyyy', 'yyyy-mm-dd hh24:mi:ss')
  1361. <if test="index != null">
  1362. and instr(RC.CAPACITY_NUMBER, #{index}) > 0
  1363. </if>
  1364. <if test="oneDate != null">
  1365. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1366. </if>
  1367. <if test="startDate != null">
  1368. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= QQR.RESULT_START_TIME
  1369. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= QQR.RESULT_START_TIME
  1370. </if>
  1371. </select>
  1372. <!-- 通过门岗查询排队车数 -->
  1373. <!-- <select id="getQueueListByGatepost" parameterType="java.math.BigDecimal" resultType="java.util.Map">-->
  1374. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1375. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1376. <!-- rg.GATEPOST_NAME as "gatepostName",-->
  1377. <!-- (-->
  1378. <!-- <![CDATA[-->
  1379. <!-- select count(*)-->
  1380. <!-- from QMS_QUEUE_LIST QQL2-->
  1381. <!-- join QMS_QUEUE_GRID QQG2-->
  1382. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1383. <!-- where QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1384. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1385. <!-- and QQL2.DELETED = 0-->
  1386. <!-- ]]>-->
  1387. <!--) "listNodeOrder"-->
  1388. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1389. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1390. <!-- ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID-->
  1391. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1392. <!-- ON oo.ORDER_ID = ttr.ORDER_ID-->
  1393. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1394. <!-- ON rc.CAPACITY_ID = qqr.CAPACITY_ID-->
  1395. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1396. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1397. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1398. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1399. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1400. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1401. <!-- WHERE rg.GATEPOST_ID = #{gatepostId}-->
  1402. <!-- AND qql.DELETED = 0-->
  1403. <!-- </select>-->
  1404. <!-- 查询排队取消列表 -->
  1405. <!-- <select id="getQueueCancelList" resultType="java.util.Map">-->
  1406. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1407. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1408. <!-- qqr.RESULT_CANCEL_TIME as "resultCancelTime",-->
  1409. <!-- qqr.RESULT_CANCEL_REASON as "resultCancelReason",-->
  1410. <!-- rg.GATEPOST_NAME as "gatepostName"-->
  1411. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1412. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1413. <!-- ON qqr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID-->
  1414. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1415. <!-- ON oo.ORDER_ID = ttr.ORDER_ID-->
  1416. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1417. <!-- ON rc.CAPACITY_ID = qqr.CAPACITY_ID-->
  1418. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1419. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1420. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1421. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1422. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1423. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1424. <!-- WHERE qqr.RESULT_CANCEL_REASON IS NOT NULL-->
  1425. <!-- </select>-->
  1426. <!-- 查看各个门岗,仓库的实时状态 -->
  1427. <!-- <select id="getQueueStatusList" resultType="java.util.Map">-->
  1428. <!-- select RG.GATEPOST_NAME "gatepostName",-->
  1429. <!-- count(QQL.LIST_NODE_ORDER) "count"-->
  1430. <!-- from RMS_GATEPOST RG-->
  1431. <!-- LEFT JOIN QMS_QUEUE_LIST QQL-->
  1432. <!-- on QQL.GRID_ID = RG.GATEPOST_ID and QQL.DELETED = 0-->
  1433. <!-- group by RG.GATEPOST_NAME-->
  1434. <!-- </select>-->
  1435. <!-- 查询指令接收 -->
  1436. <!-- <select id="getOrderReceiveList" resultType="java.util.Map">-->
  1437. <!-- SELECT oo.ORDER_NUMBER as "orderNumber",-->
  1438. <!-- rc.CAPACITY_NUMBER as "capacityNumber",-->
  1439. <!-- qqr.RESULT_ACCEPT_TIME as "resultAcceptTime",-->
  1440. <!-- rg.GATEPOST_NAME as "gatepostName"-->
  1441. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1442. <!-- LEFT JOIN QMS_QUEUE_LIST qql-->
  1443. <!-- ON qql.LIST_ID = qqr.LIST_ID-->
  1444. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1445. <!-- ON rc.CAPACITY_ID = qql.CAPACITY_ID-->
  1446. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1447. <!-- ON qqg.GRID_ID = qql.GRID_ID-->
  1448. <!-- LEFT JOIN RMS_GATEPOST rg-->
  1449. <!-- ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID-->
  1450. <!-- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr-->
  1451. <!-- ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID-->
  1452. <!-- LEFT JOIN OMSTRUCK_ORDER oo-->
  1453. <!-- ON ttr.ORDER_ID = oo.ORDER_ID-->
  1454. <!-- </select>-->
  1455. <!-- 根据车牌号查询指令接收 -->
  1456. <select id="getOrderReceive2" resultType="java.util.Map" parameterType="java.util.Map">
  1457. SELECT DISTINCT oo.ORDER_NUMBER as "orderNumber",
  1458. rc.CAPACITY_NUMBER as "capacityNumber",
  1459. rg.GATEPOST_NAME as "gatepostName",
  1460. (
  1461. SELECT count(*)
  1462. FROM QMS_QUEUE_LIST qql
  1463. WHERE qql.DELETED = 0
  1464. AND qql.GRID_ID = #{gridId}
  1465. ) "count",
  1466. (
  1467. <![CDATA[
  1468. select count(*)
  1469. from QMS_QUEUE_LIST QQL2
  1470. join QMS_QUEUE_GRID QQG2
  1471. on QQG2.GRID_ID = QQL2.GRID_ID
  1472. where QQL2.LIST_NODE_ORDER <= QQL.list_node_order
  1473. and QQL2.GRID_ID = QQL.GRID_ID
  1474. and QQL2.DELETED = 0
  1475. ]]>) "listNodeOrder"
  1476. FROM QMS_QUEUE_RESULT qqr
  1477. LEFT JOIN RMS_CAPACITY rc
  1478. ON rc.CAPACITY_ID = qqr.CAPACITY_ID
  1479. LEFT JOIN QMS_QUEUE_GRID qqg
  1480. ON qqg.GRID_ID = qqr.GRID_ID
  1481. LEFT JOIN QMS_QUEUE_LIST qql
  1482. ON qqr.LIST_ID = qql.LIST_ID
  1483. LEFT JOIN RMS_GATEPOST rg
  1484. ON rg.GATEPOST_ID = qqg.QUEUE_LOCATION_ID
  1485. LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
  1486. ON ttr.RESULT_TOTAL_ID = qqr.RESULT_TOTAL_ID
  1487. LEFT JOIN OMSTRUCK_ORDER oo
  1488. ON ttr.ORDER_ID = oo.ORDER_ID
  1489. WHERE rc.CAPACITY_NUMBER = #{capacityNumber}
  1490. and OO.ORDER_STATUS = 1
  1491. </select>
  1492. <!-- 通过车牌号查询网格id -->
  1493. <!-- <select id="getGridId" parameterType="java.lang.String" resultType="DECIMAL">-->
  1494. <!-- SELECT qqg.GRID_ID as "gridId"-->
  1495. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1496. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1497. <!-- ON qqr.GRID_ID = qqg.GRID_ID-->
  1498. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1499. <!-- ON qqr.CAPACITY_ID = rc.CAPACITY_ID-->
  1500. <!-- WHERE qqr.RESULT_START_TIME IS NULL-->
  1501. <!-- AND rc.CAPACITY_NUMBER = #{capacityNumber}-->
  1502. <!-- </select>-->
  1503. <!-- <select id="getGridIdNotNull" parameterType="java.lang.String" resultType="DECIMAL">-->
  1504. <!-- SELECT qqg.GRID_ID as "gridId"-->
  1505. <!-- FROM QMS_QUEUE_RESULT qqr-->
  1506. <!-- LEFT JOIN QMS_QUEUE_GRID qqg-->
  1507. <!-- ON qqr.GRID_ID = qqg.GRID_ID-->
  1508. <!-- LEFT JOIN RMS_CAPACITY rc-->
  1509. <!-- ON qqr.CAPACITY_ID = rc.CAPACITY_ID-->
  1510. <!-- WHERE qqr.RESULT_END_TIME IS NULL-->
  1511. <!-- AND qqr.RESULT_CANCEL_TIME IS NULL-->
  1512. <!-- AND rc.CAPACITY_NUMBER = #{capacityNumber}-->
  1513. <!-- </select>-->
  1514. <!-- 通过运单号得到总实绩id -->
  1515. <select id="getResultTotalId" parameterType="java.lang.String" resultType="DECIMAL">
  1516. SELECT ttr.RESULT_TOTAL_ID
  1517. FROM TMSTRUCK_TOTAL_RESULT ttr
  1518. LEFT JOIN OMSTRUCK_ORDER oo
  1519. ON ttr.ORDER_ID = oo.ORDER_ID
  1520. WHERE oo.ORDER_NUMBER = #{orderNumber}
  1521. </select>
  1522. <!-- 通过车牌号得到实绩id -->
  1523. <select id="getResultIdByCapacityId" parameterType="java.lang.String" resultType="DECIMAL">
  1524. SELECT qqr.RESULT_ID
  1525. FROM QMS_QUEUE_RESULT qqr
  1526. LEFT JOIN RMS_CAPACITY rc
  1527. ON rc.CAPACITY_ID = qqr.CAPACITY_ID
  1528. WHERE rc.CAPACITY_NUMBER = #{capacityNumber}
  1529. AND qqr.RESULT_END_TIME IS NULL
  1530. </select>
  1531. <!-- 通过运力id和总实绩id查询排队实绩id -->
  1532. <select id="getQueueResultId" parameterType="java.util.Map" resultType="DECIMAL">
  1533. SELECT qqr.RESULT_ID as "resultId"
  1534. FROM QMS_QUEUE_RESULT qqr
  1535. WHERE qqr.CAPACITY_ID = #{capacityId}
  1536. AND qqr.RESULT_TOTAL_ID = #{resultTotalId}
  1537. </select>
  1538. <!-- ====================================仓库排队=============================================== -->
  1539. <!-- 查询仓库排队申请 -->
  1540. <!-- <select id="getWarehouseQueueApply" parameterType="java.util.Map" resultType="java.util.Map">-->
  1541. <!-- select *-->
  1542. <!-- from (-->
  1543. <!-- select OO.ORDER_NUMBER "orderNumber",-->
  1544. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1545. <!-- QQR.RESULT_APPLYFOR_TIME "resultApplyforTime",-->
  1546. <!-- RPP.PLATFORM_NAME "platformName",-->
  1547. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  1548. <!-- QQR.RESULT_DOWN_TIME "resultDownTime"-->
  1549. <!-- from QMS_QUEUE_RESULT QQR-->
  1550. <!-- left join QMS_QUEUE_GRID QQG-->
  1551. <!-- on QQG.GRID_ID = QQR.GRID_ID-->
  1552. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1553. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1554. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1555. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1556. <!-- left join OMSTRUCK_ORDER OO-->
  1557. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1558. <!-- join RMS_WAREHOUSE RW-->
  1559. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1560. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1561. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  1562. <!-- left join RMS_CAPACITY RC-->
  1563. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1564. <!-- where QQR.RESULT_ACCEPT_TIME is null-->
  1565. <!-- and QQG.GRID_TYPE = 1-->
  1566. <!-- )-->
  1567. <!-- <where>-->
  1568. <!-- <if test="orderNumber != null">-->
  1569. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1570. <!-- "orderNumber" like '%${item}%'-->
  1571. <!-- </foreach>-->
  1572. <!-- </if>-->
  1573. <!-- <if test="capacityNumber != null">-->
  1574. <!-- and-->
  1575. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1576. <!-- "capacityNumber" like '%${item}%'-->
  1577. <!-- </foreach>-->
  1578. <!-- </if>-->
  1579. <!-- <if test="resultApplyforTime != null">-->
  1580. <!-- and-->
  1581. <!-- <foreach collection="resultApplyforTime" item="item" open="(" separator="or" close=")">-->
  1582. <!-- "resultApplyforTime" like '%${item}%'-->
  1583. <!-- </foreach>-->
  1584. <!-- </if>-->
  1585. <!-- <if test="platformName != null">-->
  1586. <!-- and-->
  1587. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1588. <!-- "platformName" like '%${item}%'-->
  1589. <!-- </foreach>-->
  1590. <!-- </if>-->
  1591. <!-- <if test="warehouseName != null">-->
  1592. <!-- and-->
  1593. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  1594. <!-- "warehouseName" like '%${item}%'-->
  1595. <!-- </foreach>-->
  1596. <!-- </if>-->
  1597. <!-- </where>-->
  1598. <!-- <include refid="orderBy"></include>-->
  1599. <!-- <if test="orderField == null ">-->
  1600. <!-- order by "resultApplyforTime" desc-->
  1601. <!-- </if>-->
  1602. <!-- </select>-->
  1603. <!-- 查询仓库司机指令接收 -->
  1604. <!-- <select id="getWarehouseOrderReceive" parameterType="java.util.Map" resultType="java.util.Map">-->
  1605. <!-- select *-->
  1606. <!-- from (-->
  1607. <!-- select-->
  1608. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1609. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1610. <!-- QQR.RESULT_ACCEPT_TIME "resultAcceptTime",-->
  1611. <!-- RPP.PLATFORM_NAME "platformName",-->
  1612. <!-- QQR.RESULT_DOWN_TIME "resultDownTime"-->
  1613. <!-- from QMS_QUEUE_RESULT QQR-->
  1614. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1615. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1616. <!-- left join OMSTRUCK_ORDER OO-->
  1617. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1618. <!-- left join RMS_CAPACITY RC-->
  1619. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1620. <!-- left join QMS_QUEUE_GRID QQG-->
  1621. <!-- on QQG.GRID_ID = QQR.GRID_ID-->
  1622. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1623. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1624. <!-- where QQR.RESULT_END_TIME is null and QQG.GRID_TYPE = 1-->
  1625. <!-- )-->
  1626. <!-- <where>-->
  1627. <!-- <if test="capacityNumber != null">-->
  1628. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1629. <!-- "capacityNumber" like '%${item}%'-->
  1630. <!-- </foreach>-->
  1631. <!-- </if>-->
  1632. <!-- <if test="orderNumber != null">-->
  1633. <!-- and-->
  1634. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1635. <!-- "orderNumber" like '%${item}%'-->
  1636. <!-- </foreach>-->
  1637. <!-- </if>-->
  1638. <!-- <if test="platformName != null">-->
  1639. <!-- and-->
  1640. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1641. <!-- "platformName" like '%${item}%'-->
  1642. <!-- </foreach>-->
  1643. <!-- </if>-->
  1644. <!-- <if test="resultAcceptTime != null">-->
  1645. <!-- and-->
  1646. <!-- <foreach collection="resultAcceptTime" item="item" open="(" separator="or" close=")">-->
  1647. <!-- "resultAcceptTime" like '%${item}%'-->
  1648. <!-- </foreach>-->
  1649. <!-- </if>-->
  1650. <!-- <if test="resultDownTime != null">-->
  1651. <!-- and-->
  1652. <!-- <foreach collection="resultDownTime" item="item" open="(" separator="or" close=")">-->
  1653. <!-- "resultDownTime" like '%${item}%'-->
  1654. <!-- </foreach>-->
  1655. <!-- </if>-->
  1656. <!-- </where>-->
  1657. <!-- <include refid="orderBy"></include>-->
  1658. <!-- <if test="orderField == null ">-->
  1659. <!-- order by "resultDownTime" desc-->
  1660. <!-- </if>-->
  1661. <!-- </select>-->
  1662. <!-- 查询仓库排队开始 -->
  1663. <!-- <select id="getWarehouseQueueListByQueueUp" parameterType="java.util.Map" resultType="java.util.Map">-->
  1664. <!-- select-->
  1665. <!-- *-->
  1666. <!-- from(-->
  1667. <!-- select-->
  1668. <!-- QQR.RESULT_ID "resultId",-->
  1669. <!-- ASO.SALE_NUMBER "orderNo",-->
  1670. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1671. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1672. <!-- QQR.RESULT_START_TIME "resultStartTime",-->
  1673. <!-- RPP.PLATFORM_NAME "platformName",-->
  1674. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  1675. <!-- (-->
  1676. <!-- <![CDATA[-->
  1677. <!-- select-->
  1678. <!-- count(*)-->
  1679. <!-- from-->
  1680. <!-- QMS_QUEUE_LIST QQL2-->
  1681. <!-- join QMS_QUEUE_GRID QQG2-->
  1682. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1683. <!-- where-->
  1684. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1685. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1686. <!-- and QQL2.DELETED = 0-->
  1687. <!-- ]]>-->
  1688. <!-- ) "listNodeOrder",-->
  1689. <!-- RC.CAPACITY_VIP "capacityVip"-->
  1690. <!-- from QMS_QUEUE_RESULT QQR-->
  1691. <!-- left join QMS_QUEUE_LIST QQL-->
  1692. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1693. <!-- left join QMS_QUEUE_GRID QQG-->
  1694. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1695. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1696. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1697. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1698. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1699. <!-- left join OMSTRUCK_ORDER OO-->
  1700. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1701. <!-- left join AMS_SALE_ORDER ASO-->
  1702. <!-- on ASO.SALE_ORDER_ID = OO.ORDER_PLAN_ID-->
  1703. <!-- left join RMS_CAPACITY RC-->
  1704. <!-- on QQR.CAPACITY_ID = RC.CAPACITY_ID-->
  1705. <!-- join RMS_WAREHOUSE RW-->
  1706. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1707. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1708. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  1709. <!-- where QQR.RESULT_START_TIME is not null-->
  1710. <!-- and QQL.DELETED = 0-->
  1711. <!-- <if test="gridId != null">-->
  1712. <!-- and QQL.GRID_ID = #{gridId}-->
  1713. <!-- </if>-->
  1714. <!-- )-->
  1715. <!-- <where>-->
  1716. <!-- <if test="saleNumber != null">-->
  1717. <!-- <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
  1718. <!-- "saleNumber" like '%${item}%'-->
  1719. <!-- </foreach>-->
  1720. <!-- </if>-->
  1721. <!-- <if test="orderNumber != null">-->
  1722. <!-- and-->
  1723. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1724. <!-- "orderNumber" like '%${item}%'-->
  1725. <!-- </foreach>-->
  1726. <!-- </if>-->
  1727. <!-- <if test="capacityNumber != null">-->
  1728. <!-- and-->
  1729. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1730. <!-- "capacityNumber" like '%${item}%'-->
  1731. <!-- </foreach>-->
  1732. <!-- </if>-->
  1733. <!-- <if test="resultStartTime != null">-->
  1734. <!-- and-->
  1735. <!-- <foreach collection="resultStartTime" item="item" open="(" separator="or" close=")">-->
  1736. <!-- "resultStartTime" like '%${item}%'-->
  1737. <!-- </foreach>-->
  1738. <!-- </if>-->
  1739. <!-- <if test="platformName != null">-->
  1740. <!-- and-->
  1741. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1742. <!-- "platformName" like '%${item}%'-->
  1743. <!-- </foreach>-->
  1744. <!-- </if>-->
  1745. <!-- <if test="listNodeOrder != null">-->
  1746. <!-- and-->
  1747. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1748. <!-- "listNodeOrder" like '%${item}%'-->
  1749. <!-- </foreach>-->
  1750. <!-- </if>-->
  1751. <!-- <if test="warehouseName != null">-->
  1752. <!-- and-->
  1753. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  1754. <!-- "warehouseName" like '%${item}%'-->
  1755. <!-- </foreach>-->
  1756. <!-- </if>-->
  1757. <!-- </where>-->
  1758. <!-- <include refid="orderBy"></include>-->
  1759. <!-- <if test="orderField == null ">-->
  1760. <!-- order by "resultStartTime" desc-->
  1761. <!-- </if>-->
  1762. <!-- </select>-->
  1763. <!-- 查看仓库排队详情 -->
  1764. <!-- <select id="getWarehouseQueueMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  1765. <!-- select *-->
  1766. <!-- from (-->
  1767. <!-- select-->
  1768. <!-- QQR.RESULT_ID "resultId",-->
  1769. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1770. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1771. <!-- RPP.PLATFORM_NAME "platformName",-->
  1772. <!-- RC.CAPACITY_VIP "capacityVip",-->
  1773. <!-- (-->
  1774. <!-- <![CDATA[-->
  1775. <!-- select-->
  1776. <!-- count(*)-->
  1777. <!-- from-->
  1778. <!-- QMS_QUEUE_LIST QQL2-->
  1779. <!-- join QMS_QUEUE_GRID QQG2-->
  1780. <!-- on QQG2.GRID_ID = QQL2.GRID_ID-->
  1781. <!-- where-->
  1782. <!-- QQL2.LIST_NODE_ORDER <= QQL.list_node_order-->
  1783. <!-- and QQL2.GRID_ID = QQL.GRID_ID-->
  1784. <!-- and QQL2.DELETED = 0-->
  1785. <!-- ]]>-->
  1786. <!-- ) "listNodeOrder",-->
  1787. <!-- QQR.RESULT_START_TIME "resultStartTime"-->
  1788. <!-- from OMSTRUCK_ORDER OO-->
  1789. <!-- left join RMS_CAPACITY RC-->
  1790. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1791. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1792. <!-- on TTR.ORDER_ID = OO.ORDER_ID-->
  1793. <!-- left join QMS_QUEUE_RESULT QQR-->
  1794. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1795. <!-- left join QMS_QUEUE_LIST QQL-->
  1796. <!-- on QQR.LIST_ID = QQL.LIST_ID-->
  1797. <!-- left join QMS_QUEUE_GRID QQG-->
  1798. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1799. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1800. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1801. <!-- where-->
  1802. <!-- QQR.RESULT_START_TIME is not null-->
  1803. <!-- and QQG.GRID_TYPE in (1, 2)-->
  1804. <!-- and QQL.DELETED = 0-->
  1805. <!-- <if test="orderNum != null">-->
  1806. <!-- and OO.ORDER_NUMBER = #{orderNum}-->
  1807. <!-- </if>-->
  1808. <!-- <if test="platformId != null">-->
  1809. <!-- and RPP.PLATFORM_ID = #{platformId}-->
  1810. <!-- </if>-->
  1811. <!-- )-->
  1812. <!-- <where>-->
  1813. <!-- <if test="orderNumber != null">-->
  1814. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1815. <!-- "orderNumber" like '%${item}%'-->
  1816. <!-- </foreach>-->
  1817. <!-- </if>-->
  1818. <!-- <if test="capacityNumber != null">-->
  1819. <!-- and-->
  1820. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1821. <!-- "capacityNumber" like '%${item}%'-->
  1822. <!-- </foreach>-->
  1823. <!-- </if>-->
  1824. <!-- <if test="platformName != null">-->
  1825. <!-- and-->
  1826. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  1827. <!-- "platformName" like '%${item}%'-->
  1828. <!-- </foreach>-->
  1829. <!-- </if>-->
  1830. <!-- <if test="listNodeOrder != null">-->
  1831. <!-- and-->
  1832. <!-- <foreach collection="listNodeOrder" item="item" open="(" separator="or" close=")">-->
  1833. <!-- "listNodeOrder" like '%${item}%'-->
  1834. <!-- </foreach>-->
  1835. <!-- </if>-->
  1836. <!-- </where>-->
  1837. <!-- <include refid="orderBy"></include>-->
  1838. <!-- <if test="orderField == null ">-->
  1839. <!-- order by "resultStartTime" desc-->
  1840. <!-- </if>-->
  1841. <!-- </select>-->
  1842. <!-- 查询排队转移 -->
  1843. <!-- <select id="getWarehouseQueueChange" resultType="java.util.Map" parameterType="java.util.Map">-->
  1844. <!-- select-->
  1845. <!-- *-->
  1846. <!-- from(-->
  1847. <!-- select-->
  1848. <!-- QQR.RESULT_ID "resultId",-->
  1849. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1850. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1851. <!-- RPP2.PLATFORM_NAME "platformName2",-->
  1852. <!-- RW2.WAREHOUSE_NAME "warehouseName2",-->
  1853. <!-- RPP1.PLATFORM_NAME "platformName1",-->
  1854. <!-- RW1.WAREHOUSE_NAME "warehouseName1",-->
  1855. <!-- QQR.RESULT_TRANSFER_TIME "resultTransferTime",-->
  1856. <!-- QQR.RESULT_TRANSFER_REASON "resultTransferReason",-->
  1857. <!-- (-->
  1858. <!-- <![CDATA[-->
  1859. <!-- select-->
  1860. <!-- count(*)-->
  1861. <!-- from-->
  1862. <!-- QMS_QUEUE_LIST QL-->
  1863. <!-- join QMS_QUEUE_GRID QG-->
  1864. <!-- on QG.GRID_ID = QL.GRID_ID-->
  1865. <!-- where-->
  1866. <!-- QL.LIST_NODE_ORDER <= QQL.list_node_order-->
  1867. <!-- and QL.GRID_ID = QQL.GRID_ID-->
  1868. <!-- and QL.DELETED = 0-->
  1869. <!-- ]]>-->
  1870. <!-- ) "listNodeOrder"-->
  1871. <!-- from QMS_QUEUE_RESULT QQR-->
  1872. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1873. <!-- on QQR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID-->
  1874. <!-- left join OMSTRUCK_ORDER OO-->
  1875. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1876. <!-- left join RMS_CAPACITY RC-->
  1877. <!-- on RC.CAPACITY_ID = QQR.CAPACITY_ID-->
  1878. <!-- left join QMS_QUEUE_LIST QQL-->
  1879. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  1880. <!-- left join QMS_QUEUE_GRID QQG1 &#45;&#45;转移后网格ID-->
  1881. <!-- on QQG1.GRID_ID = QQL.GRID_ID-->
  1882. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP1 &#45;&#45;转移后月台名称-->
  1883. <!-- on RPP1.PLATFORM_ID = QQG1.QUEUE_LOCATION_ID-->
  1884. <!-- join RMS_WAREHOUSE RW1 &#45;&#45;转移后仓库名称-->
  1885. <!-- on RW1.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1886. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1887. <!-- where RPG.PLATFORM_ID = QQG1.QUEUE_LOCATION_ID)-->
  1888. <!-- left join QMS_QUEUE_GRID QQG2 &#45;&#45;转移前网格ID-->
  1889. <!-- on QQG2.GRID_ID = QQR.GRID_ID-->
  1890. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP2 &#45;&#45;转移前月台名称-->
  1891. <!-- on RPP2.PLATFORM_ID = QQG2.QUEUE_LOCATION_ID-->
  1892. <!-- join RMS_WAREHOUSE RW2 &#45;&#45;转移前仓库名称-->
  1893. <!-- on RW2.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1894. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1895. <!-- where RPG.PLATFORM_ID = QQG2.QUEUE_LOCATION_ID)-->
  1896. <!-- where QQR.RESULT_TRANSFER_TIME is not null-->
  1897. <!--&#45;&#45; and QQL.DELETED = 0-->
  1898. <!-- and QQG1.GRID_TYPE = 1-->
  1899. <!-- )-->
  1900. <!-- <where>-->
  1901. <!-- <if test="orderNumber != null">-->
  1902. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1903. <!-- "orderNumber" like '%${item}%'-->
  1904. <!-- </foreach>-->
  1905. <!-- </if>-->
  1906. <!-- <if test="capacityNumber != null">-->
  1907. <!-- and-->
  1908. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1909. <!-- "capacityNumber" like '%${item}%'-->
  1910. <!-- </foreach>-->
  1911. <!-- </if>-->
  1912. <!-- <if test="platformName2 != null">-->
  1913. <!-- and-->
  1914. <!-- <foreach collection="platformName2" item="item" open="(" separator="or" close=")">-->
  1915. <!-- "platformName2" like '%${item}%'-->
  1916. <!-- </foreach>-->
  1917. <!-- </if>-->
  1918. <!-- <if test="capacityNumber != null">-->
  1919. <!-- and-->
  1920. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1921. <!-- "capacityNumber" like '%${item}%'-->
  1922. <!-- </foreach>-->
  1923. <!-- </if>-->
  1924. <!-- <if test="platformName1 != null">-->
  1925. <!-- and-->
  1926. <!-- <foreach collection="platformName1" item="item" open="(" separator="or" close=")">-->
  1927. <!-- "platformName1" like '%${item}%'-->
  1928. <!-- </foreach>-->
  1929. <!-- </if>-->
  1930. <!-- <if test="warehouseName1 != null">-->
  1931. <!-- and-->
  1932. <!-- <foreach collection="warehouseName1" item="item" open="(" separator="or" close=")">-->
  1933. <!-- "warehouseName1" like '%${item}%'-->
  1934. <!-- </foreach>-->
  1935. <!-- </if>-->
  1936. <!-- <if test="resultTransferTime != null">-->
  1937. <!-- and-->
  1938. <!-- <foreach collection="resultTransferTime" item="item" open="(" separator="or" close=")">-->
  1939. <!-- "resultTransferTime" like '%${item}%'-->
  1940. <!-- </foreach>-->
  1941. <!-- </if>-->
  1942. <!-- <if test="resultTransferReason != null">-->
  1943. <!-- and-->
  1944. <!-- <foreach collection="resultTransferReason" item="item" open="(" separator="or" close=")">-->
  1945. <!-- "resultTransferReason" like '%${item}%'-->
  1946. <!-- </foreach>-->
  1947. <!-- </if>-->
  1948. <!-- </where>-->
  1949. <!-- <include refid="orderBy"></include>-->
  1950. <!-- <if test="orderField == null ">-->
  1951. <!-- order by "resultTransferTime" desc-->
  1952. <!-- </if>-->
  1953. <!-- </select>-->
  1954. <!-- 查询仓库排队结束 -->
  1955. <!-- <select id="getWarehouseQueueEndMes" resultType="java.util.Map" parameterType="java.util.Map">-->
  1956. <!-- select *-->
  1957. <!-- from (-->
  1958. <!-- select QQR.RESULT_ID "resultId",-->
  1959. <!-- OO.ORDER_NUMBER "orderNumber",-->
  1960. <!-- RC.CAPACITY_NUMBER "capacityNumber",-->
  1961. <!-- QQR.RESULT_END_TIME "resultEndTime",-->
  1962. <!-- RW.WAREHOUSE_NAME "warehouseName",-->
  1963. <!-- RPP.PLATFORM_NAME "platformName"-->
  1964. <!-- from QMS_QUEUE_RESULT QQR-->
  1965. <!-- left join TMSTRUCK_TOTAL_RESULT TTR-->
  1966. <!-- on TTR.RESULT_TOTAL_ID = QQR.RESULT_TOTAL_ID-->
  1967. <!-- left join OMSTRUCK_ORDER OO-->
  1968. <!-- on OO.ORDER_ID = TTR.ORDER_ID-->
  1969. <!-- left join RMS_CAPACITY RC-->
  1970. <!-- on RC.CAPACITY_ID = OO.CAPACITY_ID-->
  1971. <!-- left join QMS_QUEUE_LIST QQL-->
  1972. <!-- on QQL.LIST_ID = QQR.LIST_ID-->
  1973. <!-- left join QMS_QUEUE_GRID QQG-->
  1974. <!-- on QQG.GRID_ID = QQL.GRID_ID-->
  1975. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  1976. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  1977. <!-- join RMS_WAREHOUSE RW-->
  1978. <!-- on RW.WAREHOUSE_ID = (select distinct WAREHOUSE_ID-->
  1979. <!-- from RMS_PWAREHOUSE_GRID RPG-->
  1980. <!-- where RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID)-->
  1981. <!-- where QQR.RESULT_END_TIME is not null-->
  1982. <!-- and QQG.GRID_TYPE = 1-->
  1983. <!-- )-->
  1984. <!-- <where>-->
  1985. <!-- <if test="orderNumber != null">-->
  1986. <!-- <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">-->
  1987. <!-- "orderNumber" like '%${item}%'-->
  1988. <!-- </foreach>-->
  1989. <!-- </if>-->
  1990. <!-- <if test="capacityNumber != null">-->
  1991. <!-- and-->
  1992. <!-- <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">-->
  1993. <!-- "capacityNumber" like '%${item}%'-->
  1994. <!-- </foreach>-->
  1995. <!-- </if>-->
  1996. <!-- <if test="resultEndTime != null">-->
  1997. <!-- and-->
  1998. <!-- <foreach collection="resultEndTime" item="item" open="(" separator="or" close=")">-->
  1999. <!-- "resultEndTime" like '%${item}%'-->
  2000. <!-- </foreach>-->
  2001. <!-- </if>-->
  2002. <!-- <if test="warehouseName != null">-->
  2003. <!-- and-->
  2004. <!-- <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">-->
  2005. <!-- "warehouseName" like '%${item}%'-->
  2006. <!-- </foreach>-->
  2007. <!-- </if>-->
  2008. <!-- <if test="platformName != null">-->
  2009. <!-- and-->
  2010. <!-- <foreach collection="platformName" item="item" open="(" separator="or" close=")">-->
  2011. <!-- "platformName" like '%${item}%'-->
  2012. <!-- </foreach>-->
  2013. <!-- </if>-->
  2014. <!-- </where>-->
  2015. <!-- <include refid="orderBy"></include>-->
  2016. <!-- <if test="orderField == null ">-->
  2017. <!-- order by "resultEndTime" desc-->
  2018. <!-- </if>-->
  2019. <!-- </select>-->
  2020. <!--&lt;!&ndash; 通过运输订单Id查询推送给司机的数据 &ndash;&gt;-->
  2021. <!-- <select id="sendEnFactoryMesToWebSocket" parameterType="int" resultType="java.util.Map">-->
  2022. <!-- select-->
  2023. <!-- OO.ORDER_ID "orderId",-->
  2024. <!-- OO.ORDER_NUMBER "orderNumber",-->
  2025. <!-- RC.CAPACITY_NUMBER "capacityNumber"-->
  2026. <!-- from OMSTRUCK_ORDER OO-->
  2027. <!-- LEFT JOIN RMS_CAPACITY RC-->
  2028. <!-- ON RC.CAPACITY_ID = OO.CAPACITY_ID-->
  2029. <!-- WHERE ORDER_ID = #{orderId}-->
  2030. <!-- </select>-->
  2031. <!-- 通过网格Id查询进厂门岗名称 -->
  2032. <!-- <select id="queryGatepostNameByGridId" parameterType="int" resultType="java.util.Map">-->
  2033. <!-- select RG.GATEPOST_NAME "gatepostName"-->
  2034. <!-- from QMS_QUEUE_GRID QQG-->
  2035. <!-- left join RMS_GATEPOST RG-->
  2036. <!-- on RG.GATEPOST_ID = QQG.QUEUE_LOCATION_ID-->
  2037. <!-- where QQG.GRID_ID = #{gridId}-->
  2038. <!-- </select>-->
  2039. <!-- 通过运输订单Id查询司机仓库排队的数据 -->
  2040. <!-- <select id="sendWarehouseMesToWebSocket" parameterType="int" resultType="java.util.Map">-->
  2041. <!-- select-->
  2042. <!-- OO.ORDER_ID "orderId",-->
  2043. <!-- OO.ORDER_NUMBER "orderNumber",-->
  2044. <!-- RCD.DRIVER_NAME "driverName",-->
  2045. <!-- RC.CAPACITY_NUMBER "capacityNumber"-->
  2046. <!-- from OMSTRUCK_ORDER OO-->
  2047. <!-- LEFT JOIN RMS_CAPACITY RC-->
  2048. <!-- ON RC.CAPACITY_ID = OO.CAPACITY_ID-->
  2049. <!-- LEFT JOIN RMS_CAR_DRIVER RCD-->
  2050. <!-- ON RCD.DRIVER_ID = OO.DRIVER_ID-->
  2051. <!-- WHERE ORDER_ID = #{orderId}-->
  2052. <!-- </select>-->
  2053. <!-- 通过月台网格ID查询仓库名称 和 月台名称 -->
  2054. <!-- <select id="queryWarehouseNameByPlatformId" parameterType="int" resultType="java.util.Map">-->
  2055. <!-- select RPP.PLATFORM_NAME "platformName",-->
  2056. <!-- ( SELECT DISTINCT-->
  2057. <!-- RW.WAREHOUSE_NAME-->
  2058. <!-- FROM "RMS_PWAREHOUSE_GRID" RPG-->
  2059. <!-- JOIN RMS_WAREHOUSE RW-->
  2060. <!-- ON RW.WAREHOUSE_ID = RPG.WAREHOUSE_ID-->
  2061. <!-- WHERE RPG.PLATFORM_ID = QQG.QUEUE_LOCATION_ID AND PLATFORM_ID IS NOT NULL )-->
  2062. <!-- "warehouseName"-->
  2063. <!-- from QMS_QUEUE_GRID QQG-->
  2064. <!-- left join RMS_PWAREHOUSE_PLATFORM RPP-->
  2065. <!-- on RPP.PLATFORM_ID = QQG.QUEUE_LOCATION_ID-->
  2066. <!-- where QQG.GRID_ID = #{gridId}-->
  2067. <!-- </select>-->
  2068. <!-- 通过订单Id查询物资下面的仓储网格ID -->
  2069. <select id="getGridIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  2070. select QQR.GRID_ID "grid"
  2071. from OMSTRUCK_ORDER_MATERIAL OOM
  2072. left join QMS_QUEUE_GRID QQR on OOM.MATERIAL_ID = QQR.QUEUE_LOCATION_ID
  2073. where OOM.ORDER_ID = #{orderId} and QQR.GRID_TYPE = 4
  2074. </select>
  2075. <select id="getMaterialIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.lang.Integer">
  2076. select OOM.MATERIAL_ID from OMSTRUCK_ORDER_MATERIAL OOM where OOM.ORDER_ID = #{orderId}
  2077. </select>
  2078. <select id="getQueueResultByOrderId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  2079. select QQR.RESULT_ID "resultId",
  2080. QQR.RESULT_END_TIME "resultEndTime",
  2081. QQR.GRID_ID "gridId",
  2082. QQR.RESULT_DOWN_TIME "resultDownTime",
  2083. QQR.RESULT_START_TIME "resultStartTime",
  2084. QQR.IS_SPELLING "isSpelling",
  2085. QQR.RESULT_CANCEL_TIME "resultCancelTime",
  2086. QQR.RESULT_INSERT_TIME "resultInsertTime",
  2087. QQR.LIST_ID "listId",
  2088. RG.GATEPOST_NAME "gatepostName",
  2089. (case
  2090. when QQR.IS_SPELLING = 0
  2091. then (select QQL.ENTRY_SURE_TIME
  2092. from QMS_QUEUE_LIST QQL
  2093. where QQR.RESULT_ID = QQL.QUEUE_RESULT_ID)
  2094. when QQR.IS_SPELLING = 1
  2095. then (select QQSL.ENTRY_SURE_TIME
  2096. from QMS_QUEUE_SPELLING_LIST QQSL
  2097. where QQR.RESULT_ID = QQSL.QUEUE_RESULT_ID)
  2098. end) "entrySureTime"
  2099. from QMS_QUEUE_RESULT QQR
  2100. left join RMS_GATEPOST RG on QQR.GATEPOST_ID = RG.GATEPOST_ID
  2101. where QQR.RESULT_TOTAL_ID = #{resultTotalId}
  2102. </select>
  2103. <select id="getResultMesByTotalId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  2104. select QQR.RESULT_ID "resultId",
  2105. QQR.IS_SPELLING "isSpelling"
  2106. from QMS_QUEUE_RESULT QQR
  2107. where QQR.RESULT_TOTAL_ID = #{resultTotalId}
  2108. </select>
  2109. </mapper>