SysMenuMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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.SysMenuMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.SysMenu" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="parent_id" property="parentId" jdbcType="INTEGER" />
  7. <result column="parent_ids" property="parentIds" jdbcType="VARCHAR" />
  8. <result column="name" property="name" jdbcType="VARCHAR" />
  9. <result column="sort" property="sort" jdbcType="DECIMAL" />
  10. <result column="href" property="href" jdbcType="VARCHAR" />
  11. <result column="target" property="target" jdbcType="VARCHAR" />
  12. <result column="icon" property="icon" jdbcType="VARCHAR" />
  13. <result column="is_show" property="isShow" jdbcType="CHAR" />
  14. <result column="permission" property="permission" jdbcType="VARCHAR" />
  15. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
  16. <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
  17. <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
  18. <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
  19. <result column="remarks" property="remarks" jdbcType="VARCHAR" />
  20. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  21. <result column="menu_type" property="menuType" jdbcType="CHAR" />
  22. <result column="can_move" property="canMove" jdbcType="CHAR" />
  23. </resultMap>
  24. <sql id="Base_Column_List" >
  25. id, parent_id, parent_ids, name, sort, href, target, icon, is_show, permission, create_by,
  26. create_date, update_by, update_date, remarks, del_flag, menu_type, can_move,handheld
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from sys_menu
  32. where id = #{id,jdbcType=INTEGER}
  33. </select>
  34. <select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String" >
  35. select
  36. <include refid="Base_Column_List" />
  37. from sys_menu
  38. where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
  39. </select>
  40. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  41. delete from sys_menu
  42. where id = #{id,jdbcType=INTEGER}
  43. </delete>
  44. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" useGeneratedKeys="true" keyProperty="id">
  45. insert into sys_menu
  46. <trim prefix="(" suffix=")" suffixOverrides="," >
  47. <if test="id != null" >
  48. id,
  49. </if>
  50. <if test="parentId != null" >
  51. parent_id,
  52. </if>
  53. <if test="parentIds != null" >
  54. parent_ids,
  55. </if>
  56. <if test="name != null" >
  57. name,
  58. </if>
  59. <if test="sort != null" >
  60. sort,
  61. </if>
  62. <if test="href != null" >
  63. href,
  64. </if>
  65. <if test="target != null" >
  66. target,
  67. </if>
  68. <if test="icon != null" >
  69. icon,
  70. </if>
  71. <if test="isShow != null" >
  72. is_show,
  73. </if>
  74. <if test="permission != null" >
  75. permission,
  76. </if>
  77. <if test="createBy != null" >
  78. create_by,
  79. </if>
  80. <if test="createDate != null" >
  81. create_date,
  82. </if>
  83. <if test="updateBy != null" >
  84. update_by,
  85. </if>
  86. <if test="updateDate != null" >
  87. update_date,
  88. </if>
  89. <if test="remarks != null" >
  90. remarks,
  91. </if>
  92. <if test="delFlag != null" >
  93. del_flag,
  94. </if>
  95. <if test="menuType != null" >
  96. menu_type,
  97. </if>
  98. <if test="handheld != null" >
  99. handheld,
  100. </if>
  101. </trim>
  102. <trim prefix="values (" suffix=")" suffixOverrides="," >
  103. <if test="id != null" >
  104. #{id,jdbcType=INTEGER},
  105. </if>
  106. <if test="parentId != null" >
  107. #{parentId,jdbcType=INTEGER},
  108. </if>
  109. <if test="parentIds != null" >
  110. #{parentIds,jdbcType=VARCHAR},
  111. </if>
  112. <if test="name != null" >
  113. #{name,jdbcType=VARCHAR},
  114. </if>
  115. <if test="sort != null" >
  116. #{sort,jdbcType=DECIMAL},
  117. </if>
  118. <if test="href != null" >
  119. #{href,jdbcType=VARCHAR},
  120. </if>
  121. <if test="target != null" >
  122. #{target,jdbcType=VARCHAR},
  123. </if>
  124. <if test="icon != null" >
  125. #{icon,jdbcType=VARCHAR},
  126. </if>
  127. <if test="isShow != null" >
  128. #{isShow,jdbcType=CHAR},
  129. </if>
  130. <if test="permission != null" >
  131. #{permission,jdbcType=VARCHAR},
  132. </if>
  133. <if test="createBy != null" >
  134. #{createBy,jdbcType=VARCHAR},
  135. </if>
  136. <if test="createDate != null" >
  137. #{createDate,jdbcType=TIMESTAMP},
  138. </if>
  139. <if test="updateBy != null" >
  140. #{updateBy,jdbcType=VARCHAR},
  141. </if>
  142. <if test="updateDate != null" >
  143. #{updateDate,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="remarks != null" >
  146. #{remarks,jdbcType=VARCHAR},
  147. </if>
  148. <if test="delFlag != null" >
  149. #{delFlag,jdbcType=CHAR},
  150. </if>
  151. <if test="menuType != null" >
  152. #{menuType,jdbcType=CHAR},
  153. </if>
  154. <if test="handheld != null" >
  155. #{handheld,jdbcType=CHAR},
  156. </if>
  157. </trim>
  158. </insert>
  159. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" >
  160. update sys_menu
  161. <set >
  162. <if test="parentId != null" >
  163. parent_id = #{parentId,jdbcType=INTEGER},
  164. </if>
  165. <if test="parentIds != null" >
  166. parent_ids = #{parentIds,jdbcType=VARCHAR},
  167. </if>
  168. <if test="name != null" >
  169. name = #{name,jdbcType=VARCHAR},
  170. </if>
  171. <if test="sort != null" >
  172. sort = #{sort,jdbcType=DECIMAL},
  173. </if>
  174. <if test="href != null" >
  175. href = #{href,jdbcType=VARCHAR},
  176. </if>
  177. <if test="target != null" >
  178. target = #{target,jdbcType=VARCHAR},
  179. </if>
  180. <if test="icon != null" >
  181. icon = #{icon,jdbcType=VARCHAR},
  182. </if>
  183. <if test="isShow != null" >
  184. is_show = #{isShow,jdbcType=CHAR},
  185. </if>
  186. <if test="permission != null" >
  187. permission = #{permission,jdbcType=VARCHAR},
  188. </if>
  189. <if test="createBy != null" >
  190. create_by = #{createBy,jdbcType=VARCHAR},
  191. </if>
  192. <if test="createDate != null" >
  193. create_date = #{createDate,jdbcType=TIMESTAMP},
  194. </if>
  195. <if test="updateBy != null" >
  196. update_by = #{updateBy,jdbcType=VARCHAR},
  197. </if>
  198. <if test="updateDate != null" >
  199. update_date = #{updateDate,jdbcType=TIMESTAMP},
  200. </if>
  201. <if test="remarks != null" >
  202. remarks = #{remarks,jdbcType=VARCHAR},
  203. </if>
  204. <if test="delFlag != null" >
  205. del_flag = #{delFlag,jdbcType=CHAR},
  206. </if>
  207. <if test="menuType != null" >
  208. menu_type = #{menuType,jdbcType=CHAR},
  209. </if>
  210. <if test="handheld != null" >
  211. handheld = #{handheld,jdbcType=CHAR},
  212. </if>
  213. </set>
  214. where id = #{id,jdbcType=INTEGER}
  215. </update>
  216. <select id="querySysMenusByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
  217. select <include refid="Base_Column_List"/> from sys_menu
  218. <where>
  219. and del_flag = 'N'
  220. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  221. and id = #{record.id}
  222. </if>
  223. <if test="record.parentId != null and !&quot;&quot;.equals(record.parentId)">
  224. and parent_id = #{record.parentId}
  225. </if>
  226. <if test="record.parentIds != null and !&quot;&quot;.equals(record.parentIds)">
  227. and parent_ids = #{record.parentIds}
  228. </if>
  229. <if test="record.name != null and !&quot;&quot;.equals(record.name)">
  230. and name = #{record.name}
  231. </if>
  232. <if test="record.sort != null and !&quot;&quot;.equals(record.sort)">
  233. and sort = #{record.sort}
  234. </if>
  235. <if test="record.href != null and !&quot;&quot;.equals(record.href)">
  236. and href = #{record.href}
  237. </if>
  238. <if test="record.target != null and !&quot;&quot;.equals(record.target)">
  239. and target = #{record.target}
  240. </if>
  241. <if test="record.icon != null and !&quot;&quot;.equals(record.icon)">
  242. and icon = #{record.icon}
  243. </if>
  244. <if test="record.isShow != null and !&quot;&quot;.equals(record.isShow)">
  245. and is_show = #{record.isShow}
  246. </if>
  247. <if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
  248. and permission = #{record.permission}
  249. </if>
  250. <if test="record.createBy != null and !&quot;&quot;.equals(record.createBy)">
  251. and create_by = #{record.createBy}
  252. </if>
  253. <if test="record.createDate != null and !&quot;&quot;.equals(record.createDate)">
  254. and create_date = #{record.createDate}
  255. </if>
  256. <if test="record.updateBy != null and !&quot;&quot;.equals(record.updateBy)">
  257. and update_by = #{record.updateBy}
  258. </if>
  259. <if test="record.updateDate != null and !&quot;&quot;.equals(record.updateDate)">
  260. and update_date = #{record.updateDate}
  261. </if>
  262. <if test="record.remarks != null and !&quot;&quot;.equals(record.remarks)">
  263. and remarks = #{record.remarks}
  264. </if>
  265. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  266. and del_flag = #{record.delFlag}
  267. </if>
  268. <if test="record.menuType != null and !&quot;&quot;.equals(record.menuType)">
  269. and menu_type = #{record.menuType}
  270. </if>
  271. <if test="record.handheld != null and !&quot;&quot;.equals(record.handheld)">
  272. and handheld = #{record.handheld}
  273. </if>
  274. </where>
  275. order by id desc
  276. </select>
  277. <select id="queryAllSysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
  278. select <include refid="Base_Column_List"/> from sys_menu
  279. <where>
  280. and del_flag = 'N'
  281. <if test="id != null and !&quot;&quot;.equals(id)">
  282. and id = #{id}
  283. </if>
  284. <if test="parentId != null and !&quot;&quot;.equals(parentId)">
  285. and parent_id = #{parentId}
  286. </if>
  287. <if test="parentIds != null and !&quot;&quot;.equals(parentIds)">
  288. and parent_ids = #{parentIds}
  289. </if>
  290. <if test="name != null and !&quot;&quot;.equals(name)">
  291. and name = #{name}
  292. </if>
  293. <if test="sort != null and !&quot;&quot;.equals(sort)">
  294. and sort = #{sort}
  295. </if>
  296. <if test="href != null and !&quot;&quot;.equals(href)">
  297. and href = #{href}
  298. </if>
  299. <if test="target != null and !&quot;&quot;.equals(target)">
  300. and target = #{target}
  301. </if>
  302. <if test="icon != null and !&quot;&quot;.equals(icon)">
  303. and icon = #{icon}
  304. </if>
  305. <if test="isShow != null and !&quot;&quot;.equals(isShow)">
  306. and is_show = #{isShow}
  307. </if>
  308. <if test="permission != null and !&quot;&quot;.equals(permission)">
  309. and permission = #{permission}
  310. </if>
  311. <if test="createBy != null and !&quot;&quot;.equals(createBy)">
  312. and create_by = #{createBy}
  313. </if>
  314. <if test="createDate != null and !&quot;&quot;.equals(createDate)">
  315. and create_date = #{createDate}
  316. </if>
  317. <if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
  318. and update_by = #{updateBy}
  319. </if>
  320. <if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
  321. and update_date = #{updateDate}
  322. </if>
  323. <if test="remarks != null and !&quot;&quot;.equals(remarks)">
  324. and remarks = #{remarks}
  325. </if>
  326. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  327. and del_flag = #{delFlag}
  328. </if>
  329. <if test="menuType != null and !&quot;&quot;.equals(menuType)">
  330. and menu_type = #{menuType}
  331. </if>
  332. <if test="handheld != null and !&quot;&quot;.equals(handheld)">
  333. and handheld = #{handheld}
  334. </if>
  335. </where>
  336. order by id desc
  337. </select>
  338. <select id="querySysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
  339. select <include refid="Base_Column_List"/> from sys_menu
  340. <where>
  341. and del_flag = 'N'
  342. <if test="id != null and !&quot;&quot;.equals(id)">
  343. and id = #{id}
  344. </if>
  345. <if test="parentId != null and !&quot;&quot;.equals(parentId)">
  346. and parent_id = #{parentId}
  347. </if>
  348. <if test="parentIds != null and !&quot;&quot;.equals(parentIds)">
  349. and parent_ids = #{parentIds}
  350. </if>
  351. <if test="name != null and !&quot;&quot;.equals(name)">
  352. and name = #{name}
  353. </if>
  354. <if test="sort != null and !&quot;&quot;.equals(sort)">
  355. and sort = #{sort}
  356. </if>
  357. <if test="href != null and !&quot;&quot;.equals(href)">
  358. and href = #{href}
  359. </if>
  360. <if test="target != null and !&quot;&quot;.equals(target)">
  361. and target = #{target}
  362. </if>
  363. <if test="icon != null and !&quot;&quot;.equals(icon)">
  364. and icon = #{icon}
  365. </if>
  366. <if test="isShow != null and !&quot;&quot;.equals(isShow)">
  367. and is_show = #{isShow}
  368. </if>
  369. <if test="permission != null and !&quot;&quot;.equals(permission)">
  370. and permission = #{permission}
  371. </if>
  372. <if test="createBy != null and !&quot;&quot;.equals(createBy)">
  373. and create_by = #{createBy}
  374. </if>
  375. <if test="createDate != null and !&quot;&quot;.equals(createDate)">
  376. and create_date = #{createDate}
  377. </if>
  378. <if test="updateBy != null and !&quot;&quot;.equals(updateBy)">
  379. and update_by = #{updateBy}
  380. </if>
  381. <if test="updateDate != null and !&quot;&quot;.equals(updateDate)">
  382. and update_date = #{updateDate}
  383. </if>
  384. <if test="remarks != null and !&quot;&quot;.equals(remarks)">
  385. and remarks = #{remarks}
  386. </if>
  387. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  388. and del_flag = #{delFlag}
  389. </if>
  390. <if test="menuType != null and !&quot;&quot;.equals(menuType)">
  391. and menu_type = #{menuType}
  392. </if>
  393. <if test="handheld != null and !&quot;&quot;.equals(handheld)">
  394. and handheld = #{handheld}
  395. </if>
  396. </where>
  397. LIMIT 1
  398. </select>
  399. <update id="delete">
  400. UPDATE sys_menu SET del_flag = 'Y'
  401. <where>
  402. AND id = #{id}
  403. </where>
  404. </update>
  405. </mapper>