UniversalMapper.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. from RMS_TRUCK_CALCULATE RTC
  18. </select>
  19. <select id="getAllGatepost" resultType="java.util.Map">
  20. select GATEPOST_ID "id",
  21. GATEPOST_ID "value",
  22. GATEPOST_NAME "label"
  23. from RMS_GATEPOST
  24. </select>
  25. <select id="getAllWareHouse" resultType="java.util.Map">
  26. select WAREHOUSE_ID "id",
  27. WAREHOUSE_ID "value",
  28. WAREHOUSE_NAME "label"
  29. from RMS_WAREHOUSE
  30. </select>
  31. <select id="getColumnNoRoutList" resultType="java.lang.String" parameterType="map">
  32. select DTCR.COLUMN_NAME from DIL_TABLE_COLUMN_ROLE DTCR
  33. left join DIL_ROLE_ORGCODE_TABLE DROT
  34. ON DTCR.PRIMARY_ID = DROT.COLUMN_ID
  35. WHERE
  36. DTCR.TABLE_NAME = #{tableName}
  37. <if test="orgCode != null">
  38. and DROT.ORG_CODE = #{orgCode}
  39. </if>
  40. </select>
  41. <select id="getColumnShowData" resultType="java.util.Map" parameterType="map">
  42. SELECT DTCR.COLUMN_NAME "key",
  43. DTCR.COLUMN_NAME "label"
  44. FROM DIL_TABLE_COLUMN_ROLE DTCR
  45. LEFT JOIN DIL_ROLE_ORGCODE_TABLE DROT on DTCR.PRIMARY_ID = DROT.COLUMN_ID
  46. WHERE
  47. DTCR.TABLE_NAME = #{tableName}
  48. <if test="userName != null">
  49. AND nvl(DROT.USER_NAME,'0') != #{userName}
  50. </if>
  51. <if test="schemeName != null">
  52. AND nvl(DROT.PRIMARY_NAME,'0') != #{schemeName}
  53. </if>
  54. </select>
  55. <select id="getColumnHiddenData" resultType="string" parameterType="map">
  56. SELECT DTCR.COLUMN_NAME FROM DIL_ROLE_ORGCODE_TABLE DROT
  57. LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DTCR.PRIMARY_ID = DROT.COLUMN_ID
  58. WHERE
  59. DTCR.TABLE_NAME = #{tableName}
  60. <if test="userName != null">
  61. AND DROT.USER_NAME = #{userName}
  62. </if>
  63. <if test="orgCode != null">
  64. AND DROT.ORG_CODE = #{orgCode}
  65. </if>
  66. <if test="schemeName != null">
  67. AND nvl(DROT.PRIMARY_NAME,'0') = #{schemeName}
  68. </if>
  69. </select>
  70. <select id="getColumnAllData" resultType="java.util.Map" parameterType="map">
  71. SELECT DTCR.COLUMN_NAME "key",
  72. DTCR.COLUMN_NAME "label"
  73. FROM DIL_TABLE_COLUMN_ROLE DTCR
  74. WHERE DTCR.TABLE_NAME = #{tableName}
  75. </select>
  76. <select id="getColumnAllScheme" resultType="java.util.LinkedHashMap" parameterType="map">
  77. SELECT distinct DROT.PRIMARY_NAME "schemeName",
  78. DROT.ENABLE_STATUS "enableStatus",
  79. DROT.USER_NAME "userName",
  80. DROT.ORG_CODE "orgCode",
  81. DTCR.TABLE_NAME "tableName"
  82. FROM DIL_ROLE_ORGCODE_TABLE DROT
  83. LEFT JOIN DIL_TABLE_COLUMN_ROLE DTCR on DROT.COLUMN_ID = DTCR.PRIMARY_ID
  84. WHERE DROT.USER_NAME = #{userName}
  85. AND DROT.ORG_CODE = #{orgCode}
  86. AND DTCR.TABLE_NAME = #{tableName}
  87. AND NVL(DROT.PRIMARY_NAME, '') != '默认方案'
  88. </select>
  89. <select id="getWlUrl" resultType="java.lang.String">
  90. SELECT DL.VERSION_VALUE
  91. FROM DIL_VERSION DL
  92. WHERE DL.VERSION_ID = 11
  93. </select>
  94. <!-- 边输边查公司 -->
  95. <select id="getCompanyMesByLike" resultType="java.util.Map">
  96. select * from(
  97. select
  98. RC.COMPANY_ID "companyId",
  99. RC.COMPANY_NAME "companyName",
  100. RC.COMPANY_TYPE "companyType",
  101. RC.SSO_ID "ssoId",
  102. RC.SSO_CODE "ssoCode",
  103. RC.COMPANY_ID "id",
  104. RC.COMPANY_ID "value",
  105. RC.COMPANY_TYPE || '-' || RC.COMPANY_NAME "label"
  106. from RMS_COMPANY RC
  107. where DELETED = 0 )
  108. <where>
  109. <if test="companyType!=null and companyType!=''">
  110. AND "companyType" = #{companyType}
  111. </if>
  112. <if test="index!=null and index!=''">
  113. AND REGEXP_LIKE("label", #{index})
  114. </if>
  115. <if test="id!=null and id.size>0">
  116. AND "id" in
  117. <foreach collection="id" item="item" open="(" close=")" separator="," >
  118. #{item}
  119. </foreach>
  120. </if>
  121. </where>
  122. FETCH NEXT 100 ROWS ONLY
  123. </select>
  124. <select id="getMaterialTypeByLike" resultType="java.util.Map">
  125. select * from(
  126. select
  127. MATERIAL_TYPE_ID "materialTypeId",
  128. MATERIAL_TYPE_NAME "materialTypeName",
  129. MATERIAL_TYPE_ID "id",
  130. MATERIAL_TYPE_ID "value",
  131. MATERIAL_TYPE_NAME "label"
  132. from RMS_MATERIAL_TYPE
  133. where DELETED = 0
  134. )
  135. <where>
  136. <if test="index!=null and index!=''">
  137. AND REGEXP_LIKE("label", #{index})
  138. </if>
  139. <if test="id!=null and id.size>0">
  140. AND "id" in
  141. <foreach collection="id" item="item" open="(" close=")" separator="," >
  142. #{item}
  143. </foreach>
  144. </if>
  145. </where>
  146. FETCH NEXT 100 ROWS ONLY
  147. </select>
  148. <select id="getEmissionStandardByLike" resultType="java.util.Map">
  149. select * from (
  150. select
  151. EMISSION_STANDARD_ID "emissionStandardId",
  152. EMISSION_STANDARD_NAME "emissionStandardName",
  153. EMISSION_STANDARD_ID "id",
  154. EMISSION_STANDARD_ID "value",
  155. EMISSION_STANDARD_NAME "label"
  156. from RMS_EMISSION_STANDARD
  157. where DELETED = 0
  158. )
  159. <where>
  160. <if test="index!=null and index!=''">
  161. AND REGEXP_LIKE("label", #{index})
  162. </if>
  163. <if test="id!=null and id.size>0">
  164. AND "id" in
  165. <foreach collection="id" item="item" open="(" close=")" separator="," >
  166. #{item}
  167. </foreach>
  168. </if>
  169. </where>
  170. FETCH NEXT 100 ROWS ONLY
  171. </select>
  172. <select id="getOperationPointByLike" resultType="java.util.Map">
  173. select * from (
  174. select
  175. OPERATION_POINT_ID "operationPointId",
  176. OPERATION_POINT_NAME "operationPointName",
  177. OPERATION_POINT_TYPE "operationPointType",
  178. OPERATION_POINT_ID "id",
  179. OPERATION_POINT_ID "value",
  180. OPERATION_POINT_NAME "label"
  181. from RMS_OPERATION_POINT
  182. where DELETED = 0
  183. )
  184. <where>
  185. <if test="operationPointType!=null and operationPointType!=''">
  186. AND REGEXP_LIKE("operationPointType", #{operationPointType})
  187. </if>
  188. <if test="index!=null and index!=''">
  189. AND REGEXP_LIKE("label", #{index})
  190. </if>
  191. <if test="id!=null and id.size>0">
  192. AND "id" in
  193. <foreach collection="id" item="item" open="(" close=")" separator="," >
  194. #{item}
  195. </foreach>
  196. </if>
  197. </where>
  198. FETCH NEXT 100 ROWS ONLY
  199. </select>
  200. <select id="getPersonnelByLike" resultType="java.util.Map">
  201. select * from (
  202. select
  203. PERSONNEL_ID "personnelId",
  204. PERSONNEL_NAME "personnelName",
  205. PERSONNEL_ID "id",
  206. PERSONNEL_ID "value",
  207. PERSONNEL_NAME "label"
  208. from RMS_PERSONNEL
  209. where DELETED = 0
  210. )
  211. <where>
  212. <if test="index!=null and index!=''">
  213. AND REGEXP_LIKE("label", #{index})
  214. </if>
  215. <if test="id!=null and id.size>0">
  216. AND "id" in
  217. <foreach collection="id" item="item" open="(" close=")" separator="," >
  218. #{item}
  219. </foreach>
  220. </if>
  221. </where>
  222. FETCH NEXT 100 ROWS ONLY
  223. </select>
  224. <select id="getrmsrmsjobinfosBylike" resultType="java.util.Map">
  225. select * from(
  226. select
  227. RC.JOB_ID "jboId",
  228. RC.JOB_NAME "jobName",
  229. RC.JOB_ID "id",
  230. RC.JOB_ID "value",
  231. RC.JOB_NAME "label"
  232. from RMS_JOB_INFO RC
  233. where DELETED = 0
  234. )
  235. <where>
  236. <if test="index!=null and index!=''">
  237. AND REGEXP_LIKE("label", #{index})
  238. </if>
  239. <if test="id!=null and id.size>0">
  240. AND "id" in
  241. <foreach collection="id" item="item" open="(" close=")" separator="," >
  242. #{item}
  243. </foreach>
  244. </if>
  245. </where>
  246. FETCH NEXT 100 ROWS ONLY
  247. </select>
  248. </mapper>