UniversalMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. WHERE RCA .DELETED = 0
  251. <if test="orgCode!=null and orgCode !='' and roleCodes.contains('chengyunshang')">
  252. AND RC.SSO_CODE = #{orgCode}
  253. </if>
  254. )
  255. <where>
  256. <if test="index!=null and index!=''">
  257. AND REGEXP_LIKE("label", #{index})
  258. </if>
  259. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  260. AND "id" in
  261. <foreach collection="id" item="item" open="(" close=")" separator="," >
  262. #{item}
  263. </foreach>
  264. </if>
  265. </where>
  266. FETCH NEXT 100 ROWS ONLY
  267. </select>
  268. <select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
  269. select * from(
  270. select
  271. RC.JOB_ID "jboId",
  272. RC.JOB_NAME "jobName",
  273. RC.JOB_ID "id",
  274. RC.JOB_ID "value",
  275. RC.JOB_NAME "label",
  276. RC.JOB_NAME "text"
  277. from RMS_JOB_INFO RC
  278. where DELETED = 0
  279. )
  280. <where>
  281. <if test="index!=null and index!=''">
  282. AND REGEXP_LIKE("label", #{index})
  283. </if>
  284. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  285. AND "id" in
  286. <foreach collection="id" item="item" open="(" close=")" separator="," >
  287. #{item}
  288. </foreach>
  289. </if>
  290. </where>
  291. FETCH NEXT 100 ROWS ONLY
  292. </select>
  293. <select id="getTransRangeByLike" resultType="java.util.Map">
  294. select * from(
  295. select
  296. RC.TRANS_RANGE_ID "transrangeId",
  297. RC.TRANS_RANGE_NAME "transrangeName",
  298. RC.TRANS_RANGE_ID "id",
  299. RC.TRANS_RANGE_ID "value",
  300. RC.TRANS_RANGE_NAME "label",
  301. RC.TRANS_RANGE_NAME "text"
  302. from RMS_TRANS_RANGE RC
  303. where DELETED = 0
  304. )
  305. <where>
  306. <if test="index!=null and index!=''">
  307. AND REGEXP_LIKE("label", #{index})
  308. </if>
  309. <if test="id!=null and id.size>0 and !(index!=null and index!='')">
  310. AND "id" in
  311. <foreach collection="id" item="item" open="(" close=")" separator="," >
  312. #{item}
  313. </foreach>
  314. </if>
  315. </where>
  316. FETCH NEXT 100 ROWS ONLY
  317. </select>
  318. <select id="getCategoryCodeByLike" resultType="java.util.Map">
  319. select * from(
  320. select
  321. RC.RULES_ID "rulesId",
  322. RC.RULES_CODE "rulesCode",
  323. RC.RULES_ID "id",
  324. RC.RULES_ID "value",
  325. RC.RULES_CODE "label",
  326. RC.RULES_CODE "text",
  327. from RMS_DEMAND_RULES RC
  328. where DELETED = 0
  329. )
  330. <where>
  331. <if test="index!=null and index!=''">
  332. AND REGEXP_LIKE("label", #{index})
  333. </if>
  334. <if test="id!=null and !(index!=null and index!='')">
  335. AND "id" in
  336. <foreach collection="id" item="item" open="(" close=")" separator="," >
  337. #{item}
  338. </foreach>
  339. </if>
  340. </where>
  341. FETCH NEXT 100 ROWS ONLY
  342. </select>
  343. <select id="getCapacityTypeByLike" resultType="java.util.Map">
  344. select * from(
  345. select
  346. RC.CAPACITY_TYPE_ID "capacityTypeId",
  347. RC.CAPACITY_TYPE_NAME "capacityTypeName",
  348. RC.CAPACITY_TYPE_ID "id",
  349. RC.CAPACITY_TYPE_ID "value",
  350. RC.CAPACITY_TYPE_NAME "label",
  351. RC.CAPACITY_TYPE_NAME "text",
  352. from RMS_CAPACITY_TYPE RC
  353. where DELETED = 0
  354. )
  355. <where>
  356. <if test="index!=null and index!=''">
  357. AND REGEXP_LIKE("label", #{index})
  358. </if>
  359. <if test="id!=null and !(index!=null and index!='')">
  360. AND "id" in
  361. <foreach collection="id" item="item" open="(" close=")" separator="," >
  362. #{item}
  363. </foreach>
  364. </if>
  365. </where>
  366. FETCH NEXT 100 ROWS ONLY
  367. </select>
  368. <select id="getLineByLike" resultType="java.util.Map">
  369. select * from(
  370. select
  371. RC.LINE_ID "lineId",
  372. RC.LINE_NAME "lineName",
  373. RC.LINE_ID "id",
  374. RC.LINE_ID "value",
  375. RC.LINE_NAME "label",
  376. RC.LINE_NAME "text"
  377. from RMS_LINE RC
  378. where DELETED = 0
  379. )
  380. <where>
  381. <if test="index!=null and index!=''">
  382. AND REGEXP_LIKE("label", #{index})
  383. </if>
  384. <if test="id!=null and !(index!=null and index!='')">
  385. AND "id" in
  386. <foreach collection="id" item="item" open="(" close=")" separator="," >
  387. #{item}
  388. </foreach>
  389. </if>
  390. </where>
  391. FETCH NEXT 100 ROWS ONLY
  392. </select>
  393. <select id="getMaterialByLike" resultType="java.util.Map">
  394. select * from(
  395. select
  396. RC.MATERIAL_ID "materialId",
  397. RC.MATERIAL_NAME "materialName",
  398. RC.MATERIAL_ID "id",
  399. RC.MATERIAL_ID "value",
  400. RC.MATERIAL_NAME "label",
  401. RC.MATERIAL_NAME "text",
  402. from RMS_MATERIAL RC
  403. where DELETED = 0
  404. )
  405. <where>
  406. <if test="index!=null and index!=''">
  407. AND REGEXP_LIKE("label", #{index})
  408. </if>
  409. <if test="id!=null and !(index!=null and index!='')">
  410. AND "id" in
  411. <foreach collection="id" item="item" open="(" close=")" separator="," >
  412. #{item}
  413. </foreach>
  414. </if>
  415. </where>
  416. FETCH NEXT 100 ROWS ONLY
  417. </select>
  418. </mapper>