UniversalMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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.UniversalMapper">
  4. <sql id="orderBy">
  5. <if test="orderField != null and orderField != ''">
  6. order by "${orderField}"
  7. <if test="orderType != null and orderType != ''">
  8. ${orderType}
  9. </if>
  10. </if>
  11. </sql>
  12. <!-- 查询所有的汽车衡 -->
  13. <select id="getAllCalculateMes" resultType="java.util.Map">
  14. select RTC.TRUCK_CALCULATE_ID "id",
  15. RTC.TRUCK_CALCULATE_ID "value",
  16. RTC.TRUCK_CALCULATE_NUMBER "label",
  17. RTC.TRUCK_CALCULATE_NUMBER "text"
  18. from RMS_TRUCK_CALCULATE RTC
  19. </select>
  20. <select id="getAllGatepost" resultType="java.util.Map">
  21. select GATEPOST_ID "id",
  22. GATEPOST_ID "value",
  23. GATEPOST_NAME "label",
  24. GATEPOST_NAME "text"
  25. from RMS_GATEPOST
  26. </select>
  27. <select id="getAllWareHouse" resultType="java.util.Map">
  28. select WAREHOUSE_ID "id",
  29. WAREHOUSE_ID "value",
  30. WAREHOUSE_NAME "label",
  31. WAREHOUSE_NAME "text"
  32. from RMS_WAREHOUSE
  33. </select>
  34. <select id="getColumnNoRoutList" resultType="java.lang.String" parameterType="map">
  35. select DTCR.COLUMN_NAME from DIL_TABLE_COLUMN_ROLE DTCR
  36. left join DIL_ROLE_ORGCODE_TABLE DROT
  37. ON DTCR.PRIMARY_ID = DROT.COLUMN_ID
  38. WHERE
  39. DTCR.TABLE_NAME = #{tableName}
  40. <if test="orgCode != null">
  41. and DROT.ORG_CODE = #{orgCode}
  42. </if>
  43. </select>
  44. <select id="getColumnShowData" resultType="java.util.Map" parameterType="map">
  45. SELECT DTCR.COLUMN_NAME "key",
  46. DTCR.COLUMN_NAME "label"
  47. FROM DIL_TABLE_COLUMN_ROLE DTCR
  48. LEFT JOIN DIL_ROLE_ORGCODE_TABLE DROT on DTCR.PRIMARY_ID = DROT.COLUMN_ID
  49. WHERE
  50. DTCR.TABLE_NAME = #{tableName}
  51. <if test="userName != null">
  52. AND nvl(DROT.USER_NAME,'0') != #{userName}
  53. </if>
  54. <if test="schemeName != null">
  55. AND nvl(DROT.PRIMARY_NAME,'0') != #{schemeName}
  56. </if>
  57. </select>
  58. <select id="getColumnHiddenData" resultType="string" parameterType="map">
  59. SELECT DTCR.COLUMN_NAME FROM DIL_ROLE_ORGCODE_TABLE DROT
  60. LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DTCR.PRIMARY_ID = DROT.COLUMN_ID
  61. WHERE
  62. DTCR.TABLE_NAME = #{tableName}
  63. <if test="userName != null">
  64. AND DROT.USER_NAME = #{userName}
  65. </if>
  66. <if test="orgCode != null">
  67. AND DROT.ORG_CODE = #{orgCode}
  68. </if>
  69. <if test="schemeName != null">
  70. AND nvl(DROT.PRIMARY_NAME,'0') = #{schemeName}
  71. </if>
  72. </select>
  73. <select id="getColumnAllData" resultType="java.util.Map" parameterType="map">
  74. SELECT DTCR.COLUMN_NAME "key",
  75. DTCR.COLUMN_NAME "label"
  76. FROM DIL_TABLE_COLUMN_ROLE DTCR
  77. WHERE DTCR.TABLE_NAME = #{tableName}
  78. </select>
  79. <select id="getColumnAllScheme" resultType="java.util.LinkedHashMap" parameterType="map">
  80. SELECT distinct DROT.PRIMARY_NAME "schemeName",
  81. DROT.ENABLE_STATUS "enableStatus",
  82. DROT.USER_NAME "userName",
  83. DROT.ORG_CODE "orgCode",
  84. DTCR.TABLE_NAME "tableName"
  85. FROM DIL_ROLE_ORGCODE_TABLE DROT
  86. LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DROT.COLUMN_ID = DTCR.PRIMARY_ID
  87. WHERE DROT.USER_NAME = #{userName}
  88. AND DROT.ORG_CODE = #{orgCode}
  89. AND DTCR.TABLE_NAME = #{tableName}
  90. AND NVL(DROT.PRIMARY_NAME, '') != '默认方案'
  91. </select>
  92. <select id="getWlUrl" resultType="java.lang.String">
  93. SELECT DL.VERSION_VALUE
  94. FROM DIL_VERSION DL
  95. WHERE DL.VERSION_ID = 11
  96. </select>
  97. <!-- 边输边查公司 -->
  98. <select id="getCompanyMesByLike" resultType="java.util.Map">
  99. select * from(
  100. select
  101. RC.COMPANY_ID "companyId",
  102. RC.COMPANY_NAME "companyName",
  103. RC.COMPANY_TYPE "companyType",
  104. RC.SSO_ID "ssoId",
  105. RC.SSO_CODE "ssoCode",
  106. RC.COMPANY_ID "id",
  107. RC.COMPANY_ID "value",
  108. <if test="companyType==null">
  109. RC.COMPANY_TYPE || '-' ||
  110. </if>
  111. RC.COMPANY_NAME "label",
  112. RC.COMPANY_NAME "text"
  113. from RMS_COMPANY RC
  114. where DELETED = 0 )
  115. <where>
  116. <if test="companyType!=null and companyType!=''">
  117. AND "companyType" = #{companyType}
  118. </if>
  119. <if test="index!=null and index!=''">
  120. AND REGEXP_LIKE("label", #{index})
  121. </if>
  122. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  123. AND "id" in
  124. <foreach collection="id" item="item" open="(" close=")" separator="," >
  125. #{item}
  126. </foreach>
  127. </if>
  128. </where>
  129. FETCH NEXT 100 ROWS ONLY
  130. </select>
  131. <select id="getMaterialTypeByLike" resultType="java.util.Map">
  132. select * from(
  133. select
  134. MATERIAL_TYPE_ID "materialTypeId",
  135. MATERIAL_TYPE_NAME "materialTypeName",
  136. MATERIAL_TYPE_ID "id",
  137. MATERIAL_TYPE_ID "value",
  138. MATERIAL_TYPE_NAME "label",
  139. MATERIAL_TYPE_NAME "text"
  140. from RMS_MATERIAL_TYPE
  141. where DELETED = 0
  142. )
  143. <where>
  144. <if test="index!=null and index!=''">
  145. AND REGEXP_LIKE("label", #{index})
  146. </if>
  147. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  148. AND "id" in
  149. <foreach collection="id" item="item" open="(" close=")" separator="," >
  150. #{item}
  151. </foreach>
  152. </if>
  153. </where>
  154. FETCH NEXT 100 ROWS ONLY
  155. </select>
  156. <select id="getEmissionStandardByLike" resultType="java.util.Map">
  157. select * from (
  158. select
  159. EMISSION_STANDARD_ID "emissionStandardId",
  160. EMISSION_STANDARD_NAME "emissionStandardName",
  161. EMISSION_STANDARD_ID "id",
  162. EMISSION_STANDARD_ID "value",
  163. EMISSION_STANDARD_NAME "label",
  164. EMISSION_STANDARD_NAME "text"
  165. from RMS_EMISSION_STANDARD
  166. where DELETED = 0
  167. )
  168. <where>
  169. <if test="index!=null and index!=''">
  170. AND REGEXP_LIKE("label", #{index})
  171. </if>
  172. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  173. AND "id" in
  174. <foreach collection="id" item="item" open="(" close=")" separator="," >
  175. #{item}
  176. </foreach>
  177. </if>
  178. </where>
  179. FETCH NEXT 100 ROWS ONLY
  180. </select>
  181. <select id="getOperationPointByLike" resultType="java.util.Map">
  182. select * from (
  183. select
  184. OPERATION_POINT_ID "operationPointId",
  185. OPERATION_POINT_NAME "operationPointName",
  186. OPERATION_POINT_TYPE "operationPointType",
  187. OPERATION_POINT_ID "id",
  188. OPERATION_POINT_ID "value",
  189. OPERATION_POINT_NAME "label",
  190. OPERATION_POINT_NAME "text"
  191. from RMS_OPERATION_POINT
  192. where DELETED = 0
  193. )
  194. <where>
  195. <if test="operationPointType!=null and operationPointType!=''">
  196. AND REGEXP_LIKE("operationPointType", #{operationPointType})
  197. </if>
  198. <if test="index!=null and index!=''">
  199. AND REGEXP_LIKE("label", #{index})
  200. </if>
  201. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  202. AND "id" in
  203. <foreach collection="id" item="item" open="(" close=")" separator="," >
  204. #{item}
  205. </foreach>
  206. </if>
  207. </where>
  208. FETCH NEXT 100 ROWS ONLY
  209. </select>
  210. <select id="getPersonnelByLike" resultType="java.util.Map">
  211. select * from (
  212. select
  213. PERSONNEL_ID "personnelId",
  214. PERSONNEL_NAME "personnelName",
  215. PERSONNEL_POST "personnelPost",
  216. PERSONNEL_ID "id",
  217. PERSONNEL_ID "value",
  218. PERSONNEL_NAME "label",
  219. PERSONNEL_NAME "text"
  220. from RMS_PERSONNEL
  221. where DELETED = 0
  222. )
  223. <where>
  224. <if test="personnelPost!=null and personnelPost!=''">
  225. AND "personnelPost" = #{personnelPost}
  226. </if>
  227. <if test="index!=null and index!=''">
  228. AND REGEXP_LIKE("label", #{index})
  229. </if>
  230. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  231. AND "id" in
  232. <foreach collection="id" item="item" open="(" close=")" separator="," >
  233. #{item}
  234. </foreach>
  235. </if>
  236. </where>
  237. FETCH NEXT 100 ROWS ONLY
  238. </select>
  239. <select id="getCapacityByLike" resultType="java.util.Map">
  240. select * from (
  241. SELECT DISTINCT
  242. RCA .CAPACITY_ID "capacityId",
  243. RCA .CAPACITY_ID "id",
  244. RCA .CAPACITY_ID "value",
  245. RCA .CAPACITY_NUMBER "label",
  246. RCA .CAPACITY_NUMBER "text"
  247. FROM RMS_CAPACITY RCA
  248. LEFT JOIN RMS_CAPACITY_CARRIER RCC ON RCA .CAPACITY_ID = RCC .CAPACITY_ID
  249. LEFT JOIN RMS_COMPANY RC ON RC .COMPANY_ID = RCC .COMPANY_ID
  250. LEFT JOIN RMS_CAPACITY_TYPE RCT ON RCA.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
  251. WHERE RCA .DELETED = 0
  252. <if test="orgCode!=null and orgCode !='' and roleCodes.contains('chengyunshang')">
  253. AND RC.SSO_CODE = #{orgCode}
  254. </if>
  255. <if test="capacityType != null and capacityType != '' ">
  256. AND RCT.CAPACITY_TYPE_NAME = #{capacityType}
  257. </if>
  258. <if test="capacityType == null">
  259. AND RCT.CAPACITY_TYPE_NAME != '火车'
  260. </if>
  261. )
  262. <where>
  263. <if test="index!=null and index!=''">
  264. AND REGEXP_LIKE("label", #{index})
  265. </if>
  266. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  267. AND "id" in
  268. <foreach collection="id" item="item" open="(" close=")" separator="," >
  269. #{item}
  270. </foreach>
  271. </if>
  272. </where>
  273. FETCH NEXT 100 ROWS ONLY
  274. </select>
  275. <select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
  276. select * from(
  277. select
  278. RC.JOB_ID "jboId",
  279. RC.JOB_NAME "jobName",
  280. RC.JOB_ID "id",
  281. RC.JOB_ID "value",
  282. RC.JOB_NAME "label",
  283. RC.JOB_NAME "text"
  284. from RMS_JOB_INFO RC
  285. where DELETED = 0
  286. )
  287. <where>
  288. <if test="index!=null and index!=''">
  289. AND REGEXP_LIKE("label", #{index})
  290. </if>
  291. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  292. AND "id" in
  293. <foreach collection="id" item="item" open="(" close=")" separator="," >
  294. #{item}
  295. </foreach>
  296. </if>
  297. </where>
  298. FETCH NEXT 100 ROWS ONLY
  299. </select>
  300. <select id="getTransRangeByLike" resultType="java.util.Map">
  301. select * from(
  302. select
  303. RC.TRANS_RANGE_ID "transrangeId",
  304. RC.TRANS_RANGE_NAME "transrangeName",
  305. RC.TRANS_RANGE_ID "id",
  306. RC.TRANS_RANGE_ID "value",
  307. RC.TRANS_RANGE_NAME "label",
  308. RC.TRANS_RANGE_NAME "text"
  309. from RMS_TRANS_RANGE RC
  310. where DELETED = 0
  311. )
  312. <where>
  313. <if test="index!=null and index!=''">
  314. AND REGEXP_LIKE("label", #{index})
  315. </if>
  316. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  317. AND "id" in
  318. <foreach collection="id" item="item" open="(" close=")" separator="," >
  319. #{item}
  320. </foreach>
  321. </if>
  322. </where>
  323. FETCH NEXT 100 ROWS ONLY
  324. </select>
  325. <select id="getCategoryCodeByLike" resultType="java.util.Map">
  326. select * from(
  327. select
  328. RC.RULES_ID "rulesId",
  329. RC.RULES_CODE "rulesCode",
  330. RC.RULES_ID "id",
  331. RC.RULES_ID "value",
  332. RC.RULES_CODE "label",
  333. RC.RULES_CODE "text"
  334. from RMS_DEMAND_RULES RC
  335. where DELETED = 0
  336. )
  337. <where>
  338. <if test="index!=null and index!=''">
  339. AND REGEXP_LIKE("label", #{index})
  340. </if>
  341. <if test="id!=null and !(index!=null and index!='')">
  342. AND "id" in
  343. <foreach collection="id" item="item" open="(" close=")" separator="," >
  344. #{item}
  345. </foreach>
  346. </if>
  347. </where>
  348. FETCH NEXT 100 ROWS ONLY
  349. </select>
  350. <select id="getCapacityTypeByLike" resultType="java.util.Map">
  351. select * from(
  352. select
  353. RC.CAPACITY_TYPE_ID "capacityTypeId",
  354. RC.CAPACITY_TYPE_NAME "capacityTypeName",
  355. RC.CAPACITY_TYPE_ID "id",
  356. RC.CAPACITY_TYPE_ID "value",
  357. RC.CAPACITY_TYPE_NAME "label",
  358. RC.CAPACITY_TYPE_NAME "text"
  359. from RMS_CAPACITY_TYPE RC
  360. where DELETED = 0
  361. )
  362. <where>
  363. <if test="index!=null and index!=''">
  364. AND REGEXP_LIKE("label", #{index})
  365. </if>
  366. <if test="id!=null and !(index!=null and index!='')">
  367. AND "id" in
  368. <foreach collection="id" item="item" open="(" close=")" separator="," >
  369. #{item}
  370. </foreach>
  371. </if>
  372. </where>
  373. FETCH NEXT 100 ROWS ONLY
  374. </select>
  375. <select id="getLineByLike" resultType="java.util.Map">
  376. select * from(
  377. select
  378. RL.LINE_ID "lineId",
  379. RL.LINE_NAME "lineName",
  380. RL.LINE_ID "id",
  381. RL.LINE_ID "value",
  382. RL.LINE_NAME "label",
  383. RL.LINE_NAME "text",
  384. NVL(RL_TEMP."points",'无') "points"
  385. from RMS_LINE RL
  386. LEFT JOIN
  387. (
  388. SELECT
  389. RLS .LINE_ID "lineId",
  390. listagg (DISTINCT ROP .OPERATION_POINT_NAME, ',') WITHIN GROUP (ORDER BY RLS .LINE_ID) "points"
  391. FROM
  392. RMS_LINE_STEP RLS
  393. LEFT JOIN RMS_STEP_POINT RSP
  394. ON RLS .STEP_ID = RSP .STEP_ID
  395. LEFT JOIN RMS_OPERATION_POINT ROP
  396. ON RSP .OPERATION_POINT_ID = ROP .OPERATION_POINT_ID
  397. GROUP BY RLS .LINE_ID
  398. ) RL_TEMP ON RL_TEMP ."lineId" = RL .LINE_ID
  399. where DELETED = 0
  400. )
  401. <where>
  402. <if test="index!=null and index!=''">
  403. AND REGEXP_LIKE("label" || "points", #{index})
  404. </if>
  405. <if test="id!=null and !(index!=null and index!='')">
  406. AND "id" in
  407. <foreach collection="id" item="item" open="(" close=")" separator="," >
  408. #{item}
  409. </foreach>
  410. </if>
  411. </where>
  412. FETCH NEXT 100 ROWS ONLY
  413. </select>
  414. <select id="getMaterialByLike" resultType="java.util.Map">
  415. select * from(
  416. select
  417. RC.MATERIAL_ID "materialId",
  418. RC.MATERIAL_NAME "materialName",
  419. RC.MATERIAL_ID "id",
  420. RC.MATERIAL_ID "value",
  421. RC.MATERIAL_NAME "label",
  422. RC.MATERIAL_NAME "text"
  423. from RMS_MATERIAL RC
  424. where DELETED = 0
  425. )
  426. <where>
  427. <if test="index!=null and index!=''">
  428. AND REGEXP_LIKE("label", #{index})
  429. </if>
  430. <if test="id!=null and !(index!=null and index!='')">
  431. AND "id" in
  432. <foreach collection="id" item="item" open="(" close=")" separator="," >
  433. #{item}
  434. </foreach>
  435. </if>
  436. </where>
  437. FETCH NEXT 100 ROWS ONLY
  438. </select>
  439. <select id="countTrainLoad" resultType="java.lang.Integer">
  440. SELECT COUNT(*)
  441. FROM TMS_LOAD_RESULT TLR
  442. LEFT JOIN OMS_TRANS_ORDER OTO ON TLR .TRANS_ORDER_ID =OTO .TRANS_ORDER_ID
  443. LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
  444. LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
  445. LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
  446. LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
  447. <where>
  448. OTO.DELETED != 1
  449. AND ATR.SERIAL_NUMBER =#{requirementNumber}
  450. AND TLR.LOAD_START_TIME = to_date(#{loadTime}, 'yyyymmdd')
  451. AND OTO.CAPACITY_ID IN
  452. <foreach collection="list" item="item" open="(" close=")" separator="," >
  453. #{item.车号}
  454. </foreach>
  455. </where>
  456. </select>
  457. <select id="getBusinessTypeLike" resultType="java.util.Map">
  458. select * from(
  459. select
  460. DBT.BUSINESS_TYPE_ID "businessTypeId",
  461. DBT.BUSINESS_TYPE_ID "id",
  462. DBT.BUSINESS_TYPE_ID "value",
  463. DBT.BUSINESS_TYPE_NAME "text",
  464. DBT.BUSINESS_TYPE_NAME "businessTypeName",
  465. DBT.BUSINESS_SCENE "businessScene",
  466. DBT.BUSINESS_TYPE_NAME "label",
  467. DBT.ALTERNATE_FIELDS1 "transportType",
  468. DBT.ALTERNATE_FIELDS2 "materialTypeName"
  469. from DIL_BUSINESS_TYPE DBT
  470. )
  471. <where>
  472. <if test="index!=null and index!=''">
  473. AND REGEXP_LIKE("label", #{index})
  474. </if>
  475. <if test="businessType!=null and businessType!=''">
  476. AND "businessTypeId" = #{businessType}
  477. </if>
  478. <if test="businessScene!=null and businessScene!=''">
  479. AND "businessScene" = #{businessScene}
  480. </if>
  481. <if test="transportType!=null and transportType!=''">
  482. AND REGEXP_LIKE("transportType", #{transportType})
  483. </if>
  484. <if test="materialTypeName!=null and materialTypeName!=''">
  485. AND REGEXP_LIKE("materialTypeName", #{materialTypeName})
  486. </if>
  487. <if test="id!=null and !(index!=null and index!='')">
  488. AND "id" in
  489. <foreach collection="id" item="item" open="(" close=")" separator="," >
  490. #{item}
  491. </foreach>
  492. </if>
  493. </where>
  494. FETCH NEXT 100 ROWS ONLY
  495. </select>
  496. <select id="findTrainWeight" resultType="java.util.Map">
  497. <foreach collection="list" item="item" separator=" UNION " >
  498. SELECT OTO .TRANS_ORDER_ID "transOrderId",
  499. TWR .RESULT_ID "resultId",
  500. #{item.车号} "capacityId",
  501. #{item.净重} "netWeight",
  502. #{item.皮重} "tareWeight",
  503. #{item.毛重} "grossWeight"
  504. FROM OMS_TRANS_ORDER OTO
  505. LEFT JOIN TMS_WEIGHT_RESULT TWR
  506. ON TWR .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID AND TWR.NET_WEIGHT_TIME = to_date(#{weightTime}, 'yyyymmdd')
  507. LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
  508. LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
  509. LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
  510. LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
  511. <where>
  512. OTO.DELETED != 1
  513. AND ATR.SERIAL_NUMBER =#{requirementNumber}
  514. AND OTO.CAPACITY_ID = #{item.车号}
  515. </where>
  516. </foreach>
  517. </select>
  518. <select id="findTrainUnload" resultType="java.util.Map">
  519. <foreach collection="list" item="item" separator=" UNION " >
  520. SELECT OTO .TRANS_ORDER_ID "transOrderId",
  521. TUR .RESULT_ID "resultId",
  522. #{item.车号} "capacityId",
  523. #{item.净重} "unloadWeight"
  524. FROM OMS_TRANS_ORDER OTO
  525. LEFT JOIN TMS_UNLOAD_RESULT TUR
  526. ON TUR .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID AND TUR.UNLOAD_START_TIME = to_date(#{unloadTime}, 'yyyymmdd')
  527. LEFT JOIN OMS_ORDER_CHILD OOC ON OOC .TRANS_ORDER_ID = OTO .TRANS_ORDER_ID
  528. LEFT JOIN AMS_PLAN_CHILD APC ON APC.PLAN_CHILD_ID = OOC.PLAN_CHILD_ID
  529. LEFT JOIN AMS_REQUIREMENT_CHILD ARC ON ARC.REQUIREMENT_CHILD_ID = APC.REQUIREMENT_CHILD_ID
  530. LEFT JOIN AMS_TRANS_REQUIREMENT ATR ON ATR.TRANS_REQUIREMENT_ID = ARC.TRANS_REQUIREMENT_ID
  531. <where>
  532. OTO.DELETED != 1
  533. AND ATR.SERIAL_NUMBER =#{requirementNumber}
  534. AND OTO.CAPACITY_ID = #{item.车号}
  535. </where>
  536. </foreach>
  537. </select>
  538. <select id="getOrderIds" resultType="java.util.Map">
  539. SELECT oto.TRANS_ORDER_ID FROM OMS_TRANS_ORDER OTO
  540. left join RMS_PERSONNEL RP
  541. on rp.PERSONNEL_ID = oto.DRIVER_ID
  542. left join RMS_PERSONNEL RP2
  543. on RP2.PERSONNEL_ID = oto.DRIVER_ID2
  544. where (rp.PERSONNEL_JOB_NUMBER = #{jobNumber}
  545. or rp2.PERSONNEL_JOB_NUMBER = #{jobNumber})
  546. and oto.deleted = 5
  547. </select>
  548. </mapper>