SysRoleDatarangeMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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.bowintek.practice.mapper.SysRoleDatarangeMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.practice.model.SysRoleDatarange">
  5. <id column="RoleDataRangeID" jdbcType="VARCHAR" property="roleDataRangeID" />
  6. <result column="RoleID" jdbcType="VARCHAR" property="roleID" />
  7. <result column="MenuNo" jdbcType="VARCHAR" property="menuNo" />
  8. <result column="DataRangeID" jdbcType="INTEGER" property="dataRangeID" />
  9. <result column="CreateBy" jdbcType="VARCHAR" property="createBy" />
  10. <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
  11. </resultMap>
  12. <sql id="Example_Where_Clause">
  13. <where>
  14. <foreach collection="oredCriteria" item="criteria" separator="or">
  15. <if test="criteria.valid">
  16. <trim prefix="(" prefixOverrides="and" suffix=")">
  17. <foreach collection="criteria.criteria" item="criterion">
  18. <choose>
  19. <when test="criterion.noValue">
  20. and ${criterion.condition}
  21. </when>
  22. <when test="criterion.singleValue">
  23. and ${criterion.condition} #{criterion.value}
  24. </when>
  25. <when test="criterion.betweenValue">
  26. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  27. </when>
  28. <when test="criterion.listValue">
  29. and ${criterion.condition}
  30. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  31. #{listItem}
  32. </foreach>
  33. </when>
  34. </choose>
  35. </foreach>
  36. </trim>
  37. </if>
  38. </foreach>
  39. </where>
  40. </sql>
  41. <sql id="Update_By_Example_Where_Clause">
  42. <where>
  43. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  44. <if test="criteria.valid">
  45. <trim prefix="(" prefixOverrides="and" suffix=")">
  46. <foreach collection="criteria.criteria" item="criterion">
  47. <choose>
  48. <when test="criterion.noValue">
  49. and ${criterion.condition}
  50. </when>
  51. <when test="criterion.singleValue">
  52. and ${criterion.condition} #{criterion.value}
  53. </when>
  54. <when test="criterion.betweenValue">
  55. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  56. </when>
  57. <when test="criterion.listValue">
  58. and ${criterion.condition}
  59. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  60. #{listItem}
  61. </foreach>
  62. </when>
  63. </choose>
  64. </foreach>
  65. </trim>
  66. </if>
  67. </foreach>
  68. </where>
  69. </sql>
  70. <sql id="Base_Column_List">
  71. RoleDataRangeID, RoleID, MenuNo, DataRangeID, CreateBy, CreateTime
  72. </sql>
  73. <select id="selectByExample" parameterType="com.bowintek.practice.model.SysRoleDatarangeExample" resultMap="BaseResultMap">
  74. select
  75. <if test="distinct">
  76. distinct
  77. </if>
  78. <include refid="Base_Column_List" />
  79. from sys_role_datarange
  80. <if test="_parameter != null">
  81. <include refid="Example_Where_Clause" />
  82. </if>
  83. <if test="orderByClause != null">
  84. order by ${orderByClause}
  85. </if>
  86. </select>
  87. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  88. select
  89. <include refid="Base_Column_List" />
  90. from sys_role_datarange
  91. where RoleDataRangeID = #{roleDataRangeID,jdbcType=VARCHAR}
  92. </select>
  93. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  94. delete from sys_role_datarange
  95. where RoleDataRangeID = #{roleDataRangeID,jdbcType=VARCHAR}
  96. </delete>
  97. <delete id="deleteByExample" parameterType="com.bowintek.practice.model.SysRoleDatarangeExample">
  98. delete from sys_role_datarange
  99. <if test="_parameter != null">
  100. <include refid="Example_Where_Clause" />
  101. </if>
  102. </delete>
  103. <insert id="insert" parameterType="com.bowintek.practice.model.SysRoleDatarange">
  104. insert into sys_role_datarange (RoleDataRangeID, RoleID, MenuNo,
  105. DataRangeID, CreateBy, CreateTime
  106. )
  107. values (#{roleDataRangeID,jdbcType=VARCHAR}, #{roleID,jdbcType=VARCHAR}, #{menuNo,jdbcType=VARCHAR},
  108. #{dataRangeID,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  109. )
  110. </insert>
  111. <insert id="insertSelective" parameterType="com.bowintek.practice.model.SysRoleDatarange">
  112. insert into sys_role_datarange
  113. <trim prefix="(" suffix=")" suffixOverrides=",">
  114. <if test="roleDataRangeID != null">
  115. RoleDataRangeID,
  116. </if>
  117. <if test="roleID != null">
  118. RoleID,
  119. </if>
  120. <if test="menuNo != null">
  121. MenuNo,
  122. </if>
  123. <if test="dataRangeID != null">
  124. DataRangeID,
  125. </if>
  126. <if test="createBy != null">
  127. CreateBy,
  128. </if>
  129. <if test="createTime != null">
  130. CreateTime,
  131. </if>
  132. </trim>
  133. <trim prefix="values (" suffix=")" suffixOverrides=",">
  134. <if test="roleDataRangeID != null">
  135. #{roleDataRangeID,jdbcType=VARCHAR},
  136. </if>
  137. <if test="roleID != null">
  138. #{roleID,jdbcType=VARCHAR},
  139. </if>
  140. <if test="menuNo != null">
  141. #{menuNo,jdbcType=VARCHAR},
  142. </if>
  143. <if test="dataRangeID != null">
  144. #{dataRangeID,jdbcType=INTEGER},
  145. </if>
  146. <if test="createBy != null">
  147. #{createBy,jdbcType=VARCHAR},
  148. </if>
  149. <if test="createTime != null">
  150. #{createTime,jdbcType=TIMESTAMP},
  151. </if>
  152. </trim>
  153. </insert>
  154. <select id="countByExample" parameterType="com.bowintek.practice.model.SysRoleDatarangeExample" resultType="java.lang.Long">
  155. select count(*) from sys_role_datarange
  156. <if test="_parameter != null">
  157. <include refid="Example_Where_Clause" />
  158. </if>
  159. </select>
  160. <update id="updateByExampleSelective" parameterType="map">
  161. update sys_role_datarange
  162. <set>
  163. <if test="row.roleDataRangeID != null">
  164. RoleDataRangeID = #{row.roleDataRangeID,jdbcType=VARCHAR},
  165. </if>
  166. <if test="row.roleID != null">
  167. RoleID = #{row.roleID,jdbcType=VARCHAR},
  168. </if>
  169. <if test="row.menuNo != null">
  170. MenuNo = #{row.menuNo,jdbcType=VARCHAR},
  171. </if>
  172. <if test="row.dataRangeID != null">
  173. DataRangeID = #{row.dataRangeID,jdbcType=INTEGER},
  174. </if>
  175. <if test="row.createBy != null">
  176. CreateBy = #{row.createBy,jdbcType=VARCHAR},
  177. </if>
  178. <if test="row.createTime != null">
  179. CreateTime = #{row.createTime,jdbcType=TIMESTAMP},
  180. </if>
  181. </set>
  182. <if test="example != null">
  183. <include refid="Update_By_Example_Where_Clause" />
  184. </if>
  185. </update>
  186. <update id="updateByExample" parameterType="map">
  187. update sys_role_datarange
  188. set RoleDataRangeID = #{row.roleDataRangeID,jdbcType=VARCHAR},
  189. RoleID = #{row.roleID,jdbcType=VARCHAR},
  190. MenuNo = #{row.menuNo,jdbcType=VARCHAR},
  191. DataRangeID = #{row.dataRangeID,jdbcType=INTEGER},
  192. CreateBy = #{row.createBy,jdbcType=VARCHAR},
  193. CreateTime = #{row.createTime,jdbcType=TIMESTAMP}
  194. <if test="example != null">
  195. <include refid="Update_By_Example_Where_Clause" />
  196. </if>
  197. </update>
  198. <update id="updateByPrimaryKeySelective" parameterType="com.bowintek.practice.model.SysRoleDatarange">
  199. update sys_role_datarange
  200. <set>
  201. <if test="roleID != null">
  202. RoleID = #{roleID,jdbcType=VARCHAR},
  203. </if>
  204. <if test="menuNo != null">
  205. MenuNo = #{menuNo,jdbcType=VARCHAR},
  206. </if>
  207. <if test="dataRangeID != null">
  208. DataRangeID = #{dataRangeID,jdbcType=INTEGER},
  209. </if>
  210. <if test="createBy != null">
  211. CreateBy = #{createBy,jdbcType=VARCHAR},
  212. </if>
  213. <if test="createTime != null">
  214. CreateTime = #{createTime,jdbcType=TIMESTAMP},
  215. </if>
  216. </set>
  217. where RoleDataRangeID = #{roleDataRangeID,jdbcType=VARCHAR}
  218. </update>
  219. <update id="updateByPrimaryKey" parameterType="com.bowintek.practice.model.SysRoleDatarange">
  220. update sys_role_datarange
  221. set RoleID = #{roleID,jdbcType=VARCHAR},
  222. MenuNo = #{menuNo,jdbcType=VARCHAR},
  223. DataRangeID = #{dataRangeID,jdbcType=INTEGER},
  224. CreateBy = #{createBy,jdbcType=VARCHAR},
  225. CreateTime = #{createTime,jdbcType=TIMESTAMP}
  226. where RoleDataRangeID = #{roleDataRangeID,jdbcType=VARCHAR}
  227. </update>
  228. </mapper>