<?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.WbTenancyMapper">
  <resultMap id="BaseResultMap" type="com.wb.permission.pojo.WbTenancy">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
    <result column="TENANCY_CODE" jdbcType="VARCHAR" property="tenancyCode" />
    <result column="TENANCY_NAME" jdbcType="VARCHAR" property="tenancyName" />
    <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.
    -->
    TENANCY_ID, TENANCY_CODE, TENANCY_NAME, 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_TENANCY
    where TENANCY_ID = #{tenancyId,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_TENANCY
    where TENANCY_ID = #{tenancyId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.wb.permission.pojo.WbTenancy">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_TENANCY (TENANCY_ID, TENANCY_CODE, TENANCY_NAME, 
      NOTES, CREATED_BY, CREATED_ON, 
      UPDATED_BY, UPDATED_ON)
    values (#{tenancyId,jdbcType=VARCHAR}, #{tenancyCode,jdbcType=VARCHAR}, #{tenancyName,jdbcType=VARCHAR}, 
      #{notes,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, 
      #{updatedBy,jdbcType=VARCHAR}, #{updatedOn,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.wb.permission.pojo.WbTenancy">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_TENANCY
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="tenancyId != null">
        TENANCY_ID,
      </if>
      <if test="tenancyCode != null">
        TENANCY_CODE,
      </if>
      <if test="tenancyName != null">
        TENANCY_NAME,
      </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="tenancyId != null">
        #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="tenancyCode != null">
        #{tenancyCode,jdbcType=VARCHAR},
      </if>
      <if test="tenancyName != null">
        #{tenancyName,jdbcType=VARCHAR},
      </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.WbTenancy">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_TENANCY
    <set>
      <if test="tenancyCode != null">
        TENANCY_CODE = #{tenancyCode,jdbcType=VARCHAR},
      </if>
      <if test="tenancyName != null">
        TENANCY_NAME = #{tenancyName,jdbcType=VARCHAR},
      </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 TENANCY_ID = #{tenancyId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.wb.permission.pojo.WbTenancy">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_TENANCY
    set TENANCY_CODE = #{tenancyCode,jdbcType=VARCHAR},
      TENANCY_NAME = #{tenancyName,jdbcType=VARCHAR},
      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 TENANCY_ID = #{tenancyId,jdbcType=VARCHAR}
  </update>
</mapper>