<?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="resources/permission.WbRoleMapper">
  <resultMap id="BaseResultMap" type="com.wb.permission.pojo.WbRole">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ROLE_ID" jdbcType="VARCHAR" property="roleId" />
    <result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
    <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName" />
    <result column="REMARK" jdbcType="VARCHAR" property="remark" />
    <result column="STATUS" jdbcType="DECIMAL" property="status" />
    <result column="NOTES" jdbcType="VARCHAR" property="notes" />
    <result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
    <result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
    <result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
    <result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ROLE_ID, TENANCY_ID, ROLE_NAME, REMARK, STATUS, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, 
    UPDATED_ON
  </sql>
  <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" />
    from WB_ROLE
    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from WB_ROLE
    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.wb.permission.pojo.WbRole">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_ROLE (ROLE_ID, TENANCY_ID, ROLE_NAME, 
      REMARK, STATUS, NOTES, 
      CREATED_BY, CREATED_ON, UPDATED_BY, 
      UPDATED_ON)
    values (#{roleId,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{roleName,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{notes,jdbcType=VARCHAR}, 
      #{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}, 
      #{updatedOn,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.wb.permission.pojo.WbRole">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_ROLE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="roleId != null">
        ROLE_ID,
      </if>
      <if test="tenancyId != null">
        TENANCY_ID,
      </if>
      <if test="roleName != null">
        ROLE_NAME,
      </if>
      <if test="remark != null">
        REMARK,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="notes != null">
        NOTES,
      </if>
      <if test="createdBy != null">
        CREATED_BY,
      </if>
      <if test="createdOn != null">
        CREATED_ON,
      </if>
      <if test="updatedBy != null">
        UPDATED_BY,
      </if>
      <if test="updatedOn != null">
        UPDATED_ON,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="roleId != null">
        #{roleId,jdbcType=VARCHAR},
      </if>
      <if test="tenancyId != null">
        #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="roleName != null">
        #{roleName,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=DECIMAL},
      </if>
      <if test="notes != null">
        #{notes,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="createdOn != null">
        #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedOn != null">
        #{updatedOn,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.wb.permission.pojo.WbRole">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_ROLE
    <set>
      <if test="tenancyId != null">
        TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="roleName != null">
        ROLE_NAME = #{roleName,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=DECIMAL},
      </if>
      <if test="notes != null">
        NOTES = #{notes,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        CREATED_BY = #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="createdOn != null">
        CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedOn != null">
        UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
      </if>
    </set>
    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.wb.permission.pojo.WbRole">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_ROLE
    set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      ROLE_NAME = #{roleName,jdbcType=VARCHAR},
      REMARK = #{remark,jdbcType=VARCHAR},
      STATUS = #{status,jdbcType=DECIMAL},
      NOTES = #{notes,jdbcType=VARCHAR},
      CREATED_BY = #{createdBy,jdbcType=VARCHAR},
      CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
      UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
      UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP}
    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
  </update>

</mapper>