<?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.lightinit.hsdataportal.mapper.ResourceApiInterfaceMapper">
  <resultMap id="BaseResultMap" type="com.lightinit.hsdataportal.entity.ResourceApiInterface">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="api_id" jdbcType="BIGINT" property="apiId" />
    <result column="interface_name" jdbcType="VARCHAR" property="interfaceName" />
    <result column="interface_identity" jdbcType="VARCHAR" property="interfaceIdentity" />
    <result column="is_auth" jdbcType="TINYINT" property="isAuth" />
    <result column="request_method" jdbcType="VARCHAR" property="requestMethod" />
    <result column="response_format" jdbcType="VARCHAR" property="responseFormat" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
    <result column="deleted_by" jdbcType="BIGINT" property="deletedBy" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.lightinit.hsdataportal.entity.ResourceApiInterfaceWithBLOBs">
    <result column="url" jdbcType="LONGVARCHAR" property="url" />
    <result column="request_demo" jdbcType="LONGVARCHAR" property="requestDemo" />
    <result column="response_demo" jdbcType="LONGVARCHAR" property="responseDemo" />
    <result column="remark" jdbcType="LONGVARCHAR" property="remark" />
  </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, api_id, interface_name, interface_identity, is_auth, request_method, response_format, 
    created_at, created_by, deleted_at, deleted_by
  </sql>
  <sql id="Blob_Column_List">
    url, request_demo, response_demo, remark
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from resource_api_interface
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from resource_api_interface
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from resource_api_interface
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from resource_api_interface
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceExample">
    delete from resource_api_interface
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceWithBLOBs">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into resource_api_interface (api_id, interface_name, interface_identity, 
      is_auth, request_method, response_format, 
      created_at, created_by, deleted_at, 
      deleted_by, url, request_demo, 
      response_demo, remark)
    values (#{apiId,jdbcType=BIGINT}, #{interfaceName,jdbcType=VARCHAR}, #{interfaceIdentity,jdbcType=VARCHAR}, 
      #{isAuth,jdbcType=TINYINT}, #{requestMethod,jdbcType=VARCHAR}, #{responseFormat,jdbcType=VARCHAR}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{deletedAt,jdbcType=TIMESTAMP}, 
      #{deletedBy,jdbcType=BIGINT}, #{url,jdbcType=LONGVARCHAR}, #{requestDemo,jdbcType=LONGVARCHAR}, 
      #{responseDemo,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceWithBLOBs">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into resource_api_interface
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="apiId != null">
        api_id,
      </if>
      <if test="interfaceName != null">
        interface_name,
      </if>
      <if test="interfaceIdentity != null">
        interface_identity,
      </if>
      <if test="isAuth != null">
        is_auth,
      </if>
      <if test="requestMethod != null">
        request_method,
      </if>
      <if test="responseFormat != null">
        response_format,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="deletedAt != null">
        deleted_at,
      </if>
      <if test="deletedBy != null">
        deleted_by,
      </if>
      <if test="url != null">
        url,
      </if>
      <if test="requestDemo != null">
        request_demo,
      </if>
      <if test="responseDemo != null">
        response_demo,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="apiId != null">
        #{apiId,jdbcType=BIGINT},
      </if>
      <if test="interfaceName != null">
        #{interfaceName,jdbcType=VARCHAR},
      </if>
      <if test="interfaceIdentity != null">
        #{interfaceIdentity,jdbcType=VARCHAR},
      </if>
      <if test="isAuth != null">
        #{isAuth,jdbcType=TINYINT},
      </if>
      <if test="requestMethod != null">
        #{requestMethod,jdbcType=VARCHAR},
      </if>
      <if test="responseFormat != null">
        #{responseFormat,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="url != null">
        #{url,jdbcType=LONGVARCHAR},
      </if>
      <if test="requestDemo != null">
        #{requestDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseDemo != null">
        #{responseDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceExample" resultType="java.lang.Long">
    select count(*) from resource_api_interface
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update resource_api_interface
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.apiId != null">
        api_id = #{record.apiId,jdbcType=BIGINT},
      </if>
      <if test="record.interfaceName != null">
        interface_name = #{record.interfaceName,jdbcType=VARCHAR},
      </if>
      <if test="record.interfaceIdentity != null">
        interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
      </if>
      <if test="record.isAuth != null">
        is_auth = #{record.isAuth,jdbcType=TINYINT},
      </if>
      <if test="record.requestMethod != null">
        request_method = #{record.requestMethod,jdbcType=VARCHAR},
      </if>
      <if test="record.responseFormat != null">
        response_format = #{record.responseFormat,jdbcType=VARCHAR},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=BIGINT},
      </if>
      <if test="record.deletedAt != null">
        deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deletedBy != null">
        deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      </if>
      <if test="record.url != null">
        url = #{record.url,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.requestDemo != null">
        request_demo = #{record.requestDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.responseDemo != null">
        response_demo = #{record.responseDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update resource_api_interface
    set id = #{record.id,jdbcType=BIGINT},
      api_id = #{record.apiId,jdbcType=BIGINT},
      interface_name = #{record.interfaceName,jdbcType=VARCHAR},
      interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
      is_auth = #{record.isAuth,jdbcType=TINYINT},
      request_method = #{record.requestMethod,jdbcType=VARCHAR},
      response_format = #{record.responseFormat,jdbcType=VARCHAR},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      url = #{record.url,jdbcType=LONGVARCHAR},
      request_demo = #{record.requestDemo,jdbcType=LONGVARCHAR},
      response_demo = #{record.responseDemo,jdbcType=LONGVARCHAR},
      remark = #{record.remark,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update resource_api_interface
    set id = #{record.id,jdbcType=BIGINT},
      api_id = #{record.apiId,jdbcType=BIGINT},
      interface_name = #{record.interfaceName,jdbcType=VARCHAR},
      interface_identity = #{record.interfaceIdentity,jdbcType=VARCHAR},
      is_auth = #{record.isAuth,jdbcType=TINYINT},
      request_method = #{record.requestMethod,jdbcType=VARCHAR},
      response_format = #{record.responseFormat,jdbcType=VARCHAR},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceWithBLOBs">
    update resource_api_interface
    <set>
      <if test="apiId != null">
        api_id = #{apiId,jdbcType=BIGINT},
      </if>
      <if test="interfaceName != null">
        interface_name = #{interfaceName,jdbcType=VARCHAR},
      </if>
      <if test="interfaceIdentity != null">
        interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
      </if>
      <if test="isAuth != null">
        is_auth = #{isAuth,jdbcType=TINYINT},
      </if>
      <if test="requestMethod != null">
        request_method = #{requestMethod,jdbcType=VARCHAR},
      </if>
      <if test="responseFormat != null">
        response_format = #{responseFormat,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        deleted_by = #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="url != null">
        url = #{url,jdbcType=LONGVARCHAR},
      </if>
      <if test="requestDemo != null">
        request_demo = #{requestDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseDemo != null">
        response_demo = #{responseDemo,jdbcType=LONGVARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterfaceWithBLOBs">
    update resource_api_interface
    set api_id = #{apiId,jdbcType=BIGINT},
      interface_name = #{interfaceName,jdbcType=VARCHAR},
      interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
      is_auth = #{isAuth,jdbcType=TINYINT},
      request_method = #{requestMethod,jdbcType=VARCHAR},
      response_format = #{responseFormat,jdbcType=VARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT},
      url = #{url,jdbcType=LONGVARCHAR},
      request_demo = #{requestDemo,jdbcType=LONGVARCHAR},
      response_demo = #{responseDemo,jdbcType=LONGVARCHAR},
      remark = #{remark,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.lightinit.hsdataportal.entity.ResourceApiInterface">
    update resource_api_interface
    set api_id = #{apiId,jdbcType=BIGINT},
      interface_name = #{interfaceName,jdbcType=VARCHAR},
      interface_identity = #{interfaceIdentity,jdbcType=VARCHAR},
      is_auth = #{isAuth,jdbcType=TINYINT},
      request_method = #{requestMethod,jdbcType=VARCHAR},
      response_format = #{responseFormat,jdbcType=VARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>