TsysPermissionRoleMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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.TsysPermissionRoleMapper" >
  4. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.TsysPermissionRole" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="role_id" property="roleId" jdbcType="VARCHAR" />
  7. <result column="permission_id" property="permissionId" jdbcType="VARCHAR" />
  8. </resultMap>
  9. <sql id="Example_Where_Clause" >
  10. <where >
  11. <foreach collection="oredCriteria" item="criteria" separator="or" >
  12. <if test="criteria.valid" >
  13. <trim prefix="(" suffix=")" prefixOverrides="and" >
  14. <foreach collection="criteria.criteria" item="criterion" >
  15. <choose >
  16. <when test="criterion.noValue" >
  17. and ${criterion.condition}
  18. </when>
  19. <when test="criterion.singleValue" >
  20. and ${criterion.condition} #{criterion.value}
  21. </when>
  22. <when test="criterion.betweenValue" >
  23. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  24. </when>
  25. <when test="criterion.listValue" >
  26. and ${criterion.condition}
  27. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  28. #{listItem}
  29. </foreach>
  30. </when>
  31. </choose>
  32. </foreach>
  33. </trim>
  34. </if>
  35. </foreach>
  36. </where>
  37. </sql>
  38. <sql id="Update_By_Example_Where_Clause" >
  39. <where >
  40. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  41. <if test="criteria.valid" >
  42. <trim prefix="(" suffix=")" prefixOverrides="and" >
  43. <foreach collection="criteria.criteria" item="criterion" >
  44. <choose >
  45. <when test="criterion.noValue" >
  46. and ${criterion.condition}
  47. </when>
  48. <when test="criterion.singleValue" >
  49. and ${criterion.condition} #{criterion.value}
  50. </when>
  51. <when test="criterion.betweenValue" >
  52. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  53. </when>
  54. <when test="criterion.listValue" >
  55. and ${criterion.condition}
  56. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  57. #{listItem}
  58. </foreach>
  59. </when>
  60. </choose>
  61. </foreach>
  62. </trim>
  63. </if>
  64. </foreach>
  65. </where>
  66. </sql>
  67. <sql id="Base_Column_List" >
  68. id, role_id, permission_id
  69. </sql>
  70. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.gyee.frame.model.auto.TsysPermissionRoleExample" >
  71. select
  72. <if test="distinct" >
  73. distinct
  74. </if>
  75. <include refid="Base_Column_List" />
  76. from t_sys_permission_role
  77. <if test="_parameter != null" >
  78. <include refid="Example_Where_Clause" />
  79. </if>
  80. <if test="orderByClause != null" >
  81. order by ${orderByClause}
  82. </if>
  83. </select>
  84. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  85. select
  86. <include refid="Base_Column_List" />
  87. from t_sys_permission_role
  88. where id = #{id,jdbcType=VARCHAR}
  89. </select>
  90. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  91. delete from t_sys_permission_role
  92. where id = #{id,jdbcType=VARCHAR}
  93. </delete>
  94. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.TsysPermissionRoleExample" >
  95. delete from t_sys_permission_role
  96. <if test="_parameter != null" >
  97. <include refid="Example_Where_Clause" />
  98. </if>
  99. </delete>
  100. <insert id="insert" parameterType="com.gyee.frame.model.auto.TsysPermissionRole" >
  101. insert into t_sys_permission_role (id, role_id, permission_id
  102. )
  103. values (#{id,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR}, #{permissionId,jdbcType=VARCHAR}
  104. )
  105. </insert>
  106. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.TsysPermissionRole" >
  107. insert into t_sys_permission_role
  108. <trim prefix="(" suffix=")" suffixOverrides="," >
  109. <if test="id != null" >
  110. id,
  111. </if>
  112. <if test="roleId != null" >
  113. role_id,
  114. </if>
  115. <if test="permissionId != null" >
  116. permission_id,
  117. </if>
  118. </trim>
  119. <trim prefix="values (" suffix=")" suffixOverrides="," >
  120. <if test="id != null" >
  121. #{id,jdbcType=VARCHAR},
  122. </if>
  123. <if test="roleId != null" >
  124. #{roleId,jdbcType=VARCHAR},
  125. </if>
  126. <if test="permissionId != null" >
  127. #{permissionId,jdbcType=VARCHAR},
  128. </if>
  129. </trim>
  130. </insert>
  131. <select id="countByExample" parameterType="com.gyee.frame.model.auto.TsysPermissionRoleExample" resultType="java.lang.Integer" >
  132. select count(*) from t_sys_permission_role
  133. <if test="_parameter != null" >
  134. <include refid="Example_Where_Clause" />
  135. </if>
  136. </select>
  137. <update id="updateByExampleSelective" parameterType="map" >
  138. update t_sys_permission_role
  139. <set >
  140. <if test="record.id != null" >
  141. id = #{record.id,jdbcType=VARCHAR},
  142. </if>
  143. <if test="record.roleId != null" >
  144. role_id = #{record.roleId,jdbcType=VARCHAR},
  145. </if>
  146. <if test="record.permissionId != null" >
  147. permission_id = #{record.permissionId,jdbcType=VARCHAR},
  148. </if>
  149. </set>
  150. <if test="_parameter != null" >
  151. <include refid="Update_By_Example_Where_Clause" />
  152. </if>
  153. </update>
  154. <update id="updateByExample" parameterType="map" >
  155. update t_sys_permission_role
  156. set id = #{record.id,jdbcType=VARCHAR},
  157. role_id = #{record.roleId,jdbcType=VARCHAR},
  158. permission_id = #{record.permissionId,jdbcType=VARCHAR}
  159. <if test="_parameter != null" >
  160. <include refid="Update_By_Example_Where_Clause" />
  161. </if>
  162. </update>
  163. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.TsysPermissionRole" >
  164. update t_sys_permission_role
  165. <set >
  166. <if test="roleId != null" >
  167. role_id = #{roleId,jdbcType=VARCHAR},
  168. </if>
  169. <if test="permissionId != null" >
  170. permission_id = #{permissionId,jdbcType=VARCHAR},
  171. </if>
  172. </set>
  173. where id = #{id,jdbcType=VARCHAR}
  174. </update>
  175. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.TsysPermissionRole" >
  176. update t_sys_permission_role
  177. set role_id = #{roleId,jdbcType=VARCHAR},
  178. permission_id = #{permissionId,jdbcType=VARCHAR}
  179. where id = #{id,jdbcType=VARCHAR}
  180. </update>
  181. </mapper>