<?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.goafanti.common.dao.SkjtRolePermissionMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.SkjtRolePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    <id column="rid" jdbcType="VARCHAR" property="rid" />
    <id column="pid" jdbcType="VARCHAR" property="pid" />
    <result column="assigner" jdbcType="VARCHAR" property="assigner" />
    <result column="allocate_time" jdbcType="TIMESTAMP" property="allocateTime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    <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.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    <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.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    rid, pid, assigner, allocate_time
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.SkjtRolePermissionExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from skjt_role_permission
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="com.goafanti.common.model.SkjtRolePermissionKey" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    select 
    <include refid="Base_Column_List" />
    from skjt_role_permission
    where rid = #{rid,jdbcType=VARCHAR}
      and pid = #{pid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.goafanti.common.model.SkjtRolePermissionKey">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    delete from skjt_role_permission
    where rid = #{rid,jdbcType=VARCHAR}
      and pid = #{pid,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.SkjtRolePermissionExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    delete from skjt_role_permission
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.SkjtRolePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    insert into skjt_role_permission (rid, pid, assigner, 
      allocate_time)
    values (#{rid,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{assigner,jdbcType=VARCHAR}, 
      #{allocateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.SkjtRolePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    insert into skjt_role_permission
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="rid != null">
        rid,
      </if>
      <if test="pid != null">
        pid,
      </if>
      <if test="assigner != null">
        assigner,
      </if>
      <if test="allocateTime != null">
        allocate_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="rid != null">
        #{rid,jdbcType=VARCHAR},
      </if>
      <if test="pid != null">
        #{pid,jdbcType=VARCHAR},
      </if>
      <if test="assigner != null">
        #{assigner,jdbcType=VARCHAR},
      </if>
      <if test="allocateTime != null">
        #{allocateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.SkjtRolePermissionExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    select count(*) from skjt_role_permission
    <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.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    update skjt_role_permission
    <set>
      <if test="record.rid != null">
        rid = #{record.rid,jdbcType=VARCHAR},
      </if>
      <if test="record.pid != null">
        pid = #{record.pid,jdbcType=VARCHAR},
      </if>
      <if test="record.assigner != null">
        assigner = #{record.assigner,jdbcType=VARCHAR},
      </if>
      <if test="record.allocateTime != null">
        allocate_time = #{record.allocateTime,jdbcType=TIMESTAMP},
      </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.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    update skjt_role_permission
    set rid = #{record.rid,jdbcType=VARCHAR},
      pid = #{record.pid,jdbcType=VARCHAR},
      assigner = #{record.assigner,jdbcType=VARCHAR},
      allocate_time = #{record.allocateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.SkjtRolePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    update skjt_role_permission
    <set>
      <if test="assigner != null">
        assigner = #{assigner,jdbcType=VARCHAR},
      </if>
      <if test="allocateTime != null">
        allocate_time = #{allocateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where rid = #{rid,jdbcType=VARCHAR}
      and pid = #{pid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.SkjtRolePermission">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 22 11:24:43 CST 2020.
    -->
    update skjt_role_permission
    set assigner = #{assigner,jdbcType=VARCHAR},
      allocate_time = #{allocateTime,jdbcType=TIMESTAMP}
    where rid = #{rid,jdbcType=VARCHAR}
      and pid = #{pid,jdbcType=VARCHAR}
  </update>
</mapper>