MenuMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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.xmnk.springbootbase.dao.MenuMapper" >
  4. <resultMap id="BaseResultMap" type="com.xmnk.springbootbase.entity.Menu" >
  5. <!--
  6. WARNING - @mbg.generated
  7. -->
  8. <id column="menu_id" property="menuId" jdbcType="INTEGER" />
  9. <result column="menu_name" property="menuName" jdbcType="VARCHAR" />
  10. <result column="parent_id" property="parentId" jdbcType="INTEGER" />
  11. <result column="order_num" property="orderNum" jdbcType="INTEGER" />
  12. <result column="path" property="path" jdbcType="VARCHAR" />
  13. <result column="component" property="component" jdbcType="VARCHAR" />
  14. <result column="query" property="query" jdbcType="VARCHAR" />
  15. <result column="is_frame" property="isFrame" jdbcType="INTEGER" />
  16. <result column="is_cache" property="isCache" jdbcType="INTEGER" />
  17. <result column="menu_type" property="menuType" jdbcType="CHAR" />
  18. <result column="visible" property="visible" jdbcType="CHAR" />
  19. <result column="status" property="status" jdbcType="CHAR" />
  20. <result column="perms" property="perms" jdbcType="VARCHAR" />
  21. <result column="icon" property="icon" jdbcType="VARCHAR" />
  22. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
  23. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  24. <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
  25. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  26. <result column="remark" property="remark" jdbcType="VARCHAR" />
  27. </resultMap>
  28. <sql id="Example_Where_Clause" >
  29. <!--
  30. WARNING - @mbg.generated
  31. -->
  32. <where >
  33. <foreach collection="oredCriteria" item="criteria" separator="or" >
  34. <if test="criteria.valid" >
  35. <trim prefix="(" suffix=")" prefixOverrides="and" >
  36. <foreach collection="criteria.criteria" item="criterion" >
  37. <choose >
  38. <when test="criterion.noValue" >
  39. and ${criterion.condition}
  40. </when>
  41. <when test="criterion.singleValue" >
  42. and ${criterion.condition} #{criterion.value}
  43. </when>
  44. <when test="criterion.betweenValue" >
  45. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  46. </when>
  47. <when test="criterion.listValue" >
  48. and ${criterion.condition}
  49. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  50. #{listItem}
  51. </foreach>
  52. </when>
  53. </choose>
  54. </foreach>
  55. </trim>
  56. </if>
  57. </foreach>
  58. </where>
  59. </sql>
  60. <sql id="Update_By_Example_Where_Clause" >
  61. <!--
  62. WARNING - @mbg.generated
  63. -->
  64. <where >
  65. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  66. <if test="criteria.valid" >
  67. <trim prefix="(" suffix=")" prefixOverrides="and" >
  68. <foreach collection="criteria.criteria" item="criterion" >
  69. <choose >
  70. <when test="criterion.noValue" >
  71. and ${criterion.condition}
  72. </when>
  73. <when test="criterion.singleValue" >
  74. and ${criterion.condition} #{criterion.value}
  75. </when>
  76. <when test="criterion.betweenValue" >
  77. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  78. </when>
  79. <when test="criterion.listValue" >
  80. and ${criterion.condition}
  81. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  82. #{listItem}
  83. </foreach>
  84. </when>
  85. </choose>
  86. </foreach>
  87. </trim>
  88. </if>
  89. </foreach>
  90. </where>
  91. </sql>
  92. <sql id="Base_Column_List" >
  93. <!--
  94. WARNING - @mbg.generated
  95. -->
  96. menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache,
  97. menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time,
  98. remark
  99. </sql>
  100. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmnk.springbootbase.entity.MenuExample" >
  101. <!--
  102. WARNING - @mbg.generated
  103. -->
  104. select
  105. <if test="distinct" >
  106. distinct
  107. </if>
  108. 'true' as QUERYID,
  109. <include refid="Base_Column_List" />
  110. from sys_menu
  111. <if test="_parameter != null" >
  112. <include refid="Example_Where_Clause" />
  113. </if>
  114. <if test="orderByClause != null" >
  115. order by ${orderByClause}
  116. </if>
  117. </select>
  118. <delete id="deleteByExample" parameterType="com.xmnk.springbootbase.entity.MenuExample" >
  119. <!--
  120. WARNING - @mbg.generated
  121. -->
  122. delete from sys_menu
  123. <if test="_parameter != null" >
  124. <include refid="Example_Where_Clause" />
  125. </if>
  126. </delete>
  127. <select id="countByExample" parameterType="com.xmnk.springbootbase.entity.MenuExample" resultType="java.lang.Integer" >
  128. <!--
  129. WARNING - @mbg.generated
  130. -->
  131. select count(*) from sys_menu
  132. <if test="_parameter != null" >
  133. <include refid="Example_Where_Clause" />
  134. </if>
  135. </select>
  136. <update id="updateByExampleSelective" parameterType="map" >
  137. <!--
  138. WARNING - @mbg.generated
  139. -->
  140. update sys_menu
  141. <set >
  142. <if test="record.menuId != null" >
  143. menu_id = #{record.menuId,jdbcType=INTEGER},
  144. </if>
  145. <if test="record.menuName != null" >
  146. menu_name = #{record.menuName,jdbcType=VARCHAR},
  147. </if>
  148. <if test="record.parentId != null" >
  149. parent_id = #{record.parentId,jdbcType=INTEGER},
  150. </if>
  151. <if test="record.orderNum != null" >
  152. order_num = #{record.orderNum,jdbcType=INTEGER},
  153. </if>
  154. <if test="record.path != null" >
  155. path = #{record.path,jdbcType=VARCHAR},
  156. </if>
  157. <if test="record.component != null" >
  158. component = #{record.component,jdbcType=VARCHAR},
  159. </if>
  160. <if test="record.query != null" >
  161. query = #{record.query,jdbcType=VARCHAR},
  162. </if>
  163. <if test="record.isFrame != null" >
  164. is_frame = #{record.isFrame,jdbcType=INTEGER},
  165. </if>
  166. <if test="record.isCache != null" >
  167. is_cache = #{record.isCache,jdbcType=INTEGER},
  168. </if>
  169. <if test="record.menuType != null" >
  170. menu_type = #{record.menuType,jdbcType=CHAR},
  171. </if>
  172. <if test="record.visible != null" >
  173. visible = #{record.visible,jdbcType=CHAR},
  174. </if>
  175. <if test="record.status != null" >
  176. status = #{record.status,jdbcType=CHAR},
  177. </if>
  178. <if test="record.perms != null" >
  179. perms = #{record.perms,jdbcType=VARCHAR},
  180. </if>
  181. <if test="record.icon != null" >
  182. icon = #{record.icon,jdbcType=VARCHAR},
  183. </if>
  184. <if test="record.createBy != null" >
  185. create_by = #{record.createBy,jdbcType=VARCHAR},
  186. </if>
  187. <if test="record.createTime != null" >
  188. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  189. </if>
  190. <if test="record.updateBy != null" >
  191. update_by = #{record.updateBy,jdbcType=VARCHAR},
  192. </if>
  193. <if test="record.updateTime != null" >
  194. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="record.remark != null" >
  197. remark = #{record.remark,jdbcType=VARCHAR},
  198. </if>
  199. </set>
  200. <if test="_parameter != null" >
  201. <include refid="Update_By_Example_Where_Clause" />
  202. </if>
  203. </update>
  204. <update id="updateByExample" parameterType="map" >
  205. <!--
  206. WARNING - @mbg.generated
  207. -->
  208. update sys_menu
  209. set menu_id = #{record.menuId,jdbcType=INTEGER},
  210. menu_name = #{record.menuName,jdbcType=VARCHAR},
  211. parent_id = #{record.parentId,jdbcType=INTEGER},
  212. order_num = #{record.orderNum,jdbcType=INTEGER},
  213. path = #{record.path,jdbcType=VARCHAR},
  214. component = #{record.component,jdbcType=VARCHAR},
  215. query = #{record.query,jdbcType=VARCHAR},
  216. is_frame = #{record.isFrame,jdbcType=INTEGER},
  217. is_cache = #{record.isCache,jdbcType=INTEGER},
  218. menu_type = #{record.menuType,jdbcType=CHAR},
  219. visible = #{record.visible,jdbcType=CHAR},
  220. status = #{record.status,jdbcType=CHAR},
  221. perms = #{record.perms,jdbcType=VARCHAR},
  222. icon = #{record.icon,jdbcType=VARCHAR},
  223. create_by = #{record.createBy,jdbcType=VARCHAR},
  224. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  225. update_by = #{record.updateBy,jdbcType=VARCHAR},
  226. update_time = #{record.updateTime,jdbcType=TIMESTAMP},
  227. remark = #{record.remark,jdbcType=VARCHAR}
  228. <if test="_parameter != null" >
  229. <include refid="Update_By_Example_Where_Clause" />
  230. </if>
  231. </update>
  232. </mapper>