package com.hfkj.dao;

import com.hfkj.entity.BsPayQrCode;
import com.hfkj.entity.BsPayQrCodeExample;
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 BsPayQrCodeMapper extends BsPayQrCodeMapperExt {
    @SelectProvider(type=BsPayQrCodeSqlProvider.class, method="countByExample")
    long countByExample(BsPayQrCodeExample example);

    @DeleteProvider(type=BsPayQrCodeSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsPayQrCodeExample example);

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

    @Insert({
        "insert into bs_pay_qr_code (company_id, company_name, ",
        "agent_id, agent_name, ",
        "salesman_id, salesman_name, ",
        "mer_id, mer_name, store_id, ",
        "store_name, store_bind_time, ",
        "serial_number, qr_code_url, ",
        "qr_code_data, wechat_qr_code_url, ",
        "`status`, create_time, ",
        "update_time, op_user_id, ",
        "op_user_name, ext_1, ",
        "ext_2, ext_3)",
        "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
        "#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
        "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
        "#{storeName,jdbcType=VARCHAR}, #{storeBindTime,jdbcType=TIMESTAMP}, ",
        "#{serialNumber,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR}, ",
        "#{qrCodeData,jdbcType=VARCHAR}, #{wechatQrCodeUrl,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{opUserId,jdbcType=BIGINT}, ",
        "#{opUserName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsPayQrCode record);

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

    @SelectProvider(type=BsPayQrCodeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_bind_time", property="storeBindTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="qr_code_url", property="qrCodeUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="qr_code_data", property="qrCodeData", jdbcType=JdbcType.VARCHAR),
        @Result(column="wechat_qr_code_url", property="wechatQrCodeUrl", 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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @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<BsPayQrCode> selectByExample(BsPayQrCodeExample example);

    @Select({
        "select",
        "id, company_id, company_name, agent_id, agent_name, salesman_id, salesman_name, ",
        "mer_id, mer_name, store_id, store_name, store_bind_time, serial_number, qr_code_url, ",
        "qr_code_data, wechat_qr_code_url, `status`, create_time, update_time, op_user_id, ",
        "op_user_name, ext_1, ext_2, ext_3",
        "from bs_pay_qr_code",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_bind_time", property="storeBindTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="serial_number", property="serialNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="qr_code_url", property="qrCodeUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="qr_code_data", property="qrCodeData", jdbcType=JdbcType.VARCHAR),
        @Result(column="wechat_qr_code_url", property="wechatQrCodeUrl", 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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @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)
    })
    BsPayQrCode selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsPayQrCodeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsPayQrCode record, @Param("example") BsPayQrCodeExample example);

    @UpdateProvider(type=BsPayQrCodeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsPayQrCode record, @Param("example") BsPayQrCodeExample example);

    @UpdateProvider(type=BsPayQrCodeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsPayQrCode record);

    @Update({
        "update bs_pay_qr_code",
        "set company_id = #{companyId,jdbcType=BIGINT},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "agent_id = #{agentId,jdbcType=BIGINT},",
          "agent_name = #{agentName,jdbcType=VARCHAR},",
          "salesman_id = #{salesmanId,jdbcType=BIGINT},",
          "salesman_name = #{salesmanName,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "store_id = #{storeId,jdbcType=BIGINT},",
          "store_name = #{storeName,jdbcType=VARCHAR},",
          "store_bind_time = #{storeBindTime,jdbcType=TIMESTAMP},",
          "serial_number = #{serialNumber,jdbcType=VARCHAR},",
          "qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR},",
          "qr_code_data = #{qrCodeData,jdbcType=VARCHAR},",
          "wechat_qr_code_url = #{wechatQrCodeUrl,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "op_user_id = #{opUserId,jdbcType=BIGINT},",
          "op_user_name = #{opUserName,jdbcType=VARCHAR},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsPayQrCode record);
}