package com.hai.dao;

import com.hai.entity.HighDevice;
import com.hai.entity.HighDeviceExample;
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 HighDeviceMapper extends HighDeviceMapperExt {
    @SelectProvider(type=HighDeviceSqlProvider.class, method="countByExample")
    long countByExample(HighDeviceExample example);

    @DeleteProvider(type=HighDeviceSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighDeviceExample example);

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

    @Insert({
        "insert into high_device (`type`, company_id, ",
        "company_name, mer_id, ",
        "mer_name, mer_store_id, ",
        "mer_store_name, device_name, ",
        "device_sn, device_key, ",
        "device_imei, device_iccid, ",
        "receipt_top, receipt_source, ",
        "receipt_bottom, `status`, ",
        "create_time, update_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
        "#{companyName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
        "#{merName,jdbcType=VARCHAR}, #{merStoreId,jdbcType=BIGINT}, ",
        "#{merStoreName,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, ",
        "#{deviceSn,jdbcType=VARCHAR}, #{deviceKey,jdbcType=VARCHAR}, ",
        "#{deviceImei,jdbcType=VARCHAR}, #{deviceIccid,jdbcType=VARCHAR}, ",
        "#{receiptTop,jdbcType=VARCHAR}, #{receiptSource,jdbcType=VARCHAR}, ",
        "#{receiptBottom,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighDevice record);

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

    @SelectProvider(type=HighDeviceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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<HighDevice> selectByExample(HighDeviceExample example);

    @Select({
        "select",
        "id, `type`, company_id, company_name, mer_id, mer_name, mer_store_id, mer_store_name, ",
        "device_name, device_sn, device_key, device_imei, device_iccid, receipt_top, ",
        "receipt_source, receipt_bottom, `status`, create_time, update_time, ext_1, ext_2, ",
        "ext_3",
        "from high_device",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
        @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
        @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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)
    })
    HighDevice selectByPrimaryKey(Long id);

    @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighDevice record, @Param("example") HighDeviceExample example);

    @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighDevice record, @Param("example") HighDeviceExample example);

    @UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighDevice record);

    @Update({
        "update high_device",
        "set `type` = #{type,jdbcType=INTEGER},",
          "company_id = #{companyId,jdbcType=BIGINT},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "mer_store_id = #{merStoreId,jdbcType=BIGINT},",
          "mer_store_name = #{merStoreName,jdbcType=VARCHAR},",
          "device_name = #{deviceName,jdbcType=VARCHAR},",
          "device_sn = #{deviceSn,jdbcType=VARCHAR},",
          "device_key = #{deviceKey,jdbcType=VARCHAR},",
          "device_imei = #{deviceImei,jdbcType=VARCHAR},",
          "device_iccid = #{deviceIccid,jdbcType=VARCHAR},",
          "receipt_top = #{receiptTop,jdbcType=VARCHAR},",
          "receipt_source = #{receiptSource,jdbcType=VARCHAR},",
          "receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(HighDevice record);
}