RmsGatepostRulesMapper.xml 20 KB

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