SysRoleSysMenuShortcutMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.smartsearch.mapper.SysRoleSysMenuShortcutMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutKey">
  5. <id column="RoleID" jdbcType="VARCHAR" property="roleID" />
  6. <id column="MenuNo" jdbcType="VARCHAR" property="menuNo" />
  7. </resultMap>
  8. <sql id="Example_Where_Clause">
  9. <where>
  10. <foreach collection="oredCriteria" item="criteria" separator="or">
  11. <if test="criteria.valid">
  12. <trim prefix="(" prefixOverrides="and" suffix=")">
  13. <foreach collection="criteria.criteria" item="criterion">
  14. <choose>
  15. <when test="criterion.noValue">
  16. and ${criterion.condition}
  17. </when>
  18. <when test="criterion.singleValue">
  19. and ${criterion.condition} #{criterion.value}
  20. </when>
  21. <when test="criterion.betweenValue">
  22. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  23. </when>
  24. <when test="criterion.listValue">
  25. and ${criterion.condition}
  26. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  27. #{listItem}
  28. </foreach>
  29. </when>
  30. </choose>
  31. </foreach>
  32. </trim>
  33. </if>
  34. </foreach>
  35. </where>
  36. </sql>
  37. <sql id="Update_By_Example_Where_Clause">
  38. <where>
  39. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  40. <if test="criteria.valid">
  41. <trim prefix="(" prefixOverrides="and" suffix=")">
  42. <foreach collection="criteria.criteria" item="criterion">
  43. <choose>
  44. <when test="criterion.noValue">
  45. and ${criterion.condition}
  46. </when>
  47. <when test="criterion.singleValue">
  48. and ${criterion.condition} #{criterion.value}
  49. </when>
  50. <when test="criterion.betweenValue">
  51. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  52. </when>
  53. <when test="criterion.listValue">
  54. and ${criterion.condition}
  55. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  56. #{listItem}
  57. </foreach>
  58. </when>
  59. </choose>
  60. </foreach>
  61. </trim>
  62. </if>
  63. </foreach>
  64. </where>
  65. </sql>
  66. <sql id="Base_Column_List">
  67. RoleID, MenuNo
  68. </sql>
  69. <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutExample" resultMap="BaseResultMap">
  70. select
  71. <if test="distinct">
  72. distinct
  73. </if>
  74. <include refid="Base_Column_List" />
  75. from sys_role_sys_menu_shortcut
  76. <if test="_parameter != null">
  77. <include refid="Example_Where_Clause" />
  78. </if>
  79. <if test="orderByClause != null">
  80. order by ${orderByClause}
  81. </if>
  82. </select>
  83. <delete id="deleteByPrimaryKey" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutKey">
  84. delete from sys_role_sys_menu_shortcut
  85. where RoleID = #{roleID,jdbcType=VARCHAR}
  86. and MenuNo = #{menuNo,jdbcType=VARCHAR}
  87. </delete>
  88. <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutExample">
  89. delete from sys_role_sys_menu_shortcut
  90. <if test="_parameter != null">
  91. <include refid="Example_Where_Clause" />
  92. </if>
  93. </delete>
  94. <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutKey">
  95. insert into sys_role_sys_menu_shortcut (RoleID, MenuNo)
  96. values (#{roleID,jdbcType=VARCHAR}, #{menuNo,jdbcType=VARCHAR})
  97. </insert>
  98. <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutKey">
  99. insert into sys_role_sys_menu_shortcut
  100. <trim prefix="(" suffix=")" suffixOverrides=",">
  101. <if test="roleID != null">
  102. RoleID,
  103. </if>
  104. <if test="menuNo != null">
  105. MenuNo,
  106. </if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides=",">
  109. <if test="roleID != null">
  110. #{roleID,jdbcType=VARCHAR},
  111. </if>
  112. <if test="menuNo != null">
  113. #{menuNo,jdbcType=VARCHAR},
  114. </if>
  115. </trim>
  116. </insert>
  117. <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysRoleSysMenuShortcutExample" resultType="java.lang.Long">
  118. select count(*) from sys_role_sys_menu_shortcut
  119. <if test="_parameter != null">
  120. <include refid="Example_Where_Clause" />
  121. </if>
  122. </select>
  123. <update id="updateByExampleSelective" parameterType="map">
  124. update sys_role_sys_menu_shortcut
  125. <set>
  126. <if test="row.roleID != null">
  127. RoleID = #{row.roleID,jdbcType=VARCHAR},
  128. </if>
  129. <if test="row.menuNo != null">
  130. MenuNo = #{row.menuNo,jdbcType=VARCHAR},
  131. </if>
  132. </set>
  133. <if test="example != null">
  134. <include refid="Update_By_Example_Where_Clause" />
  135. </if>
  136. </update>
  137. <update id="updateByExample" parameterType="map">
  138. update sys_role_sys_menu_shortcut
  139. set RoleID = #{row.roleID,jdbcType=VARCHAR},
  140. MenuNo = #{row.menuNo,jdbcType=VARCHAR}
  141. <if test="example != null">
  142. <include refid="Update_By_Example_Where_Clause" />
  143. </if>
  144. </update>
  145. </mapper>