RmsReceivePlaceMapper.xml 17 KB

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