RmsPwarehouseGridMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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.RmsPwarehouseGridMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsPwarehouseGrid">
  5. <id column="GRID_ID" jdbcType="DECIMAL" property="gridId" />
  6. <result column="WAREHOUSE_ID" jdbcType="DECIMAL" property="warehouseId" />
  7. <result column="PLATFORM_ID" jdbcType="DECIMAL" property="platformId" />
  8. <result column="STACKING_ID" jdbcType="DECIMAL" property="stackingId" />
  9. <result column="GRID_GRADATION_NUMBER" jdbcType="DECIMAL" property="gridGradationNumber" />
  10. <result column="GRID_SEQUENCE_NUMBER" jdbcType="DECIMAL" property="gridSequenceNumber" />
  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. </resultMap>
  17. <sql id="columns">
  18. GRID_ID, WAREHOUSE_ID, PLATFORM_ID, STACKING_ID, GRID_GRADATION_NUMBER, GRID_SEQUENCE_NUMBER,
  19. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
  20. </sql>
  21. <sql id="columns_alias">
  22. t.GRID_ID, t.WAREHOUSE_ID, t.PLATFORM_ID, t.STACKING_ID, t.GRID_GRADATION_NUMBER,
  23. t.GRID_SEQUENCE_NUMBER, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  24. t.INSERT_UPDATE_REMARK
  25. </sql>
  26. <sql id="select">
  27. SELECT <include refid="columns" /> FROM RMS_PWAREHOUSE_GRID
  28. </sql>
  29. <sql id="select_alias">
  30. SELECT <include refid="columns_alias" /> FROM RMS_PWAREHOUSE_GRID t
  31. </sql>
  32. <sql id="where">
  33. <where>
  34. <if test="gridId != null">
  35. and GRID_ID = #{gridId}
  36. </if>
  37. <if test="warehouseId != null">
  38. and WAREHOUSE_ID = #{warehouseId}
  39. </if>
  40. <if test="platformId != null">
  41. and PLATFORM_ID = #{platformId}
  42. </if>
  43. <if test="stackingId != null">
  44. and STACKING_ID = #{stackingId}
  45. </if>
  46. <if test="gridGradationNumber != null">
  47. and GRID_GRADATION_NUMBER = #{gridGradationNumber}
  48. </if>
  49. <if test="gridSequenceNumber != null">
  50. and GRID_SEQUENCE_NUMBER = #{gridSequenceNumber}
  51. </if>
  52. <if test="insertUsername != null and insertUsername != ''">
  53. and INSERT_USERNAME = #{insertUsername}
  54. </if>
  55. <if test="insertTime != null">
  56. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  57. </if>
  58. <if test="updateUsername != null and updateUsername != ''">
  59. and UPDATE_USERNAME = #{updateUsername}
  60. </if>
  61. <if test="updateTime != null">
  62. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  63. </if>
  64. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  65. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  66. </if>
  67. </where>
  68. </sql>
  69. <sql id="whereLike">
  70. <where>
  71. <if test="gridId != null">
  72. and GRID_ID = #{gridId}
  73. </if>
  74. <if test="warehouseId != null">
  75. and WAREHOUSE_ID = #{warehouseId}
  76. </if>
  77. <if test="platformId != null">
  78. and PLATFORM_ID = #{platformId}
  79. </if>
  80. <if test="stackingId != null">
  81. and STACKING_ID = #{stackingId}
  82. </if>
  83. <if test="gridGradationNumber != null">
  84. and GRID_GRADATION_NUMBER = #{gridGradationNumber}
  85. </if>
  86. <if test="gridSequenceNumber != null">
  87. and GRID_SEQUENCE_NUMBER = #{gridSequenceNumber}
  88. </if>
  89. <if test="insertUsername != null and insertUsername != ''">
  90. and INSERT_USERNAME LIKE '%${insertUsername}%'
  91. </if>
  92. <if test="insertTime != null">
  93. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  94. </if>
  95. <if test="updateUsername != null and updateUsername != ''">
  96. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  97. </if>
  98. <if test="updateTime != null">
  99. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  100. </if>
  101. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  102. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  103. </if>
  104. </where>
  105. </sql>
  106. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  107. delete from RMS_PWAREHOUSE_GRID
  108. where GRID_ID = #{gridId,jdbcType=DECIMAL}
  109. </delete>
  110. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  111. delete from RMS_PWAREHOUSE_GRID
  112. where 1!=1
  113. <if test="warehouseId != null">
  114. or WAREHOUSE_ID = #{warehouseId}
  115. </if>
  116. <if test="platformId != null">
  117. or PLATFORM_ID = #{platformId}
  118. </if>
  119. <if test="stackingId != null">
  120. or STACKING_ID = #{stackingId}
  121. </if>
  122. <if test="gridGradationNumber != null">
  123. or GRID_GRADATION_NUMBER = #{gridGradationNumber}
  124. </if>
  125. <if test="gridSequenceNumber != null">
  126. or GRID_SEQUENCE_NUMBER = #{gridSequenceNumber}
  127. </if>
  128. <if test="insertUsername != null and insertUsername != ''">
  129. or INSERT_USERNAME = #{insertUsername}
  130. </if>
  131. <if test="insertTime != null">
  132. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  133. </if>
  134. <if test="updateUsername != null and updateUsername != ''">
  135. or UPDATE_USERNAME = #{updateUsername}
  136. </if>
  137. <if test="updateTime != null">
  138. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  139. </if>
  140. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  141. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  142. </if>
  143. </delete>
  144. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsPwarehouseGrid">
  145. insert into RMS_PWAREHOUSE_GRID (GRID_ID, WAREHOUSE_ID, PLATFORM_ID,
  146. STACKING_ID, GRID_GRADATION_NUMBER, GRID_SEQUENCE_NUMBER,
  147. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  148. UPDATE_TIME, INSERT_UPDATE_REMARK)
  149. values (#{gridId,jdbcType=DECIMAL}, #{warehouseId,jdbcType=DECIMAL}, #{platformId,jdbcType=DECIMAL},
  150. #{stackingId,jdbcType=DECIMAL}, #{gridGradationNumber,jdbcType=DECIMAL}, #{gridSequenceNumber,jdbcType=DECIMAL},
  151. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  152. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  153. </insert>
  154. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsPwarehouseGrid">
  155. insert into RMS_PWAREHOUSE_GRID
  156. <trim prefix="(" suffix=")" suffixOverrides=",">
  157. <if test="gridId != null">
  158. GRID_ID,
  159. </if>
  160. <if test="warehouseId != null">
  161. WAREHOUSE_ID,
  162. </if>
  163. <if test="platformId != null">
  164. PLATFORM_ID,
  165. </if>
  166. <if test="stackingId != null">
  167. STACKING_ID,
  168. </if>
  169. <if test="gridGradationNumber != null">
  170. GRID_GRADATION_NUMBER,
  171. </if>
  172. <if test="gridSequenceNumber != null">
  173. GRID_SEQUENCE_NUMBER,
  174. </if>
  175. <if test="insertUsername != null">
  176. INSERT_USERNAME,
  177. </if>
  178. <if test="insertTime != null">
  179. INSERT_TIME,
  180. </if>
  181. <if test="updateUsername != null">
  182. UPDATE_USERNAME,
  183. </if>
  184. <if test="updateTime != null">
  185. UPDATE_TIME,
  186. </if>
  187. <if test="insertUpdateRemark != null">
  188. INSERT_UPDATE_REMARK,
  189. </if>
  190. </trim>
  191. <trim prefix="values (" suffix=")" suffixOverrides=",">
  192. <if test="gridId != null">
  193. #{gridId,jdbcType=DECIMAL},
  194. </if>
  195. <if test="warehouseId != null">
  196. #{warehouseId,jdbcType=DECIMAL},
  197. </if>
  198. <if test="platformId != null">
  199. #{platformId,jdbcType=DECIMAL},
  200. </if>
  201. <if test="stackingId != null">
  202. #{stackingId,jdbcType=DECIMAL},
  203. </if>
  204. <if test="gridGradationNumber != null">
  205. #{gridGradationNumber,jdbcType=DECIMAL},
  206. </if>
  207. <if test="gridSequenceNumber != null">
  208. #{gridSequenceNumber,jdbcType=DECIMAL},
  209. </if>
  210. <if test="insertUsername != null">
  211. #{insertUsername,jdbcType=VARCHAR},
  212. </if>
  213. <if test="insertTime != null">
  214. #{insertTime,jdbcType=TIMESTAMP},
  215. </if>
  216. <if test="updateUsername != null">
  217. #{updateUsername,jdbcType=VARCHAR},
  218. </if>
  219. <if test="updateTime != null">
  220. #{updateTime,jdbcType=TIMESTAMP},
  221. </if>
  222. <if test="insertUpdateRemark != null">
  223. #{insertUpdateRemark,jdbcType=VARCHAR},
  224. </if>
  225. </trim>
  226. </insert>
  227. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsPwarehouseGrid">
  228. update RMS_PWAREHOUSE_GRID
  229. set WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  230. PLATFORM_ID = #{platformId,jdbcType=DECIMAL},
  231. STACKING_ID = #{stackingId,jdbcType=DECIMAL},
  232. GRID_GRADATION_NUMBER = #{gridGradationNumber,jdbcType=DECIMAL},
  233. GRID_SEQUENCE_NUMBER = #{gridSequenceNumber,jdbcType=DECIMAL},
  234. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  235. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  236. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  237. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  238. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  239. where GRID_ID = #{gridId,jdbcType=DECIMAL}
  240. </update>
  241. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsPwarehouseGrid">
  242. update RMS_PWAREHOUSE_GRID
  243. <set>
  244. <if test="warehouseId != null">
  245. WAREHOUSE_ID = #{warehouseId,jdbcType=DECIMAL},
  246. </if>
  247. <if test="platformId != null">
  248. PLATFORM_ID = #{platformId,jdbcType=DECIMAL},
  249. </if>
  250. <if test="stackingId != null">
  251. STACKING_ID = #{stackingId,jdbcType=DECIMAL},
  252. </if>
  253. <if test="gridGradationNumber != null">
  254. GRID_GRADATION_NUMBER = #{gridGradationNumber,jdbcType=DECIMAL},
  255. </if>
  256. <if test="gridSequenceNumber != null">
  257. GRID_SEQUENCE_NUMBER = #{gridSequenceNumber,jdbcType=DECIMAL},
  258. </if>
  259. <if test="insertUsername != null">
  260. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  261. </if>
  262. <if test="insertTime != null">
  263. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  264. </if>
  265. <if test="updateUsername != null">
  266. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  267. </if>
  268. <if test="updateTime != null">
  269. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  270. </if>
  271. <if test="insertUpdateRemark != null">
  272. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  273. </if>
  274. </set>
  275. where GRID_ID = #{gridId,jdbcType=DECIMAL}
  276. </update>
  277. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  278. <include refid="select" />
  279. where GRID_ID = #{gridId,jdbcType=DECIMAL}
  280. </select>
  281. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  282. <include refid="select" />
  283. <include refid="where" />
  284. </select>
  285. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  286. <include refid="select" />
  287. <include refid="whereLike" />
  288. </select>
  289. <insert id="batchInsert" parameterType="java.util.List">
  290. insert into RMS_PWAREHOUSE_GRID
  291. (GRID_ID,
  292. WAREHOUSE_ID, PLATFORM_ID, STACKING_ID,
  293. GRID_GRADATION_NUMBER, GRID_SEQUENCE_NUMBER,
  294. INSERT_USERNAME, INSERT_TIME,
  295. UPDATE_USERNAME, UPDATE_TIME,
  296. INSERT_UPDATE_REMARK)
  297. ( <foreach collection="list" item="item" separator="union all">
  298. select
  299. #{item.gridId,jdbcType=DECIMAL},
  300. #{item.warehouseId,jdbcType=DECIMAL}, #{item.platformId,jdbcType=DECIMAL}, #{item.stackingId,jdbcType=DECIMAL},
  301. #{item.gridGradationNumber,jdbcType=DECIMAL}, #{item.gridSequenceNumber,jdbcType=DECIMAL},
  302. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  303. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  304. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  305. </foreach> )
  306. </insert>
  307. <update id="batchUpdate" parameterType="java.util.List">
  308. update RMS_PWAREHOUSE_GRID
  309. set
  310. GRID_ID=
  311. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  312. when #{item.gridId,jdbcType=DECIMAL} then #{item.gridId,jdbcType=DECIMAL}
  313. </foreach>
  314. ,WAREHOUSE_ID=
  315. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  316. when #{item.gridId,jdbcType=DECIMAL} then #{item.warehouseId,jdbcType=DECIMAL}
  317. </foreach>
  318. ,PLATFORM_ID=
  319. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  320. when #{item.gridId,jdbcType=DECIMAL} then #{item.platformId,jdbcType=DECIMAL}
  321. </foreach>
  322. ,STACKING_ID=
  323. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  324. when #{item.gridId,jdbcType=DECIMAL} then #{item.stackingId,jdbcType=DECIMAL}
  325. </foreach>
  326. ,GRID_GRADATION_NUMBER=
  327. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  328. when #{item.gridId,jdbcType=DECIMAL} then #{item.gridGradationNumber,jdbcType=DECIMAL}
  329. </foreach>
  330. ,GRID_SEQUENCE_NUMBER=
  331. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  332. when #{item.gridId,jdbcType=DECIMAL} then #{item.gridSequenceNumber,jdbcType=DECIMAL}
  333. </foreach>
  334. ,INSERT_USERNAME=
  335. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  336. when #{item.gridId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  337. </foreach>
  338. ,INSERT_TIME=
  339. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  340. when #{item.gridId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  341. </foreach>
  342. ,UPDATE_USERNAME=
  343. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  344. when #{item.gridId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  345. </foreach>
  346. ,UPDATE_TIME=
  347. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  348. when #{item.gridId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  349. </foreach>
  350. ,INSERT_UPDATE_REMARK=
  351. <foreach close="end" collection="list" index="index" item="item" open="case GRID_ID" separator=" ">
  352. when #{item.gridId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  353. </foreach>
  354. where GRID_ID in
  355. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  356. #{item.gridId,jdbcType=DECIMAL}
  357. </foreach>
  358. </update>
  359. <delete id="batchDelete" parameterType="java.util.List">
  360. delete from RMS_PWAREHOUSE_GRID
  361. where GRID_ID in
  362. <foreach close=")" collection="list" item="id" open="(" separator=",">
  363. #{id}
  364. </foreach>
  365. </delete>
  366. <!-- 友情提示!!!-->
  367. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  368. </mapper>