<?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.WbMenuResMapper">
  <resultMap id="BaseResultMap" type="com.wb.permission.pojo.WbMenuRes">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="MENU_RES_ID" jdbcType="VARCHAR" property="menuResId" />
    <result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
    <result column="PARENT_MENU_ID" jdbcType="VARCHAR" property="parentMenuId" />
    <result column="MENU_RES_ENAME" jdbcType="VARCHAR" property="menuResEname" />
    <result column="MENU_RES_CNAME" jdbcType="VARCHAR" property="menuResCname" />
    <result column="MENU_RES_TYPE" jdbcType="VARCHAR" property="menuResType" />
    <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.
    -->
    MENU_RES_ID, TENANCY_ID, PARENT_MENU_ID, MENU_RES_ENAME, MENU_RES_CNAME, MENU_RES_TYPE, 
    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_MENU_RES
    where MENU_RES_ID = #{menuResId,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_MENU_RES
    where MENU_RES_ID = #{menuResId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.wb.permission.pojo.WbMenuRes">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_MENU_RES (MENU_RES_ID, TENANCY_ID, PARENT_MENU_ID, 
      MENU_RES_ENAME, MENU_RES_CNAME, MENU_RES_TYPE, 
      NOTES, CREATED_BY, CREATED_ON, 
      UPDATED_BY, UPDATED_ON)
    values (#{menuResId,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{parentMenuId,jdbcType=VARCHAR}, 
      #{menuResEname,jdbcType=VARCHAR}, #{menuResCname,jdbcType=VARCHAR}, #{menuResType,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.WbMenuRes">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into WB_MENU_RES
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="menuResId != null">
        MENU_RES_ID,
      </if>
      <if test="tenancyId != null">
        TENANCY_ID,
      </if>
      <if test="parentMenuId != null">
        PARENT_MENU_ID,
      </if>
      <if test="menuResEname != null">
        MENU_RES_ENAME,
      </if>
      <if test="menuResCname != null">
        MENU_RES_CNAME,
      </if>
      <if test="menuResType != null">
        MENU_RES_TYPE,
      </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="menuResId != null">
        #{menuResId,jdbcType=VARCHAR},
      </if>
      <if test="tenancyId != null">
        #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="parentMenuId != null">
        #{parentMenuId,jdbcType=VARCHAR},
      </if>
      <if test="menuResEname != null">
        #{menuResEname,jdbcType=VARCHAR},
      </if>
      <if test="menuResCname != null">
        #{menuResCname,jdbcType=VARCHAR},
      </if>
      <if test="menuResType != null">
        #{menuResType,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.WbMenuRes">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_MENU_RES
    <set>
      <if test="tenancyId != null">
        TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      </if>
      <if test="parentMenuId != null">
        PARENT_MENU_ID = #{parentMenuId,jdbcType=VARCHAR},
      </if>
      <if test="menuResEname != null">
        MENU_RES_ENAME = #{menuResEname,jdbcType=VARCHAR},
      </if>
      <if test="menuResCname != null">
        MENU_RES_CNAME = #{menuResCname,jdbcType=VARCHAR},
      </if>
      <if test="menuResType != null">
        MENU_RES_TYPE = #{menuResType,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 MENU_RES_ID = #{menuResId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.wb.permission.pojo.WbMenuRes">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update WB_MENU_RES
    set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
      PARENT_MENU_ID = #{parentMenuId,jdbcType=VARCHAR},
      MENU_RES_ENAME = #{menuResEname,jdbcType=VARCHAR},
      MENU_RES_CNAME = #{menuResCname,jdbcType=VARCHAR},
      MENU_RES_TYPE = #{menuResType,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 MENU_RES_ID = #{menuResId,jdbcType=VARCHAR}
  </update>

  <!-- 删除菜单按钮-->
  <delete id="deleteByMenuId" parameterType="map">
    delete from WB_MENU_RES where PARENT_MENU_ID = #{parentMenuId,jdbcType=VARCHAR}
  </delete>
</mapper>