RmsWarehouseMapper.xml 23 KB

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