<?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="cn.superdesk.uniorder.dao.mapper.sys.role.SysMenuOpenApiMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="belong_who" jdbcType="BIGINT" property="belongWho" />
    <result column="level" jdbcType="TINYINT" property="level" />
    <result column="request_type" jdbcType="VARCHAR" property="requestType" />
    <result column="clazz_url" jdbcType="VARCHAR" property="clazzUrl" />
    <result column="method_url" jdbcType="VARCHAR" property="methodUrl" />
    <result column="clazz_desc" jdbcType="VARCHAR" property="clazzDesc" />
    <result column="method_desc" jdbcType="VARCHAR" property="methodDesc" />
    <result column="clazz_name" jdbcType="VARCHAR" property="clazzName" />
    <result column="method_name" jdbcType="VARCHAR" property="methodName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
    <result column="update_user_name" jdbcType="VARCHAR" property="updateUserName" />
    <result column="deleted" jdbcType="TINYINT" property="deleted" />
    <result column="enabled" jdbcType="TINYINT" property="enabled" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, belong_who, level, request_type, clazz_url, method_url, clazz_desc, method_desc, 
    clazz_name, method_name, create_time, create_user_id, create_user_name, update_time, 
    update_user_id, update_user_name, deleted, enabled
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApiExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_menu_open_api
    <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.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from sys_menu_open_api
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_menu_open_api
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApiExample">
    delete from sys_menu_open_api
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_menu_open_api (belong_who, level, request_type, 
      clazz_url, method_url, clazz_desc, 
      method_desc, clazz_name, method_name, 
      create_time, create_user_id, create_user_name, 
      update_time, update_user_id, update_user_name, 
      deleted, enabled)
    values (#{belongWho,jdbcType=BIGINT}, #{level,jdbcType=TINYINT}, #{requestType,jdbcType=VARCHAR}, 
      #{clazzUrl,jdbcType=VARCHAR}, #{methodUrl,jdbcType=VARCHAR}, #{clazzDesc,jdbcType=VARCHAR}, 
      #{methodDesc,jdbcType=VARCHAR}, #{clazzName,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}, #{updateUserName,jdbcType=VARCHAR}, 
      #{deleted,jdbcType=TINYINT}, #{enabled,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_menu_open_api
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="belongWho != null">
        belong_who,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="requestType != null">
        request_type,
      </if>
      <if test="clazzUrl != null">
        clazz_url,
      </if>
      <if test="methodUrl != null">
        method_url,
      </if>
      <if test="clazzDesc != null">
        clazz_desc,
      </if>
      <if test="methodDesc != null">
        method_desc,
      </if>
      <if test="clazzName != null">
        clazz_name,
      </if>
      <if test="methodName != null">
        method_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="updateUserName != null">
        update_user_name,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="enabled != null">
        enabled,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="belongWho != null">
        #{belongWho,jdbcType=BIGINT},
      </if>
      <if test="level != null">
        #{level,jdbcType=TINYINT},
      </if>
      <if test="requestType != null">
        #{requestType,jdbcType=VARCHAR},
      </if>
      <if test="clazzUrl != null">
        #{clazzUrl,jdbcType=VARCHAR},
      </if>
      <if test="methodUrl != null">
        #{methodUrl,jdbcType=VARCHAR},
      </if>
      <if test="clazzDesc != null">
        #{clazzDesc,jdbcType=VARCHAR},
      </if>
      <if test="methodDesc != null">
        #{methodDesc,jdbcType=VARCHAR},
      </if>
      <if test="clazzName != null">
        #{clazzName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateUserName != null">
        #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=TINYINT},
      </if>
      <if test="enabled != null">
        #{enabled,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApiExample" resultType="java.lang.Long">
    select count(*) from sys_menu_open_api
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update sys_menu_open_api
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.belongWho != null">
        belong_who = #{record.belongWho,jdbcType=BIGINT},
      </if>
      <if test="record.level != null">
        level = #{record.level,jdbcType=TINYINT},
      </if>
      <if test="record.requestType != null">
        request_type = #{record.requestType,jdbcType=VARCHAR},
      </if>
      <if test="record.clazzUrl != null">
        clazz_url = #{record.clazzUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.methodUrl != null">
        method_url = #{record.methodUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.clazzDesc != null">
        clazz_desc = #{record.clazzDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.methodDesc != null">
        method_desc = #{record.methodDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.clazzName != null">
        clazz_name = #{record.clazzName,jdbcType=VARCHAR},
      </if>
      <if test="record.methodName != null">
        method_name = #{record.methodName,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateUserName != null">
        update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=TINYINT},
      </if>
      <if test="record.enabled != null">
        enabled = #{record.enabled,jdbcType=TINYINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update sys_menu_open_api
    set id = #{record.id,jdbcType=BIGINT},
      belong_who = #{record.belongWho,jdbcType=BIGINT},
      level = #{record.level,jdbcType=TINYINT},
      request_type = #{record.requestType,jdbcType=VARCHAR},
      clazz_url = #{record.clazzUrl,jdbcType=VARCHAR},
      method_url = #{record.methodUrl,jdbcType=VARCHAR},
      clazz_desc = #{record.clazzDesc,jdbcType=VARCHAR},
      method_desc = #{record.methodDesc,jdbcType=VARCHAR},
      clazz_name = #{record.clazzName,jdbcType=VARCHAR},
      method_name = #{record.methodName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      deleted = #{record.deleted,jdbcType=TINYINT},
      enabled = #{record.enabled,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi">
    update sys_menu_open_api
    <set>
      <if test="belongWho != null">
        belong_who = #{belongWho,jdbcType=BIGINT},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=TINYINT},
      </if>
      <if test="requestType != null">
        request_type = #{requestType,jdbcType=VARCHAR},
      </if>
      <if test="clazzUrl != null">
        clazz_url = #{clazzUrl,jdbcType=VARCHAR},
      </if>
      <if test="methodUrl != null">
        method_url = #{methodUrl,jdbcType=VARCHAR},
      </if>
      <if test="clazzDesc != null">
        clazz_desc = #{clazzDesc,jdbcType=VARCHAR},
      </if>
      <if test="methodDesc != null">
        method_desc = #{methodDesc,jdbcType=VARCHAR},
      </if>
      <if test="clazzName != null">
        clazz_name = #{clazzName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        method_name = #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateUserName != null">
        update_user_name = #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=TINYINT},
      </if>
      <if test="enabled != null">
        enabled = #{enabled,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysMenuOpenApi">
    update sys_menu_open_api
    set belong_who = #{belongWho,jdbcType=BIGINT},
      level = #{level,jdbcType=TINYINT},
      request_type = #{requestType,jdbcType=VARCHAR},
      clazz_url = #{clazzUrl,jdbcType=VARCHAR},
      method_url = #{methodUrl,jdbcType=VARCHAR},
      clazz_desc = #{clazzDesc,jdbcType=VARCHAR},
      method_desc = #{methodDesc,jdbcType=VARCHAR},
      clazz_name = #{clazzName,jdbcType=VARCHAR},
      method_name = #{methodName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=TINYINT},
      enabled = #{enabled,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>