SysAnnouncementSysRoleMapper.xml 5.6 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.SysAnnouncementSysRoleMapper">
  4. <resultMap id="BaseResultMap" type="com.bowintek.smartsearch.model.SysAnnouncementSysRoleKey">
  5. <id column="AnnouncementID" jdbcType="VARCHAR" property="announcementID" />
  6. <id column="RoleID" jdbcType="VARCHAR" property="roleID" />
  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. AnnouncementID, RoleID
  68. </sql>
  69. <select id="selectByExample" parameterType="com.bowintek.smartsearch.model.SysAnnouncementSysRoleExample" resultMap="BaseResultMap">
  70. select
  71. <if test="distinct">
  72. distinct
  73. </if>
  74. <include refid="Base_Column_List" />
  75. from sys_announcement_sys_role
  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.SysAnnouncementSysRoleKey">
  84. delete from sys_announcement_sys_role
  85. where AnnouncementID = #{announcementID,jdbcType=VARCHAR}
  86. and RoleID = #{roleID,jdbcType=VARCHAR}
  87. </delete>
  88. <delete id="deleteByExample" parameterType="com.bowintek.smartsearch.model.SysAnnouncementSysRoleExample">
  89. delete from sys_announcement_sys_role
  90. <if test="_parameter != null">
  91. <include refid="Example_Where_Clause" />
  92. </if>
  93. </delete>
  94. <insert id="insert" parameterType="com.bowintek.smartsearch.model.SysAnnouncementSysRoleKey">
  95. insert into sys_announcement_sys_role (AnnouncementID, RoleID)
  96. values (#{announcementID,jdbcType=VARCHAR}, #{roleID,jdbcType=VARCHAR})
  97. </insert>
  98. <insert id="insertSelective" parameterType="com.bowintek.smartsearch.model.SysAnnouncementSysRoleKey">
  99. insert into sys_announcement_sys_role
  100. <trim prefix="(" suffix=")" suffixOverrides=",">
  101. <if test="announcementID != null">
  102. AnnouncementID,
  103. </if>
  104. <if test="roleID != null">
  105. RoleID,
  106. </if>
  107. </trim>
  108. <trim prefix="values (" suffix=")" suffixOverrides=",">
  109. <if test="announcementID != null">
  110. #{announcementID,jdbcType=VARCHAR},
  111. </if>
  112. <if test="roleID != null">
  113. #{roleID,jdbcType=VARCHAR},
  114. </if>
  115. </trim>
  116. </insert>
  117. <select id="countByExample" parameterType="com.bowintek.smartsearch.model.SysAnnouncementSysRoleExample" resultType="java.lang.Long">
  118. select count(*) from sys_announcement_sys_role
  119. <if test="_parameter != null">
  120. <include refid="Example_Where_Clause" />
  121. </if>
  122. </select>
  123. <update id="updateByExampleSelective" parameterType="map">
  124. update sys_announcement_sys_role
  125. <set>
  126. <if test="row.announcementID != null">
  127. AnnouncementID = #{row.announcementID,jdbcType=VARCHAR},
  128. </if>
  129. <if test="row.roleID != null">
  130. RoleID = #{row.roleID,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_announcement_sys_role
  139. set AnnouncementID = #{row.announcementID,jdbcType=VARCHAR},
  140. RoleID = #{row.roleID,jdbcType=VARCHAR}
  141. <if test="example != null">
  142. <include refid="Update_By_Example_Where_Clause" />
  143. </if>
  144. </update>
  145. </mapper>