<?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="com.gyee.frame.mapper.auto.GyeePermissionMapper">
  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.GyeePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="NVARCHAR" property="id" />
    <result column="PERMISSSIONLEVEL" jdbcType="NVARCHAR" property="permisssionlevel" />
    <result column="PERMISSSIONNAME" jdbcType="NVARCHAR" property="permisssionname" />
    <result column="DESCRIBES" jdbcType="NVARCHAR" property="describes" />
    <result column="REMARK1" jdbcType="NVARCHAR" property="remark1" />
    <result column="REMARK2" jdbcType="NVARCHAR" property="remark2" />
    <result column="PARENT" jdbcType="NVARCHAR" property="parent" />
    <result column="ISABLE" jdbcType="NVARCHAR" property="isable" />
  </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>
            </foreach>
          </trim>
        </if>
      </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>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    ID, PERMISSSIONLEVEL, PERMISSSIONNAME, DESCRIBES, REMARK1, REMARK2, PARENT, ISABLE
  </sql>
  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.GyeePermissionExample" resultMap="BaseResultMap">
    <!--
      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" />
    from GYEEPERMISSION
    <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" />
    from GYEEPERMISSION
    where ID = #{id,jdbcType=NVARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from GYEEPERMISSION
    where ID = #{id,jdbcType=NVARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.GyeePermissionExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from GYEEPERMISSION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.gyee.frame.model.auto.GyeePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into GYEEPERMISSION (ID, PERMISSSIONLEVEL, PERMISSSIONNAME, 
      DESCRIBES, REMARK1, REMARK2, 
      PARENT, ISABLE)
    values (#{id,jdbcType=NVARCHAR}, #{permisssionlevel,jdbcType=NVARCHAR}, #{permisssionname,jdbcType=NVARCHAR}, 
      #{describes,jdbcType=NVARCHAR}, #{remark1,jdbcType=NVARCHAR}, #{remark2,jdbcType=NVARCHAR}, 
      #{parent,jdbcType=NVARCHAR}, #{isable,jdbcType=NVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.GyeePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into GYEEPERMISSION
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="permisssionlevel != null">
        PERMISSSIONLEVEL,
      </if>
      <if test="permisssionname != null">
        PERMISSSIONNAME,
      </if>
      <if test="describes != null">
        DESCRIBES,
      </if>
      <if test="remark1 != null">
        REMARK1,
      </if>
      <if test="remark2 != null">
        REMARK2,
      </if>
      <if test="parent != null">
        PARENT,
      </if>
      <if test="isable != null">
        ISABLE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=NVARCHAR},
      </if>
      <if test="permisssionlevel != null">
        #{permisssionlevel,jdbcType=NVARCHAR},
      </if>
      <if test="permisssionname != null">
        #{permisssionname,jdbcType=NVARCHAR},
      </if>
      <if test="describes != null">
        #{describes,jdbcType=NVARCHAR},
      </if>
      <if test="remark1 != null">
        #{remark1,jdbcType=NVARCHAR},
      </if>
      <if test="remark2 != null">
        #{remark2,jdbcType=NVARCHAR},
      </if>
      <if test="parent != null">
        #{parent,jdbcType=NVARCHAR},
      </if>
      <if test="isable != null">
        #{isable,jdbcType=NVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.gyee.frame.model.auto.GyeePermissionExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from GYEEPERMISSION
    <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.
    -->
    update GYEEPERMISSION
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=NVARCHAR},
      </if>
      <if test="record.permisssionlevel != null">
        PERMISSSIONLEVEL = #{record.permisssionlevel,jdbcType=NVARCHAR},
      </if>
      <if test="record.permisssionname != null">
        PERMISSSIONNAME = #{record.permisssionname,jdbcType=NVARCHAR},
      </if>
      <if test="record.describes != null">
        DESCRIBES = #{record.describes,jdbcType=NVARCHAR},
      </if>
      <if test="record.remark1 != null">
        REMARK1 = #{record.remark1,jdbcType=NVARCHAR},
      </if>
      <if test="record.remark2 != null">
        REMARK2 = #{record.remark2,jdbcType=NVARCHAR},
      </if>
      <if test="record.parent != null">
        PARENT = #{record.parent,jdbcType=NVARCHAR},
      </if>
      <if test="record.isable != null">
        ISABLE = #{record.isable,jdbcType=NVARCHAR},
      </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.
    -->
    update GYEEPERMISSION
    set ID = #{record.id,jdbcType=NVARCHAR},
      PERMISSSIONLEVEL = #{record.permisssionlevel,jdbcType=NVARCHAR},
      PERMISSSIONNAME = #{record.permisssionname,jdbcType=NVARCHAR},
      DESCRIBES = #{record.describes,jdbcType=NVARCHAR},
      REMARK1 = #{record.remark1,jdbcType=NVARCHAR},
      REMARK2 = #{record.remark2,jdbcType=NVARCHAR},
      PARENT = #{record.parent,jdbcType=NVARCHAR},
      ISABLE = #{record.isable,jdbcType=NVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.GyeePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update GYEEPERMISSION
    <set>
      <if test="permisssionlevel != null">
        PERMISSSIONLEVEL = #{permisssionlevel,jdbcType=NVARCHAR},
      </if>
      <if test="permisssionname != null">
        PERMISSSIONNAME = #{permisssionname,jdbcType=NVARCHAR},
      </if>
      <if test="describes != null">
        DESCRIBES = #{describes,jdbcType=NVARCHAR},
      </if>
      <if test="remark1 != null">
        REMARK1 = #{remark1,jdbcType=NVARCHAR},
      </if>
      <if test="remark2 != null">
        REMARK2 = #{remark2,jdbcType=NVARCHAR},
      </if>
      <if test="parent != null">
        PARENT = #{parent,jdbcType=NVARCHAR},
      </if>
      <if test="isable != null">
        ISABLE = #{isable,jdbcType=NVARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=NVARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.GyeePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update GYEEPERMISSION
    set PERMISSSIONLEVEL = #{permisssionlevel,jdbcType=NVARCHAR},
      PERMISSSIONNAME = #{permisssionname,jdbcType=NVARCHAR},
      DESCRIBES = #{describes,jdbcType=NVARCHAR},
      REMARK1 = #{remark1,jdbcType=NVARCHAR},
      REMARK2 = #{remark2,jdbcType=NVARCHAR},
      PARENT = #{parent,jdbcType=NVARCHAR},
      ISABLE = #{isable,jdbcType=NVARCHAR}
    where ID = #{id,jdbcType=NVARCHAR}
  </update>
</mapper>