TsysPremissionMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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.gyee.frame.mapper.auto.TsysPermissionMapper">
  4. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.TsysPermission">
  5. <constructor>
  6. <idArg column="id" javaType="java.lang.String" jdbcType="VARCHAR" />
  7. <arg column="name" javaType="java.lang.String" jdbcType="VARCHAR" />
  8. <arg column="descripion" javaType="java.lang.String" jdbcType="VARCHAR" />
  9. <arg column="url" javaType="java.lang.String" jdbcType="VARCHAR" />
  10. <arg column="is_blank" javaType="java.lang.Integer" jdbcType="INTEGER" />
  11. <arg column="pid" javaType="java.lang.String" jdbcType="VARCHAR" />
  12. <arg column="perms" javaType="java.lang.String" jdbcType="VARCHAR" />
  13. <arg column="type" javaType="java.lang.Integer" jdbcType="INTEGER" />
  14. <arg column="icon" javaType="java.lang.String" jdbcType="VARCHAR" />
  15. <arg column="order_num" javaType="java.lang.Integer" jdbcType="INTEGER" />
  16. <arg column="visible" javaType="java.lang.Integer" jdbcType="INTEGER" />
  17. <arg column="childcount" javaType="java.lang.Integer" jdbcType="INTEGER"/>
  18. </constructor>
  19. </resultMap>
  20. <sql id="Example_Where_Clause">
  21. <where>
  22. <foreach collection="oredCriteria" item="criteria" separator="or">
  23. <if test="criteria.valid">
  24. <trim prefix="(" prefixOverrides="and" suffix=")">
  25. <foreach collection="criteria.criteria" item="criterion">
  26. <choose>
  27. <when test="criterion.noValue">
  28. and ${criterion.condition}
  29. </when>
  30. <when test="criterion.singleValue">
  31. and ${criterion.condition} #{criterion.value}
  32. </when>
  33. <when test="criterion.betweenValue">
  34. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  35. </when>
  36. <when test="criterion.listValue">
  37. and ${criterion.condition}
  38. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  39. #{listItem}
  40. </foreach>
  41. </when>
  42. </choose>
  43. </foreach>
  44. </trim>
  45. </if>
  46. </foreach>
  47. </where>
  48. </sql>
  49. <sql id="Update_By_Example_Where_Clause">
  50. <where>
  51. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  52. <if test="criteria.valid">
  53. <trim prefix="(" prefixOverrides="and" suffix=")">
  54. <foreach collection="criteria.criteria" item="criterion">
  55. <choose>
  56. <when test="criterion.noValue">
  57. and ${criterion.condition}
  58. </when>
  59. <when test="criterion.singleValue">
  60. and ${criterion.condition} #{criterion.value}
  61. </when>
  62. <when test="criterion.betweenValue">
  63. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  64. </when>
  65. <when test="criterion.listValue">
  66. and ${criterion.condition}
  67. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  68. #{listItem}
  69. </foreach>
  70. </when>
  71. </choose>
  72. </foreach>
  73. </trim>
  74. </if>
  75. </foreach>
  76. </where>
  77. </sql>
  78. <sql id="Base_Column_List">
  79. id, name, descripion, url, is_blank, pid, perms, type, icon, order_num, visible, (select count(1) from t_sys_permission where pid=a.id) childcount
  80. </sql>
  81. <select id="selectByExample" parameterType="com.gyee.frame.model.auto.TsysPermissionExample" resultMap="BaseResultMap">
  82. select
  83. <if test="distinct">
  84. distinct
  85. </if>
  86. <include refid="Base_Column_List" />
  87. from t_sys_permission a
  88. <if test="_parameter != null">
  89. <include refid="Example_Where_Clause" />
  90. </if>
  91. <if test="orderByClause != null">
  92. order by ${orderByClause}
  93. </if>
  94. </select>
  95. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  96. select
  97. <include refid="Base_Column_List" />
  98. from t_sys_permission a
  99. where id = #{id,jdbcType=VARCHAR}
  100. </select>
  101. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  102. delete from t_sys_permission
  103. where id = #{id,jdbcType=VARCHAR}
  104. </delete>
  105. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.TsysPermissionExample">
  106. delete from t_sys_permission
  107. <if test="_parameter != null">
  108. <include refid="Example_Where_Clause" />
  109. </if>
  110. </delete>
  111. <insert id="insert" parameterType="com.gyee.frame.model.auto.TsysPermission">
  112. insert into t_sys_permission (id, name, descripion,
  113. url, is_blank, pid,
  114. perms, type, icon,
  115. order_num, visible)
  116. values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{descripion,jdbcType=VARCHAR},
  117. #{url,jdbcType=VARCHAR}, #{isBlank,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR},
  118. #{perms,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR},
  119. #{orderNum,jdbcType=INTEGER}, #{visible,jdbcType=INTEGER})
  120. </insert>
  121. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.TsysPermission">
  122. insert into t_sys_permission
  123. <trim prefix="(" suffix=")" suffixOverrides=",">
  124. <if test="id != null">
  125. id,
  126. </if>
  127. <if test="name != null">
  128. name,
  129. </if>
  130. <if test="descripion != null">
  131. descripion,
  132. </if>
  133. <if test="url != null">
  134. url,
  135. </if>
  136. <if test="isBlank != null">
  137. is_blank,
  138. </if>
  139. <if test="pid != null">
  140. pid,
  141. </if>
  142. <if test="perms != null">
  143. perms,
  144. </if>
  145. <if test="type != null">
  146. type,
  147. </if>
  148. <if test="icon != null">
  149. icon,
  150. </if>
  151. <if test="orderNum != null">
  152. order_num,
  153. </if>
  154. <if test="visible != null">
  155. visible,
  156. </if>
  157. </trim>
  158. <trim prefix="values (" suffix=")" suffixOverrides=",">
  159. <if test="id != null">
  160. #{id,jdbcType=VARCHAR},
  161. </if>
  162. <if test="name != null">
  163. #{name,jdbcType=VARCHAR},
  164. </if>
  165. <if test="descripion != null">
  166. #{descripion,jdbcType=VARCHAR},
  167. </if>
  168. <if test="url != null">
  169. #{url,jdbcType=VARCHAR},
  170. </if>
  171. <if test="isBlank != null">
  172. #{isBlank,jdbcType=INTEGER},
  173. </if>
  174. <if test="pid != null">
  175. #{pid,jdbcType=VARCHAR},
  176. </if>
  177. <if test="perms != null">
  178. #{perms,jdbcType=VARCHAR},
  179. </if>
  180. <if test="type != null">
  181. #{type,jdbcType=INTEGER},
  182. </if>
  183. <if test="icon != null">
  184. #{icon,jdbcType=VARCHAR},
  185. </if>
  186. <if test="orderNum != null">
  187. #{orderNum,jdbcType=INTEGER},
  188. </if>
  189. <if test="visible != null">
  190. #{visible,jdbcType=INTEGER},
  191. </if>
  192. </trim>
  193. </insert>
  194. <select id="countByExample" parameterType="com.gyee.frame.model.auto.TsysPermissionExample" resultType="java.lang.Long">
  195. select count(*) from t_sys_permission a
  196. <if test="_parameter != null">
  197. <include refid="Example_Where_Clause" />
  198. </if>
  199. </select>
  200. <update id="updateByExampleSelective" parameterType="map">
  201. update t_sys_permission
  202. <set>
  203. <if test="record.id != null">
  204. id = #{record.id,jdbcType=VARCHAR},
  205. </if>
  206. <if test="record.name != null">
  207. name = #{record.name,jdbcType=VARCHAR},
  208. </if>
  209. <if test="record.descripion != null">
  210. descripion = #{record.descripion,jdbcType=VARCHAR},
  211. </if>
  212. <if test="record.url != null">
  213. url = #{record.url,jdbcType=VARCHAR},
  214. </if>
  215. <if test="record.isBlank != null">
  216. is_blank = #{record.isBlank,jdbcType=INTEGER},
  217. </if>
  218. <if test="record.pid != null">
  219. pid = #{record.pid,jdbcType=VARCHAR},
  220. </if>
  221. <if test="record.perms != null">
  222. perms = #{record.perms,jdbcType=VARCHAR},
  223. </if>
  224. <if test="record.type != null">
  225. type = #{record.type,jdbcType=INTEGER},
  226. </if>
  227. <if test="record.icon != null">
  228. icon = #{record.icon,jdbcType=VARCHAR},
  229. </if>
  230. <if test="record.orderNum != null">
  231. order_num = #{record.orderNum,jdbcType=INTEGER},
  232. </if>
  233. <if test="record.visible != null">
  234. visible = #{record.visible,jdbcType=INTEGER},
  235. </if>
  236. </set>
  237. <if test="_parameter != null">
  238. <include refid="Update_By_Example_Where_Clause" />
  239. </if>
  240. </update>
  241. <update id="updateByExample" parameterType="map">
  242. update t_sys_permission
  243. set id = #{record.id,jdbcType=VARCHAR},
  244. name = #{record.name,jdbcType=VARCHAR},
  245. descripion = #{record.descripion,jdbcType=VARCHAR},
  246. url = #{record.url,jdbcType=VARCHAR},
  247. is_blank = #{record.isBlank,jdbcType=INTEGER},
  248. pid = #{record.pid,jdbcType=VARCHAR},
  249. perms = #{record.perms,jdbcType=VARCHAR},
  250. type = #{record.type,jdbcType=INTEGER},
  251. icon = #{record.icon,jdbcType=VARCHAR},
  252. order_num = #{record.orderNum,jdbcType=INTEGER},
  253. visible = #{record.visible,jdbcType=INTEGER}
  254. <if test="_parameter != null">
  255. <include refid="Update_By_Example_Where_Clause" />
  256. </if>
  257. </update>
  258. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.TsysPermission">
  259. update t_sys_permission
  260. <set>
  261. <if test="name != null">
  262. name = #{name,jdbcType=VARCHAR},
  263. </if>
  264. <if test="descripion != null">
  265. descripion = #{descripion,jdbcType=VARCHAR},
  266. </if>
  267. <if test="url != null">
  268. url = #{url,jdbcType=VARCHAR},
  269. </if>
  270. <if test="isBlank != null">
  271. is_blank = #{isBlank,jdbcType=INTEGER},
  272. </if>
  273. <if test="pid != null">
  274. pid = #{pid,jdbcType=VARCHAR},
  275. </if>
  276. <if test="perms != null">
  277. perms = #{perms,jdbcType=VARCHAR},
  278. </if>
  279. <if test="type != null">
  280. type = #{type,jdbcType=INTEGER},
  281. </if>
  282. <if test="icon != null">
  283. icon = #{icon,jdbcType=VARCHAR},
  284. </if>
  285. <if test="orderNum != null">
  286. order_num = #{orderNum,jdbcType=INTEGER},
  287. </if>
  288. <if test="visible != null">
  289. visible = #{visible,jdbcType=INTEGER},
  290. </if>
  291. </set>
  292. where id = #{id,jdbcType=VARCHAR}
  293. </update>
  294. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.TsysPermission">
  295. update t_sys_permission
  296. set name = #{name,jdbcType=VARCHAR},
  297. descripion = #{descripion,jdbcType=VARCHAR},
  298. url = #{url,jdbcType=VARCHAR},
  299. is_blank = #{isBlank,jdbcType=INTEGER},
  300. pid = #{pid,jdbcType=VARCHAR},
  301. perms = #{perms,jdbcType=VARCHAR},
  302. type = #{type,jdbcType=INTEGER},
  303. icon = #{icon,jdbcType=VARCHAR},
  304. order_num = #{orderNum,jdbcType=INTEGER},
  305. visible = #{visible,jdbcType=INTEGER}
  306. where id = #{id,jdbcType=VARCHAR}
  307. </update>
  308. </mapper>