<?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.cool.store.mapper.HyAdvancedSettingMapper">
  <resultMap id="BaseResultMap" type="com.cool.store.entity.HyAdvancedSettingDO">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="partner_url" jdbcType="VARCHAR" property="partnerUrl" />
    <result column="allocation_roles" jdbcType="VARCHAR" property="allocationRoles" />
    <result column="tencent_video_account" jdbcType="VARCHAR" property="tencentVideoAccount" />
    <result column="tencent_video_key" jdbcType="VARCHAR" property="tencentVideoKey" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
  </resultMap>
  <sql id="Base_Column_List">
    id, partner_url, allocation_roles, tencent_video_account, tencent_video_key, create_time, 
    update_time, create_user_id, update_user_id
  </sql>

  <select id="selectAdvanceSetting" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"></include>
    from hy_advanced_setting
  </select>

  <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
    insert into hy_advanced_setting
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="record.partnerUrl != null">
        partner_url,
      </if>
      <if test="record.allocationRoles != null">
        allocation_roles,
      </if>
      <if test="record.tencentVideoAccount != null">
        tencent_video_account,
      </if>
      <if test="record.tencentVideoKey != null">
        tencent_video_key,
      </if>
      <if test="record.createTime != null">
        create_time,
      </if>
      <if test="record.updateTime != null">
        update_time,
      </if>
      <if test="record.createUserId != null">
        create_user_id,
      </if>
      <if test="record.updateUserId != null">
        update_user_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="record.partnerUrl != null">
        #{record.partnerUrl},
      </if>
      <if test="record.allocationRoles != null">
        #{record.allocationRoles},
      </if>
      <if test="record.tencentVideoAccount != null">
        #{record.tencentVideoAccount},
      </if>
      <if test="record.tencentVideoKey != null">
        #{record.tencentVideoKey},
      </if>
      <if test="record.createTime != null">
        #{record.createTime},
      </if>
      <if test="record.updateTime != null">
        #{record.updateTime},
      </if>
      <if test="record.createUserId != null">
        #{record.createUserId},
      </if>
      <if test="record.updateUserId != null">
        #{record.updateUserId},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective">
    update hy_advanced_setting
    set
        partner_url = #{record.partnerUrl},
        tencent_video_account = #{record.tencentVideoAccount},
        tencent_video_key = #{record.tencentVideoKey},
        update_user_id = #{record.updateUserId}
    where id = #{record.id}
  </update>
</mapper>