AreaShowPointMapper.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  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.izouma.awesomeadmin.dao.AreaShowPointMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.AreaShowPoint" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  8. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  9. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  10. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  11. <result column="power" property="power" jdbcType="VARCHAR" />
  12. <result column="city_id" property="cityId" jdbcType="VARCHAR" />
  13. <result column="landmark_id" property="landmarkId" jdbcType="VARCHAR" />
  14. <result column="area_id" property="areaId" jdbcType="VARCHAR" />
  15. <result column="point_name" property="pointName" jdbcType="VARCHAR" />
  16. <result column="door_flag" property="doorFlag" jdbcType="VARCHAR" />
  17. <result column="remark" property="remark" jdbcType="VARCHAR" />
  18. <result column="map_x" property="mapX" jdbcType="VARCHAR" />
  19. <result column="map_y" property="mapY" jdbcType="VARCHAR" />
  20. <result column="map_index" property="mapIndex" jdbcType="VARCHAR" />
  21. </resultMap>
  22. <sql id="Base_Column_List" >
  23. <trim suffixOverrides="," >
  24. id,
  25. del_flag,
  26. update_time,
  27. update_user,
  28. create_time,
  29. create_user,
  30. power,
  31. city_id,
  32. landmark_id,
  33. area_id,
  34. point_name,
  35. door_flag,
  36. remark,
  37. map_x,
  38. map_y,
  39. map_index,
  40. </trim>
  41. </sql>
  42. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  43. select
  44. <include refid="Base_Column_List" />
  45. from area_show_point
  46. where id = #{id,jdbcType=INTEGER}
  47. </select>
  48. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  49. delete from area_show_point
  50. where id = #{id,jdbcType=INTEGER}
  51. </delete>
  52. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.AreaShowPoint" useGeneratedKeys="true" keyProperty="id">
  53. insert into area_show_point
  54. <trim prefix="(" suffix=")" suffixOverrides="," >
  55. <if test="id!= null" >
  56. id,
  57. </if>
  58. <if test="delFlag!= null" >
  59. del_flag,
  60. </if>
  61. <if test="updateTime!= null" >
  62. update_time,
  63. </if>
  64. <if test="updateUser!= null" >
  65. update_user,
  66. </if>
  67. <if test="createTime!= null" >
  68. create_time,
  69. </if>
  70. <if test="createUser!= null" >
  71. create_user,
  72. </if>
  73. <if test="power!= null" >
  74. power,
  75. </if>
  76. <if test="cityId!= null" >
  77. city_id,
  78. </if>
  79. <if test="landmarkId!= null" >
  80. landmark_id,
  81. </if>
  82. <if test="areaId!= null" >
  83. area_id,
  84. </if>
  85. <if test="pointName!= null" >
  86. point_name,
  87. </if>
  88. <if test="doorFlag!= null" >
  89. door_flag,
  90. </if>
  91. <if test="remark!= null" >
  92. remark,
  93. </if>
  94. <if test="mapX!= null" >
  95. map_x,
  96. </if>
  97. <if test="mapY!= null" >
  98. map_y,
  99. </if>
  100. <if test="mapIndex!= null" >
  101. map_index,
  102. </if>
  103. </trim>
  104. <trim prefix="values (" suffix=")" suffixOverrides="," >
  105. <if test="id != null" >
  106. #{id,jdbcType=INTEGER},
  107. </if>
  108. <if test="delFlag != null" >
  109. #{delFlag,jdbcType=CHAR},
  110. </if>
  111. <if test="updateTime != null" >
  112. #{updateTime,jdbcType=TIMESTAMP},
  113. </if>
  114. <if test="updateUser != null" >
  115. #{updateUser,jdbcType=VARCHAR},
  116. </if>
  117. <if test="createTime != null" >
  118. #{createTime,jdbcType=TIMESTAMP},
  119. </if>
  120. <if test="createUser != null" >
  121. #{createUser,jdbcType=VARCHAR},
  122. </if>
  123. <if test="power != null" >
  124. #{power,jdbcType=VARCHAR},
  125. </if>
  126. <if test="cityId != null" >
  127. #{cityId,jdbcType=VARCHAR},
  128. </if>
  129. <if test="landmarkId != null" >
  130. #{landmarkId,jdbcType=VARCHAR},
  131. </if>
  132. <if test="areaId != null" >
  133. #{areaId,jdbcType=VARCHAR},
  134. </if>
  135. <if test="pointName != null" >
  136. #{pointName,jdbcType=VARCHAR},
  137. </if>
  138. <if test="doorFlag != null" >
  139. #{doorFlag,jdbcType=VARCHAR},
  140. </if>
  141. <if test="remark != null" >
  142. #{remark,jdbcType=VARCHAR},
  143. </if>
  144. <if test="mapX != null" >
  145. #{mapX,jdbcType=VARCHAR},
  146. </if>
  147. <if test="mapY != null" >
  148. #{mapY,jdbcType=VARCHAR},
  149. </if>
  150. <if test="mapIndex != null" >
  151. #{mapIndex,jdbcType=VARCHAR},
  152. </if>
  153. </trim>
  154. </insert>
  155. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.AreaShowPoint" >
  156. update area_show_point
  157. <set >
  158. <if test="id != null" >
  159. id= #{id,jdbcType=INTEGER},
  160. </if>
  161. <if test="delFlag != null" >
  162. del_flag= #{delFlag,jdbcType=CHAR},
  163. </if>
  164. <if test="updateTime != null" >
  165. update_time= #{updateTime,jdbcType=TIMESTAMP},
  166. </if>
  167. <if test="updateUser != null" >
  168. update_user= #{updateUser,jdbcType=VARCHAR},
  169. </if>
  170. <if test="createTime != null" >
  171. create_time= #{createTime,jdbcType=TIMESTAMP},
  172. </if>
  173. <if test="createUser != null" >
  174. create_user= #{createUser,jdbcType=VARCHAR},
  175. </if>
  176. <if test="power != null" >
  177. power= #{power,jdbcType=VARCHAR},
  178. </if>
  179. <if test="cityId != null" >
  180. city_id= #{cityId,jdbcType=VARCHAR},
  181. </if>
  182. <if test="landmarkId != null" >
  183. landmark_id= #{landmarkId,jdbcType=VARCHAR},
  184. </if>
  185. <if test="areaId != null" >
  186. area_id= #{areaId,jdbcType=VARCHAR},
  187. </if>
  188. <if test="pointName != null" >
  189. point_name= #{pointName,jdbcType=VARCHAR},
  190. </if>
  191. <if test="doorFlag != null" >
  192. door_flag= #{doorFlag,jdbcType=VARCHAR},
  193. </if>
  194. <if test="remark != null" >
  195. remark= #{remark,jdbcType=VARCHAR},
  196. </if>
  197. <if test="mapX != null" >
  198. map_x= #{mapX,jdbcType=VARCHAR},
  199. </if>
  200. <if test="mapY != null" >
  201. map_y= #{mapY,jdbcType=VARCHAR},
  202. </if>
  203. <if test="mapIndex != null" >
  204. map_index= #{mapIndex,jdbcType=VARCHAR},
  205. </if>
  206. </set>
  207. where
  208. <if test="id != null and !&quot;&quot;.equals(id)">
  209. id = #{id,jdbcType=INTEGER}
  210. </if>
  211. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  212. id in (${idStr})
  213. </if>
  214. </update>
  215. <select id="queryAreaShowPointByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.AreaShowPoint">
  216. select <include refid="Base_Column_List"/> from area_show_point
  217. <where>
  218. and del_flag = 'N'
  219. <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
  220. and id in (${record.idStr})
  221. </if>
  222. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  223. and id = #{record.id}
  224. </if>
  225. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  226. and del_flag = #{record.delFlag}
  227. </if>
  228. <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
  229. and update_time = #{record.updateTime}
  230. </if>
  231. <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
  232. and update_user = #{record.updateUser}
  233. </if>
  234. <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
  235. and create_time = #{record.createTime}
  236. </if>
  237. <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
  238. and create_user = #{record.createUser}
  239. </if>
  240. <if test="record.power != null and !&quot;&quot;.equals(record.power)">
  241. and power = #{record.power}
  242. </if>
  243. <if test="record.cityId != null and !&quot;&quot;.equals(record.cityId)">
  244. and city_id = #{record.cityId}
  245. </if>
  246. <if test="record.landmarkId != null and !&quot;&quot;.equals(record.landmarkId)">
  247. and landmark_id = #{record.landmarkId}
  248. </if>
  249. <if test="record.areaId != null and !&quot;&quot;.equals(record.areaId)">
  250. and area_id = #{record.areaId}
  251. </if>
  252. <if test="record.pointName != null and !&quot;&quot;.equals(record.pointName)">
  253. and point_name = #{record.pointName}
  254. </if>
  255. <if test="record.doorFlag != null and !&quot;&quot;.equals(record.doorFlag)">
  256. and door_flag = #{record.doorFlag}
  257. </if>
  258. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  259. and remark = #{record.remark}
  260. </if>
  261. <if test="record.mapX != null and !&quot;&quot;.equals(record.mapX)">
  262. and map_x = #{record.mapX}
  263. </if>
  264. <if test="record.mapY != null and !&quot;&quot;.equals(record.mapY)">
  265. and map_y = #{record.mapY}
  266. </if>
  267. <if test="record.mapIndex != null and !&quot;&quot;.equals(record.mapIndex)">
  268. and map_index = #{record.mapIndex}
  269. </if>
  270. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  271. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  272. OR city_id LIKE concat('%',#{record.searchKey},'%')
  273. OR landmark_id LIKE concat('%',#{record.searchKey},'%')
  274. OR area_id LIKE concat('%',#{record.searchKey},'%')
  275. OR point_name LIKE concat('%',#{record.searchKey},'%')
  276. OR door_flag LIKE concat('%',#{record.searchKey},'%')
  277. OR remark LIKE concat('%',#{record.searchKey},'%')
  278. OR map_x LIKE concat('%',#{record.searchKey},'%')
  279. OR map_y LIKE concat('%',#{record.searchKey},'%')
  280. OR map_index LIKE concat('%',#{record.searchKey},'%')
  281. </trim>
  282. </if>
  283. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  284. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  285. <choose>
  286. <when test="item.indexOf('like') != -1">
  287. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  288. <if test="detailIndex == 3">
  289. concat('%',#{itemDetail},'%')
  290. </if>
  291. <if test="detailIndex &lt; 3">
  292. ${itemDetail}
  293. </if>
  294. </foreach>
  295. </when>
  296. <otherwise>
  297. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  298. <if test="detailIndex == 3">
  299. #{itemDetail}
  300. </if>
  301. <if test="detailIndex &lt; 3">
  302. ${itemDetail}
  303. </if>
  304. </foreach>
  305. </otherwise>
  306. </choose>
  307. </foreach>
  308. </if>
  309. </where>
  310. order by
  311. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  312. <trim suffixOverrides=",">
  313. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  314. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  315. ${itemDetail}
  316. </foreach>
  317. </foreach>
  318. </trim>
  319. ,
  320. </if>
  321. id desc
  322. </select>
  323. <select id="queryAllAreaShowPoint" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.AreaShowPoint">
  324. select <include refid="Base_Column_List"/> from area_show_point
  325. <where>
  326. and del_flag = 'N'
  327. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  328. and id in (${idStr})
  329. </if>
  330. <if test="id != null and !&quot;&quot;.equals(id)">
  331. and id = #{id}
  332. </if>
  333. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  334. and del_flag = #{delFlag}
  335. </if>
  336. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  337. and update_time = #{updateTime}
  338. </if>
  339. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  340. and update_user = #{updateUser}
  341. </if>
  342. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  343. and create_time = #{createTime}
  344. </if>
  345. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  346. and create_user = #{createUser}
  347. </if>
  348. <if test="power != null and !&quot;&quot;.equals(power)">
  349. and power = #{power}
  350. </if>
  351. <if test="cityId != null and !&quot;&quot;.equals(cityId)">
  352. and city_id = #{cityId}
  353. </if>
  354. <if test="landmarkId != null and !&quot;&quot;.equals(landmarkId)">
  355. and landmark_id = #{landmarkId}
  356. </if>
  357. <if test="areaId != null and !&quot;&quot;.equals(areaId)">
  358. and area_id = #{areaId}
  359. </if>
  360. <if test="pointName != null and !&quot;&quot;.equals(pointName)">
  361. and point_name = #{pointName}
  362. </if>
  363. <if test="doorFlag != null and !&quot;&quot;.equals(doorFlag)">
  364. and door_flag = #{doorFlag}
  365. </if>
  366. <if test="remark != null and !&quot;&quot;.equals(remark)">
  367. and remark = #{remark}
  368. </if>
  369. <if test="mapX != null and !&quot;&quot;.equals(mapX)">
  370. and map_x = #{mapX}
  371. </if>
  372. <if test="mapY != null and !&quot;&quot;.equals(mapY)">
  373. and map_y = #{mapY}
  374. </if>
  375. <if test="mapIndex != null and !&quot;&quot;.equals(mapIndex)">
  376. and map_index = #{mapIndex}
  377. </if>
  378. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  379. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  380. OR city_id LIKE concat('%',#{searchKey},'%')
  381. OR landmark_id LIKE concat('%',#{searchKey},'%')
  382. OR area_id LIKE concat('%',#{searchKey},'%')
  383. OR point_name LIKE concat('%',#{searchKey},'%')
  384. OR door_flag LIKE concat('%',#{searchKey},'%')
  385. OR remark LIKE concat('%',#{searchKey},'%')
  386. OR map_x LIKE concat('%',#{searchKey},'%')
  387. OR map_y LIKE concat('%',#{searchKey},'%')
  388. OR map_index LIKE concat('%',#{searchKey},'%')
  389. </trim>
  390. </if>
  391. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  392. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  393. <choose>
  394. <when test="item.indexOf('like') != -1">
  395. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  396. <if test="detailIndex == 3">
  397. concat('%',#{itemDetail},'%')
  398. </if>
  399. <if test="detailIndex &lt; 3">
  400. ${itemDetail}
  401. </if>
  402. </foreach>
  403. </when>
  404. <otherwise>
  405. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  406. <if test="detailIndex == 3">
  407. #{itemDetail}
  408. </if>
  409. <if test="detailIndex &lt; 3">
  410. ${itemDetail}
  411. </if>
  412. </foreach>
  413. </otherwise>
  414. </choose>
  415. </foreach>
  416. </if>
  417. </where>
  418. order by
  419. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  420. <trim suffixOverrides=",">
  421. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  422. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  423. ${itemDetail}
  424. </foreach>
  425. </foreach>
  426. </trim>
  427. ,
  428. </if>
  429. id desc
  430. </select>
  431. <select id="queryAreaShowPoint" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.AreaShowPoint">
  432. select <include refid="Base_Column_List"/> from area_show_point
  433. <where>
  434. and del_flag = 'N'
  435. <if test="id != null and !&quot;&quot;.equals(id)">
  436. and id = #{id}
  437. </if>
  438. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  439. and del_flag = #{delFlag}
  440. </if>
  441. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  442. and update_time = #{updateTime}
  443. </if>
  444. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  445. and update_user = #{updateUser}
  446. </if>
  447. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  448. and create_time = #{createTime}
  449. </if>
  450. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  451. and create_user = #{createUser}
  452. </if>
  453. <if test="power != null and !&quot;&quot;.equals(power)">
  454. and power = #{power}
  455. </if>
  456. <if test="cityId != null and !&quot;&quot;.equals(cityId)">
  457. and city_id = #{cityId}
  458. </if>
  459. <if test="landmarkId != null and !&quot;&quot;.equals(landmarkId)">
  460. and landmark_id = #{landmarkId}
  461. </if>
  462. <if test="areaId != null and !&quot;&quot;.equals(areaId)">
  463. and area_id = #{areaId}
  464. </if>
  465. <if test="pointName != null and !&quot;&quot;.equals(pointName)">
  466. and point_name = #{pointName}
  467. </if>
  468. <if test="doorFlag != null and !&quot;&quot;.equals(doorFlag)">
  469. and door_flag = #{doorFlag}
  470. </if>
  471. <if test="remark != null and !&quot;&quot;.equals(remark)">
  472. and remark = #{remark}
  473. </if>
  474. <if test="mapX != null and !&quot;&quot;.equals(mapX)">
  475. and map_x = #{mapX}
  476. </if>
  477. <if test="mapY != null and !&quot;&quot;.equals(mapY)">
  478. and map_y = #{mapY}
  479. </if>
  480. <if test="mapIndex != null and !&quot;&quot;.equals(mapIndex)">
  481. and map_index = #{mapIndex}
  482. </if>
  483. </where>
  484. LIMIT 1
  485. </select>
  486. <update id="delete">
  487. UPDATE area_show_point SET del_flag = 'Y'
  488. where
  489. <if test="id != null and !&quot;&quot;.equals(id)">
  490. id = #{id,jdbcType=INTEGER}
  491. </if>
  492. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  493. id in (${idStr})
  494. </if>
  495. </update>
  496. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.AreaShowPoint">
  497. select <include refid="Base_Column_List"/> from area_show_point
  498. <where>
  499. and del_flag = 'N'
  500. </where>
  501. order by id desc
  502. </select>
  503. </mapper>