RmsWarehouseMapper.xml 20 KB

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