package com.hfkj.dao;

import com.hfkj.entity.BsUserLoginLog;
import com.hfkj.entity.BsUserLoginLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface BsUserLoginLogMapper extends BsUserLoginLogMapperExt {
    @SelectProvider(type=BsUserLoginLogSqlProvider.class, method="countByExample")
    long countByExample(BsUserLoginLogExample example);

    @DeleteProvider(type=BsUserLoginLogSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsUserLoginLogExample example);

    @Delete({
        "delete from bs_user_login_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into bs_user_login_log (user_id, platform_code, ",
        "platform_name, login_type_code, ",
        "login_type_name, ip, ",
        "country, region_id, ",
        "region_name, city_id, ",
        "city_name, isp, `status`, ",
        "remark, create_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{userId,jdbcType=BIGINT}, #{platformCode,jdbcType=VARCHAR}, ",
        "#{platformName,jdbcType=VARCHAR}, #{loginTypeCode,jdbcType=VARCHAR}, ",
        "#{loginTypeName,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, ",
        "#{country,jdbcType=VARCHAR}, #{regionId,jdbcType=VARCHAR}, ",
        "#{regionName,jdbcType=VARCHAR}, #{cityId,jdbcType=VARCHAR}, ",
        "#{cityName,jdbcType=VARCHAR}, #{isp,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsUserLoginLog record);

    @InsertProvider(type=BsUserLoginLogSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(BsUserLoginLog record);

    @SelectProvider(type=BsUserLoginLogSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_name", property="platformName", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_type_code", property="loginTypeCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_type_name", property="loginTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="country", property="country", jdbcType=JdbcType.VARCHAR),
        @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="isp", property="isp", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<BsUserLoginLog> selectByExample(BsUserLoginLogExample example);

    @Select({
        "select",
        "id, user_id, platform_code, platform_name, login_type_code, login_type_name, ",
        "ip, country, region_id, region_name, city_id, city_name, isp, `status`, remark, ",
        "create_time, ext_1, ext_2, ext_3",
        "from bs_user_login_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_name", property="platformName", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_type_code", property="loginTypeCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_type_name", property="loginTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="country", property="country", jdbcType=JdbcType.VARCHAR),
        @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="isp", property="isp", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    BsUserLoginLog selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsUserLoginLog record, @Param("example") BsUserLoginLogExample example);

    @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsUserLoginLog record, @Param("example") BsUserLoginLogExample example);

    @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsUserLoginLog record);

    @Update({
        "update bs_user_login_log",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "platform_code = #{platformCode,jdbcType=VARCHAR},",
          "platform_name = #{platformName,jdbcType=VARCHAR},",
          "login_type_code = #{loginTypeCode,jdbcType=VARCHAR},",
          "login_type_name = #{loginTypeName,jdbcType=VARCHAR},",
          "ip = #{ip,jdbcType=VARCHAR},",
          "country = #{country,jdbcType=VARCHAR},",
          "region_id = #{regionId,jdbcType=VARCHAR},",
          "region_name = #{regionName,jdbcType=VARCHAR},",
          "city_id = #{cityId,jdbcType=VARCHAR},",
          "city_name = #{cityName,jdbcType=VARCHAR},",
          "isp = #{isp,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsUserLoginLog record);
}