RmsGatepostMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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.RmsGatepostMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsGatepost">
  5. <id column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
  6. <result column="GATEPOST_NAME" jdbcType="VARCHAR" property="gatepostName" />
  7. <result column="GATEPOST_LONGITUDE" jdbcType="VARCHAR" property="gatepostLongitude" />
  8. <result column="GATEPOST_LATITUDE" jdbcType="VARCHAR" property="gatepostLatitude" />
  9. <result column="GATEPOST_PRIORITY" jdbcType="DECIMAL" property="gatepostPriority" />
  10. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  11. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  12. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  13. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  14. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  15. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  16. </resultMap>
  17. <sql id="columns">
  18. GATEPOST_ID, GATEPOST_NAME, GATEPOST_LONGITUDE, GATEPOST_LATITUDE, GATEPOST_PRIORITY,
  19. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,DELETED
  20. </sql>
  21. <sql id="columns_alias">
  22. t.GATEPOST_ID, t.GATEPOST_NAME, t.GATEPOST_LONGITUDE, t.GATEPOST_LATITUDE, t.GATEPOST_PRIORITY,
  23. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,t.DELETED
  24. </sql>
  25. <sql id="select">
  26. SELECT <include refid="columns" /> FROM RMS_GATEPOST
  27. </sql>
  28. <sql id="select_alias">
  29. SELECT <include refid="columns_alias" /> FROM RMS_GATEPOST t
  30. </sql>
  31. <sql id="where">
  32. <where>
  33. <if test="gatepostId != null">
  34. and GATEPOST_ID = #{gatepostId}
  35. </if>
  36. <if test="gatepostName != null and gatepostName != ''">
  37. and GATEPOST_NAME = #{gatepostName}
  38. </if>
  39. <if test="gatepostLongitude != null and gatepostLongitude != ''">
  40. and GATEPOST_LONGITUDE = #{gatepostLongitude}
  41. </if>
  42. <if test="gatepostLatitude != null and gatepostLatitude != ''">
  43. and GATEPOST_LATITUDE = #{gatepostLatitude}
  44. </if>
  45. <if test="gatepostPriority != null">
  46. and GATEPOST_PRIORITY = #{gatepostPriority}
  47. </if>
  48. <if test="insertUsername != null and insertUsername != ''">
  49. and INSERT_USERNAME = #{insertUsername}
  50. </if>
  51. <if test="insertTime != null">
  52. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  53. </if>
  54. <if test="updateUsername != null and updateUsername != ''">
  55. and UPDATE_USERNAME = #{updateUsername}
  56. </if>
  57. <if test="updateTime != null">
  58. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  59. </if>
  60. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  61. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  62. </if>
  63. <if test="deleted != null">
  64. and DELETED = #{deleted}
  65. </if>
  66. </where>
  67. </sql>
  68. <sql id="whereLike">
  69. <where>
  70. <if test="gatepostId != null">
  71. and GATEPOST_ID = #{gatepostId}
  72. </if>
  73. <if test="gatepostName != null and gatepostName != ''">
  74. and GATEPOST_NAME LIKE '%${gatepostName}%'
  75. </if>
  76. <if test="gatepostLongitude != null and gatepostLongitude != ''">
  77. and GATEPOST_LONGITUDE LIKE '%${gatepostLongitude}%'
  78. </if>
  79. <if test="gatepostLatitude != null and gatepostLatitude != ''">
  80. and GATEPOST_LATITUDE LIKE '%${gatepostLatitude}%'
  81. </if>
  82. <if test="gatepostPriority != null">
  83. and GATEPOST_PRIORITY = #{gatepostPriority}
  84. </if>
  85. <if test="insertUsername != null and insertUsername != ''">
  86. and INSERT_USERNAME LIKE '%${insertUsername}%'
  87. </if>
  88. <if test="insertTime != null">
  89. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  90. </if>
  91. <if test="updateUsername != null and updateUsername != ''">
  92. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  93. </if>
  94. <if test="updateTime != null">
  95. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  96. </if>
  97. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  98. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  99. </if>
  100. <if test="deleted != null">
  101. and DELETED = #{deleted}
  102. </if>
  103. </where>
  104. </sql>
  105. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  106. delete from RMS_GATEPOST
  107. where GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL}
  108. </delete>
  109. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  110. delete from RMS_GATEPOST
  111. where 1!=1
  112. <if test="gatepostName != null and gatepostName != ''">
  113. or GATEPOST_NAME = #{gatepostName}
  114. </if>
  115. <if test="gatepostLongitude != null and gatepostLongitude != ''">
  116. or GATEPOST_LONGITUDE = #{gatepostLongitude}
  117. </if>
  118. <if test="gatepostLatitude != null and gatepostLatitude != ''">
  119. or GATEPOST_LATITUDE = #{gatepostLatitude}
  120. </if>
  121. <if test="gatepostPriority != null">
  122. or GATEPOST_PRIORITY = #{gatepostPriority}
  123. </if>
  124. <if test="insertUsername != null and insertUsername != ''">
  125. or INSERT_USERNAME = #{insertUsername}
  126. </if>
  127. <if test="insertTime != null">
  128. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  129. </if>
  130. <if test="updateUsername != null and updateUsername != ''">
  131. or UPDATE_USERNAME = #{updateUsername}
  132. </if>
  133. <if test="updateTime != null">
  134. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  135. </if>
  136. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  137. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  138. </if>
  139. <if test="deleted != null">
  140. or DELETED = #{deleted}
  141. </if>
  142. </delete>
  143. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsGatepost">
  144. insert into RMS_GATEPOST (GATEPOST_ID, GATEPOST_NAME, GATEPOST_LONGITUDE,
  145. GATEPOST_LATITUDE, GATEPOST_PRIORITY, INSERT_USERNAME,
  146. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  147. INSERT_UPDATE_REMARK,DELETED)
  148. values (#{gatepostId,jdbcType=DECIMAL}, #{gatepostName,jdbcType=VARCHAR}, #{gatepostLongitude,jdbcType=VARCHAR},
  149. #{gatepostLatitude,jdbcType=VARCHAR}, #{gatepostPriority,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR},
  150. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  151. #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL})
  152. </insert>
  153. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsGatepost">
  154. insert into RMS_GATEPOST
  155. <trim prefix="(" suffix=")" suffixOverrides=",">
  156. <if test="gatepostId != null">
  157. GATEPOST_ID,
  158. </if>
  159. <if test="gatepostName != null">
  160. GATEPOST_NAME,
  161. </if>
  162. <if test="gatepostLongitude != null">
  163. GATEPOST_LONGITUDE,
  164. </if>
  165. <if test="gatepostLatitude != null">
  166. GATEPOST_LATITUDE,
  167. </if>
  168. <if test="gatepostPriority != null">
  169. GATEPOST_PRIORITY,
  170. </if>
  171. <if test="insertUsername != null">
  172. INSERT_USERNAME,
  173. </if>
  174. <if test="insertTime != null">
  175. INSERT_TIME,
  176. </if>
  177. <if test="updateUsername != null">
  178. UPDATE_USERNAME,
  179. </if>
  180. <if test="updateTime != null">
  181. UPDATE_TIME,
  182. </if>
  183. <if test="insertUpdateRemark != null">
  184. INSERT_UPDATE_REMARK,
  185. </if>
  186. <if test="deleted != null">
  187. DELETED,
  188. </if>
  189. </trim>
  190. <trim prefix="values (" suffix=")" suffixOverrides=",">
  191. <if test="gatepostId != null">
  192. #{gatepostId,jdbcType=DECIMAL},
  193. </if>
  194. <if test="gatepostName != null">
  195. #{gatepostName,jdbcType=VARCHAR},
  196. </if>
  197. <if test="gatepostLongitude != null">
  198. #{gatepostLongitude,jdbcType=VARCHAR},
  199. </if>
  200. <if test="gatepostLatitude != null">
  201. #{gatepostLatitude,jdbcType=VARCHAR},
  202. </if>
  203. <if test="gatepostPriority != null">
  204. #{gatepostPriority,jdbcType=DECIMAL},
  205. </if>
  206. <if test="insertUsername != null">
  207. #{insertUsername,jdbcType=VARCHAR},
  208. </if>
  209. <if test="insertTime != null">
  210. #{insertTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="updateUsername != null">
  213. #{updateUsername,jdbcType=VARCHAR},
  214. </if>
  215. <if test="updateTime != null">
  216. #{updateTime,jdbcType=TIMESTAMP},
  217. </if>
  218. <if test="insertUpdateRemark != null">
  219. #{insertUpdateRemark,jdbcType=VARCHAR},
  220. </if>
  221. <if test="deleted != null">
  222. #{deleted,jdbcType=DECIMAL},
  223. </if>
  224. </trim>
  225. </insert>
  226. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsGatepost">
  227. update RMS_GATEPOST
  228. set GATEPOST_NAME = #{gatepostName,jdbcType=VARCHAR},
  229. GATEPOST_LONGITUDE = #{gatepostLongitude,jdbcType=VARCHAR},
  230. GATEPOST_LATITUDE = #{gatepostLatitude,jdbcType=VARCHAR},
  231. GATEPOST_PRIORITY = #{gatepostPriority,jdbcType=DECIMAL},
  232. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  233. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  234. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  235. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  236. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  237. DELETED = #{deleted,jdbcType=DECIMAL}
  238. where GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL}
  239. </update>
  240. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsGatepost">
  241. update RMS_GATEPOST
  242. <set>
  243. <if test="gatepostName != null">
  244. GATEPOST_NAME = #{gatepostName,jdbcType=VARCHAR},
  245. </if>
  246. <if test="gatepostLongitude != null">
  247. GATEPOST_LONGITUDE = #{gatepostLongitude,jdbcType=VARCHAR},
  248. </if>
  249. <if test="gatepostLatitude != null">
  250. GATEPOST_LATITUDE = #{gatepostLatitude,jdbcType=VARCHAR},
  251. </if>
  252. <if test="gatepostPriority != null">
  253. GATEPOST_PRIORITY = #{gatepostPriority,jdbcType=DECIMAL},
  254. </if>
  255. <if test="insertUsername != null">
  256. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  257. </if>
  258. <if test="insertTime != null">
  259. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="updateUsername != null">
  262. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  263. </if>
  264. <if test="updateTime != null">
  265. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="insertUpdateRemark != null">
  268. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  269. </if>
  270. <if test="deleted != null">
  271. DELETED = #{deleted,jdbcType=DECIMAL},
  272. </if>
  273. </set>
  274. where GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL}
  275. </update>
  276. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  277. <include refid="select" />
  278. where GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL}
  279. </select>
  280. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  281. <include refid="select" />
  282. <include refid="where" />
  283. </select>
  284. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  285. <include refid="select" />
  286. <include refid="whereLike" />
  287. </select>
  288. <insert id="batchInsert" parameterType="java.util.List">
  289. insert into RMS_GATEPOST
  290. (GATEPOST_ID,
  291. GATEPOST_NAME, GATEPOST_LONGITUDE,
  292. GATEPOST_LATITUDE, GATEPOST_PRIORITY,
  293. INSERT_USERNAME, INSERT_TIME,
  294. UPDATE_USERNAME, UPDATE_TIME,
  295. INSERT_UPDATE_REMARK,DELETED,)
  296. ( <foreach collection="list" item="item" separator="union all">
  297. select
  298. #{item.gatepostId,jdbcType=DECIMAL},
  299. #{item.gatepostName,jdbcType=VARCHAR}, #{item.gatepostLongitude,jdbcType=VARCHAR},
  300. #{item.gatepostLatitude,jdbcType=VARCHAR}, #{item.gatepostPriority,jdbcType=DECIMAL},
  301. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  302. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  303. #{item.insertUpdateRemark,jdbcType=VARCHAR},, #{item.deleted,jdbcType=DECIMAL} from dual
  304. </foreach> )
  305. </insert>
  306. <update id="batchUpdate" parameterType="java.util.List">
  307. update RMS_GATEPOST
  308. set
  309. GATEPOST_ID=
  310. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  311. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
  312. </foreach>
  313. ,GATEPOST_NAME=
  314. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  315. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.gatepostName,jdbcType=VARCHAR}
  316. </foreach>
  317. ,GATEPOST_LONGITUDE=
  318. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  319. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.gatepostLongitude,jdbcType=VARCHAR}
  320. </foreach>
  321. ,GATEPOST_LATITUDE=
  322. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  323. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.gatepostLatitude,jdbcType=VARCHAR}
  324. </foreach>
  325. ,GATEPOST_PRIORITY=
  326. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  327. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.gatepostPriority,jdbcType=DECIMAL}
  328. </foreach>
  329. ,INSERT_USERNAME=
  330. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  331. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  332. </foreach>
  333. ,INSERT_TIME=
  334. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  335. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  336. </foreach>
  337. ,UPDATE_USERNAME=
  338. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  339. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  340. </foreach>
  341. ,UPDATE_TIME=
  342. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  343. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  344. </foreach>
  345. ,INSERT_UPDATE_REMARK=
  346. <foreach close="end" collection="list" index="index" item="item" open="case GATEPOST_ID" separator=" ">
  347. when #{item.gatepostId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  348. </foreach>
  349. ,DELETED=
  350. <foreach close="end" collection="list" index="index" item="item" open="case RULES_ID" separator=" ">
  351. when #{item.rulesId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  352. </foreach>
  353. where GATEPOST_ID in
  354. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  355. #{item.gatepostId,jdbcType=DECIMAL}
  356. </foreach>
  357. </update>
  358. <delete id="batchDelete" parameterType="java.util.List">
  359. delete from RMS_GATEPOST
  360. where GATEPOST_ID in
  361. <foreach close=")" collection="list" item="id" open="(" separator=",">
  362. #{id}
  363. </foreach>
  364. </delete>
  365. <!-- 友情提示!!!-->
  366. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  367. <select id="getGatepostList" parameterType="java.util.Map" resultType="java.util.Map">
  368. SELECT * FROM
  369. (
  370. SELECT
  371. RG.GATEPOST_ID AS "gatepostId",
  372. RG.GATEPOST_NAME AS "gatepostName",
  373. RG.GATEPOST_LONGITUDE AS "gatepostLongitude",
  374. RG.GATEPOST_LATITUDE AS "gatepostLatitude",
  375. RG.GATEPOST_PRIORITY AS "gatepostPriority"
  376. FROM RMS_GATEPOST RG
  377. WHERE RG.DELETED !=1
  378. ORDER BY RG.INSERT_TIME DESC
  379. )
  380. <where>
  381. <if test="gatepostName!= null">
  382. and
  383. <foreach collection="gatepostName" item="item" open="(" separator="," close=")">
  384. "gatepostName" in #{item}
  385. </foreach>
  386. </if>
  387. <if test="gatepostLongitude!= null">
  388. and
  389. <foreach collection="gatepostLongitude" item="item" open="(" separator="," close=")">
  390. "gatepostLongitude" in #{item}
  391. </foreach>
  392. </if>
  393. <if test="gatepostLatitude!= null">
  394. and
  395. <foreach collection="gatepostLatitude" item="item" open="(" separator="," close=")">
  396. "gatepostLatitude" in #{item}
  397. </foreach>
  398. </if>
  399. <if test="gatepostPriority!= null">
  400. and
  401. <foreach collection="gatepostPriority" item="item" open="(" separator="," close=")">
  402. "gatepostPriority" in #{item}
  403. </foreach>
  404. </if>
  405. </where>
  406. <include refid="orderBy"></include>
  407. </select>
  408. <sql id="orderBy">
  409. <if test="orderField!=null and orderField !=''">
  410. order by "${orderField}"
  411. <if test="orderType !=null and orderType !=''">
  412. ${orderType}
  413. </if>
  414. </if>
  415. </sql>
  416. <!-- 根据门岗id获取详细的门岗规则-->
  417. <select id="getGatepostRulesById" parameterType="java.util.LinkedHashMap" resultType="java.util.LinkedHashMap">
  418. SELECT
  419. RG.GATEPOST_ID AS "gatepostId",
  420. RG.GATEPOST_NAME AS "gatepostName",
  421. RG.GATEPOST_LONGITUDE AS "gatepostLongitude",
  422. RG.GATEPOST_LATITUDE AS "gatepostLatitude",
  423. RG.GATEPOST_PRIORITY AS "gatepostPriority",
  424. RGR.RULES_ID AS "rulesId",
  425. RGR.RULES_GATEPOST_START_TIME AS "rulesGatepostStartTime",
  426. RGR.RULES_GATEPOST_END_TIME AS "rulesGatepostEndTime",
  427. RGR.RULES_GATEPOST_ENTRY_OUT_TYPE AS "rulesGatepostEntityOutType",
  428. RGR.VEHICLE_TYPE_ID AS "vehicleTypeId",
  429. RCT.CAPACITY_TYPE_NAME AS "vehicleTypeName",
  430. RGR.MATERIAL_ID AS "materialId",
  431. RM.MATERIAL_NAME AS "materialName"
  432. FROM RMS_GATEPOST RG
  433. LEFT JOIN RMS_GATEPOST_RULES RGR
  434. ON RGR.GATEPOST_ID=RG.GATEPOST_ID
  435. LEFT JOIN RMS_CAPACITY_TYPE RCT
  436. ON RCT.CAPACITY_TYPE_ID=RGR.VEHICLE_TYPE_ID
  437. LEFT JOIN RMS_MATERIAL RM
  438. ON RM.MATERIAL_ID=RGR.MATERIAL_ID
  439. WHERE RG.GATEPOST_ID=#{gatepostId} AND RGR.DELETED !=1
  440. ORDER BY RG.INSERT_TIME DESC
  441. </select>
  442. <!-- 根据id获取详细的门岗信息-->
  443. <select id="getGatepostById" resultType="java.util.Map">
  444. SELECT
  445. RGR.RULES_ID AS "rulesId",
  446. RGR.RULES_GATEPOST_START_TIME AS "rulesGatepostStartTime",
  447. RGR.RULES_GATEPOST_END_TIME AS "rulesGatepostEndTime",
  448. RGR.RULES_GATEPOST_ENTRY_OUT_TYPE AS "rulesGatepostEntityOutType",
  449. RGR.VEHICLE_TYPE_ID AS "vehicleTypeId",
  450. RGR.MATERIAL_ID AS "materialId",
  451. RGR.GATEPOST_ID AS "gatepostId",
  452. RG.GATEPOST_NAME AS "gatepostName",
  453. RG.GATEPOST_PRIORITY AS "gatepostPriority",
  454. RCT.CAPACITY_TYPE_NAME AS "vehicleTypeName",
  455. RM.MATERIAL_NAME AS "materialName"
  456. FROM RMS_GATEPOST_RULES RGR
  457. LEFT JOIN RMS_GATEPOST RG
  458. ON RGR.GATEPOST_ID=RG.GATEPOST_ID
  459. LEFT JOIN RMS_CAPACITY_TYPE RCT
  460. ON RCT.CAPACITY_TYPE_ID=RGR.VEHICLE_TYPE_ID
  461. LEFT JOIN RMS_MATERIAL RM
  462. ON RM.MATERIAL_ID=RGR.MATERIAL_ID
  463. WHERE RGR.RULES_ID=#{rulesId} AND RGR.DELETED !=1
  464. ORDER BY RGR.INSERT_TIME DESC
  465. </select>
  466. <!-- 获取门岗规则Id-->
  467. <select id="getGatepostRulesId" resultType="java.util.LinkedHashMap">
  468. SELECT
  469. RGR.RULES_ID "id",
  470. RGR.RULES_ID "value",
  471. RGR.RULES_GATEPOST_ENTRY_OUT_TYPE "entityOutType",
  472. RGR.RULES_GATEPOST_START_TIME "startTime",
  473. RGR.RULES_GATEPOST_END_TIME "endTime",
  474. RGR.VEHICLE_TYPE_ID "vehicleType"
  475. FROM
  476. RMS_GATEPOST_RULES RGR
  477. WHERE
  478. RGR.DELETED!=1
  479. </select>
  480. <!-- 获取门岗的最大id-->
  481. <select id="getGatepostMaxId" resultType="java.math.BigDecimal">
  482. SELECT MAX(GATEPOST_ID)+1 FROM RMS_GATEPOST
  483. </select>
  484. <!-- 根据门岗id查询门岗名-->
  485. <select id="getGatepostName" resultType="java.util.Map" parameterType="java.math.BigDecimal">
  486. SELECT
  487. RG.GATEPOST_NAME AS "gatepostName",
  488. RG.GATEPOST_ID AS "gatepostId"
  489. FROM RMS_GATEPOST RG
  490. WHERE RG.GATEPOST_ID=#{gatepostId}
  491. </select>
  492. <!-- 根据门岗名得到当前表中门岗名的数量-->
  493. <select id="selectParamaterGatepostName" parameterType="java.lang.String" resultType="java.lang.Integer">
  494. SELECT count(*)
  495. FROM RMS_GATEPOST RG
  496. WHERE RG.GATEPOST_NAME =#{gatepostName}
  497. AND RG.DELETED=0
  498. </select>
  499. </mapper>