PermissionMapper.xml 7.3 KB

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