LandMarkLevelMapper.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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.LandMarkLevelMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.LandMarkLevel" >
  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="name" property="name" jdbcType="VARCHAR" />
  12. <result column="owned_city_id" property="ownedCityId" jdbcType="VARCHAR" />
  13. <result column="front_level_id" property="frontLevelId" jdbcType="VARCHAR" />
  14. <result column="land_mark_id" property="landMarkId" jdbcType="VARCHAR" />
  15. <result column="top_level" property="topLevel" jdbcType="VARCHAR" />
  16. <result column="longitude" property="longitude" jdbcType="VARCHAR" />
  17. <result column="latitude" property="latitude" jdbcType="VARCHAR" />
  18. <result column="remark1" property="remark1" jdbcType="VARCHAR" />
  19. <result column="remark2" property="remark2" jdbcType="VARCHAR" />
  20. <result column="remark3" property="remark3" 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. name,
  31. owned_city_id,
  32. front_level_id,
  33. land_mark_id,
  34. top_level,
  35. longitude,
  36. latitude,
  37. remark1,
  38. remark2,
  39. remark3,
  40. </trim>
  41. </sql>
  42. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  43. select
  44. <include refid="Base_Column_List" />
  45. from land_mark_level
  46. where id = #{id,jdbcType=INTEGER}
  47. </select>
  48. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  49. delete from land_mark_level
  50. where id = #{id,jdbcType=INTEGER}
  51. </delete>
  52. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.LandMarkLevel" useGeneratedKeys="true" keyProperty="id">
  53. insert into land_mark_level
  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="name!= null" >
  74. name,
  75. </if>
  76. <if test="ownedCityId!= null" >
  77. owned_city_id,
  78. </if>
  79. <if test="frontLevelId!= null" >
  80. front_level_id,
  81. </if>
  82. <if test="landMarkId!= null" >
  83. land_mark_id,
  84. </if>
  85. <if test="topLevel!= null" >
  86. top_level,
  87. </if>
  88. <if test="longitude!= null" >
  89. longitude,
  90. </if>
  91. <if test="latitude!= null" >
  92. latitude,
  93. </if>
  94. <if test="remark1!= null" >
  95. remark1,
  96. </if>
  97. <if test="remark2!= null" >
  98. remark2,
  99. </if>
  100. <if test="remark3!= null" >
  101. remark3,
  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="name != null" >
  124. #{name,jdbcType=VARCHAR},
  125. </if>
  126. <if test="ownedCityId != null" >
  127. #{ownedCityId,jdbcType=VARCHAR},
  128. </if>
  129. <if test="frontLevelId != null" >
  130. #{frontLevelId,jdbcType=VARCHAR},
  131. </if>
  132. <if test="landMarkId != null" >
  133. #{landMarkId,jdbcType=VARCHAR},
  134. </if>
  135. <if test="topLevel != null" >
  136. #{topLevel,jdbcType=VARCHAR},
  137. </if>
  138. <if test="longitude != null" >
  139. #{longitude,jdbcType=VARCHAR},
  140. </if>
  141. <if test="latitude != null" >
  142. #{latitude,jdbcType=VARCHAR},
  143. </if>
  144. <if test="remark1 != null" >
  145. #{remark1,jdbcType=VARCHAR},
  146. </if>
  147. <if test="remark2 != null" >
  148. #{remark2,jdbcType=VARCHAR},
  149. </if>
  150. <if test="remark3 != null" >
  151. #{remark3,jdbcType=VARCHAR},
  152. </if>
  153. </trim>
  154. </insert>
  155. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.LandMarkLevel" >
  156. update land_mark_level
  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="name != null" >
  177. name= #{name,jdbcType=VARCHAR},
  178. </if>
  179. <if test="ownedCityId != null" >
  180. owned_city_id= #{ownedCityId,jdbcType=VARCHAR},
  181. </if>
  182. <if test="frontLevelId != null" >
  183. front_level_id= #{frontLevelId,jdbcType=VARCHAR},
  184. </if>
  185. <if test="landMarkId != null" >
  186. land_mark_id= #{landMarkId,jdbcType=VARCHAR},
  187. </if>
  188. <if test="topLevel != null" >
  189. top_level= #{topLevel,jdbcType=VARCHAR},
  190. </if>
  191. <if test="longitude != null" >
  192. longitude= #{longitude,jdbcType=VARCHAR},
  193. </if>
  194. <if test="latitude != null" >
  195. latitude= #{latitude,jdbcType=VARCHAR},
  196. </if>
  197. <if test="remark1 != null" >
  198. remark1= #{remark1,jdbcType=VARCHAR},
  199. </if>
  200. <if test="remark2 != null" >
  201. remark2= #{remark2,jdbcType=VARCHAR},
  202. </if>
  203. <if test="remark3 != null" >
  204. remark3= #{remark3,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="queryLandMarkLevelByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.LandMarkLevel">
  216. select <include refid="Base_Column_List"/> from land_mark_level
  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.name != null and !&quot;&quot;.equals(record.name)">
  241. and name = #{record.name}
  242. </if>
  243. <if test="record.ownedCityId != null and !&quot;&quot;.equals(record.ownedCityId)">
  244. and owned_city_id = #{record.ownedCityId}
  245. </if>
  246. <if test="record.frontLevelId != null and !&quot;&quot;.equals(record.frontLevelId)">
  247. and front_level_id = #{record.frontLevelId}
  248. </if>
  249. <if test="record.landMarkId != null and !&quot;&quot;.equals(record.landMarkId)">
  250. and land_mark_id = #{record.landMarkId}
  251. </if>
  252. <if test="record.topLevel != null and !&quot;&quot;.equals(record.topLevel)">
  253. and top_level = #{record.topLevel}
  254. </if>
  255. <if test="record.longitude != null and !&quot;&quot;.equals(record.longitude)">
  256. and longitude = #{record.longitude}
  257. </if>
  258. <if test="record.latitude != null and !&quot;&quot;.equals(record.latitude)">
  259. and latitude = #{record.latitude}
  260. </if>
  261. <if test="record.remark1 != null and !&quot;&quot;.equals(record.remark1)">
  262. and remark1 = #{record.remark1}
  263. </if>
  264. <if test="record.remark2 != null and !&quot;&quot;.equals(record.remark2)">
  265. and remark2 = #{record.remark2}
  266. </if>
  267. <if test="record.remark3 != null and !&quot;&quot;.equals(record.remark3)">
  268. and remark3 = #{record.remark3}
  269. </if>
  270. <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
  271. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  272. OR name LIKE concat('%',#{record.searchKey},'%')
  273. OR owned_city_id LIKE concat('%',#{record.searchKey},'%')
  274. OR front_level_id LIKE concat('%',#{record.searchKey},'%')
  275. OR land_mark_id LIKE concat('%',#{record.searchKey},'%')
  276. OR top_level LIKE concat('%',#{record.searchKey},'%')
  277. OR longitude LIKE concat('%',#{record.searchKey},'%')
  278. OR latitude LIKE concat('%',#{record.searchKey},'%')
  279. OR remark1 LIKE concat('%',#{record.searchKey},'%')
  280. OR remark2 LIKE concat('%',#{record.searchKey},'%')
  281. OR remark3 LIKE concat('%',#{record.searchKey},'%')
  282. </trim>
  283. </if>
  284. <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
  285. <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
  286. <choose>
  287. <when test="item.indexOf('like') != -1">
  288. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  289. <if test="detailIndex == 3">
  290. concat('%',#{itemDetail},'%')
  291. </if>
  292. <if test="detailIndex &lt; 3">
  293. ${itemDetail}
  294. </if>
  295. </foreach>
  296. </when>
  297. <otherwise>
  298. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  299. <if test="detailIndex == 3">
  300. #{itemDetail}
  301. </if>
  302. <if test="detailIndex &lt; 3">
  303. ${itemDetail}
  304. </if>
  305. </foreach>
  306. </otherwise>
  307. </choose>
  308. </foreach>
  309. </if>
  310. </where>
  311. order by
  312. <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
  313. <trim suffixOverrides=",">
  314. <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
  315. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  316. ${itemDetail}
  317. </foreach>
  318. </foreach>
  319. </trim>
  320. ,
  321. </if>
  322. id desc
  323. </select>
  324. <select id="queryAllLandMarkLevel" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.LandMarkLevel">
  325. select <include refid="Base_Column_List"/> from land_mark_level
  326. <where>
  327. and del_flag = 'N'
  328. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  329. and id in (${idStr})
  330. </if>
  331. <if test="id != null and !&quot;&quot;.equals(id)">
  332. and id = #{id}
  333. </if>
  334. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  335. and del_flag = #{delFlag}
  336. </if>
  337. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  338. and update_time = #{updateTime}
  339. </if>
  340. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  341. and update_user = #{updateUser}
  342. </if>
  343. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  344. and create_time = #{createTime}
  345. </if>
  346. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  347. and create_user = #{createUser}
  348. </if>
  349. <if test="name != null and !&quot;&quot;.equals(name)">
  350. and name = #{name}
  351. </if>
  352. <if test="ownedCityId != null and !&quot;&quot;.equals(ownedCityId)">
  353. and owned_city_id = #{ownedCityId}
  354. </if>
  355. <if test="frontLevelId != null and !&quot;&quot;.equals(frontLevelId)">
  356. and front_level_id = #{frontLevelId}
  357. </if>
  358. <if test="landMarkId != null and !&quot;&quot;.equals(landMarkId)">
  359. and land_mark_id = #{landMarkId}
  360. </if>
  361. <if test="topLevel != null and !&quot;&quot;.equals(topLevel)">
  362. and top_level = #{topLevel}
  363. </if>
  364. <if test="longitude != null and !&quot;&quot;.equals(longitude)">
  365. and longitude = #{longitude}
  366. </if>
  367. <if test="latitude != null and !&quot;&quot;.equals(latitude)">
  368. and latitude = #{latitude}
  369. </if>
  370. <if test="remark1 != null and !&quot;&quot;.equals(remark1)">
  371. and remark1 = #{remark1}
  372. </if>
  373. <if test="remark2 != null and !&quot;&quot;.equals(remark2)">
  374. and remark2 = #{remark2}
  375. </if>
  376. <if test="remark3 != null and !&quot;&quot;.equals(remark3)">
  377. and remark3 = #{remark3}
  378. </if>
  379. <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
  380. <trim prefix="and (" suffix=")" prefixOverrides="OR" >
  381. OR name LIKE concat('%',#{searchKey},'%')
  382. OR owned_city_id LIKE concat('%',#{searchKey},'%')
  383. OR front_level_id LIKE concat('%',#{searchKey},'%')
  384. OR land_mark_id LIKE concat('%',#{searchKey},'%')
  385. OR top_level LIKE concat('%',#{searchKey},'%')
  386. OR longitude LIKE concat('%',#{searchKey},'%')
  387. OR latitude LIKE concat('%',#{searchKey},'%')
  388. OR remark1 LIKE concat('%',#{searchKey},'%')
  389. OR remark2 LIKE concat('%',#{searchKey},'%')
  390. OR remark3 LIKE concat('%',#{searchKey},'%')
  391. </trim>
  392. </if>
  393. <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
  394. <foreach item="item" index="index" collection="advancedQuery.split('_;')">
  395. <choose>
  396. <when test="item.indexOf('like') != -1">
  397. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  398. <if test="detailIndex == 3">
  399. concat('%',#{itemDetail},'%')
  400. </if>
  401. <if test="detailIndex &lt; 3">
  402. ${itemDetail}
  403. </if>
  404. </foreach>
  405. </when>
  406. <otherwise>
  407. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  408. <if test="detailIndex == 3">
  409. #{itemDetail}
  410. </if>
  411. <if test="detailIndex &lt; 3">
  412. ${itemDetail}
  413. </if>
  414. </foreach>
  415. </otherwise>
  416. </choose>
  417. </foreach>
  418. </if>
  419. </where>
  420. order by
  421. <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
  422. <trim suffixOverrides=",">
  423. <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
  424. <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
  425. ${itemDetail}
  426. </foreach>
  427. </foreach>
  428. </trim>
  429. ,
  430. </if>
  431. id desc
  432. </select>
  433. <select id="queryLandMarkLevel" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.LandMarkLevel">
  434. select <include refid="Base_Column_List"/> from land_mark_level
  435. <where>
  436. and del_flag = 'N'
  437. <if test="id != null and !&quot;&quot;.equals(id)">
  438. and id = #{id}
  439. </if>
  440. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  441. and del_flag = #{delFlag}
  442. </if>
  443. <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
  444. and update_time = #{updateTime}
  445. </if>
  446. <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
  447. and update_user = #{updateUser}
  448. </if>
  449. <if test="createTime != null and !&quot;&quot;.equals(createTime)">
  450. and create_time = #{createTime}
  451. </if>
  452. <if test="createUser != null and !&quot;&quot;.equals(createUser)">
  453. and create_user = #{createUser}
  454. </if>
  455. <if test="name != null and !&quot;&quot;.equals(name)">
  456. and name = #{name}
  457. </if>
  458. <if test="ownedCityId != null and !&quot;&quot;.equals(ownedCityId)">
  459. and owned_city_id = #{ownedCityId}
  460. </if>
  461. <if test="frontLevelId != null and !&quot;&quot;.equals(frontLevelId)">
  462. and front_level_id = #{frontLevelId}
  463. </if>
  464. <if test="landMarkId != null and !&quot;&quot;.equals(landMarkId)">
  465. and land_mark_id = #{landMarkId}
  466. </if>
  467. <if test="topLevel != null and !&quot;&quot;.equals(topLevel)">
  468. and top_level = #{topLevel}
  469. </if>
  470. <if test="longitude != null and !&quot;&quot;.equals(longitude)">
  471. and longitude = #{longitude}
  472. </if>
  473. <if test="latitude != null and !&quot;&quot;.equals(latitude)">
  474. and latitude = #{latitude}
  475. </if>
  476. <if test="remark1 != null and !&quot;&quot;.equals(remark1)">
  477. and remark1 = #{remark1}
  478. </if>
  479. <if test="remark2 != null and !&quot;&quot;.equals(remark2)">
  480. and remark2 = #{remark2}
  481. </if>
  482. <if test="remark3 != null and !&quot;&quot;.equals(remark3)">
  483. and remark3 = #{remark3}
  484. </if>
  485. </where>
  486. LIMIT 1
  487. </select>
  488. <update id="delete">
  489. UPDATE land_mark_level SET del_flag = 'Y'
  490. where
  491. <if test="id != null and !&quot;&quot;.equals(id)">
  492. id = #{id,jdbcType=INTEGER}
  493. </if>
  494. <if test="idStr != null and !&quot;&quot;.equals(idStr)">
  495. id in (${idStr})
  496. </if>
  497. </update>
  498. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.LandMarkLevel">
  499. select <include refid="Base_Column_List"/> from land_mark_level
  500. <where>
  501. and del_flag = 'N'
  502. </where>
  503. order by id desc
  504. </select>
  505. </mapper>