UserRoleMapper.xml 10.1 KB
Newer Older
1 2 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.UserRoleMapper">
4
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.UserRole">
5 6 7 8
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
9 10 11 12 13
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="USER_ID" jdbcType="VARCHAR" property="userId" />
    <result column="ROLE_ID" jdbcType="VARCHAR" property="roleId" />
    <result column="PROJECT_ID" jdbcType="VARCHAR" property="projectId" />
    <result column="SERVICE_TYPE_ID" jdbcType="VARCHAR" property="serviceTypeId" />
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
42
            </foreach>
43
          </trim>
44
        </if>
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
77
        </if>
78 79 80 81 82 83 84 85
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
86
    ID, USER_ID, ROLE_ID, PROJECT_ID, SERVICE_TYPE_ID
87
  </sql>
88
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.UserRoleExample" resultMap="BaseResultMap">
89 90 91 92 93 94 95 96 97
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
neo's avatar
neo committed
98
    from USER_ROLE
99 100 101 102 103 104 105 106 107 108 109 110 111 112
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
neo's avatar
neo committed
113 114
    from USER_ROLE
    where ID = #{id,jdbcType=VARCHAR}
115 116 117 118 119 120
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
121 122
    delete from USER_ROLE
    where ID = #{id,jdbcType=VARCHAR}
123
  </delete>
124
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.UserRoleExample">
125 126 127 128
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
129
    delete from USER_ROLE
130 131 132 133
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
134
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.UserRole">
135 136 137 138
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
139 140 141 142
    insert into USER_ROLE (ID, USER_ID, ROLE_ID, 
      PROJECT_ID, SERVICE_TYPE_ID)
    values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR}, 
      #{projectId,jdbcType=VARCHAR}, #{serviceTypeId,jdbcType=VARCHAR})
143
  </insert>
144
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.UserRole">
145 146 147 148
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
149
    insert into USER_ROLE
150
    <trim prefix="(" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
151
      <if test="id != null">
152 153
        ID,
      </if>
neo's avatar
neo committed
154 155
      <if test="userId != null">
        USER_ID,
156
      </if>
neo's avatar
neo committed
157 158
      <if test="roleId != null">
        ROLE_ID,
159
      </if>
neo's avatar
neo committed
160 161
      <if test="projectId != null">
        PROJECT_ID,
162
      </if>
neo's avatar
neo committed
163 164
      <if test="serviceTypeId != null">
        SERVICE_TYPE_ID,
165 166 167
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
neo's avatar
neo committed
168 169
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
170
      </if>
neo's avatar
neo committed
171 172
      <if test="userId != null">
        #{userId,jdbcType=VARCHAR},
173
      </if>
neo's avatar
neo committed
174 175
      <if test="roleId != null">
        #{roleId,jdbcType=VARCHAR},
176
      </if>
neo's avatar
neo committed
177 178
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
179
      </if>
neo's avatar
neo committed
180 181
      <if test="serviceTypeId != null">
        #{serviceTypeId,jdbcType=VARCHAR},
182 183 184
      </if>
    </trim>
  </insert>
185
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.UserRoleExample" resultType="java.lang.Long">
186 187 188 189
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
190
    select count(*) from USER_ROLE
191 192 193 194 195 196 197 198 199
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
200
    update USER_ROLE
201
    <set>
neo's avatar
neo committed
202 203
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
204
      </if>
neo's avatar
neo committed
205 206
      <if test="record.userId != null">
        USER_ID = #{record.userId,jdbcType=VARCHAR},
207
      </if>
neo's avatar
neo committed
208 209
      <if test="record.roleId != null">
        ROLE_ID = #{record.roleId,jdbcType=VARCHAR},
210
      </if>
neo's avatar
neo committed
211 212
      <if test="record.projectId != null">
        PROJECT_ID = #{record.projectId,jdbcType=VARCHAR},
213
      </if>
neo's avatar
neo committed
214 215
      <if test="record.serviceTypeId != null">
        SERVICE_TYPE_ID = #{record.serviceTypeId,jdbcType=VARCHAR},
216 217 218 219 220 221 222 223 224 225 226
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
227 228 229 230 231 232
    update USER_ROLE
    set ID = #{record.id,jdbcType=VARCHAR},
      USER_ID = #{record.userId,jdbcType=VARCHAR},
      ROLE_ID = #{record.roleId,jdbcType=VARCHAR},
      PROJECT_ID = #{record.projectId,jdbcType=VARCHAR},
      SERVICE_TYPE_ID = #{record.serviceTypeId,jdbcType=VARCHAR}
233 234 235 236
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
237
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.UserRole">
238 239 240 241
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
242
    update USER_ROLE
243
    <set>
neo's avatar
neo committed
244 245
      <if test="userId != null">
        USER_ID = #{userId,jdbcType=VARCHAR},
246
      </if>
neo's avatar
neo committed
247 248
      <if test="roleId != null">
        ROLE_ID = #{roleId,jdbcType=VARCHAR},
249
      </if>
neo's avatar
neo committed
250 251
      <if test="projectId != null">
        PROJECT_ID = #{projectId,jdbcType=VARCHAR},
252
      </if>
neo's avatar
neo committed
253 254
      <if test="serviceTypeId != null">
        SERVICE_TYPE_ID = #{serviceTypeId,jdbcType=VARCHAR},
255 256
      </if>
    </set>
neo's avatar
neo committed
257
    where ID = #{id,jdbcType=VARCHAR}
258
  </update>
259
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.UserRole">
260 261 262 263
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
neo's avatar
neo committed
264 265 266 267 268 269
    update USER_ROLE
    set USER_ID = #{userId,jdbcType=VARCHAR},
      ROLE_ID = #{roleId,jdbcType=VARCHAR},
      PROJECT_ID = #{projectId,jdbcType=VARCHAR},
      SERVICE_TYPE_ID = #{serviceTypeId,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
270
  </update>
271
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.UserRoleExample" resultMap="BaseResultMap">
272 273 274 275 276 277 278 279 280
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
neo's avatar
neo committed
281
    from USER_ROLE
282 283 284 285 286 287 288
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
289
</mapper>