package com.hfkj.dao;

import com.hfkj.entity.BsMer;
import com.hfkj.entity.BsMerExample;
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 BsMerMapper extends BsMerMapperExt {
    @SelectProvider(type=BsMerSqlProvider.class, method="countByExample")
    long countByExample(BsMerExample example);

    @DeleteProvider(type=BsMerSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsMerExample example);

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

    @Insert({
        "insert into bs_mer (org_no, org_name, ",
        "company_id, company_name, ",
        "agent_id, agent_name, ",
        "salesman_id, salesman_name, ",
        "reg_phone, reg_name, ",
        "reg_email, mer_type, ",
        "mer_no, mer_name, ",
        "mer_abbreviate, mer_operate_type, ",
        "mer_online_type, mer_online_name, ",
        "mer_mcc_code, mer_mcc_name, ",
        "blis_url, blis_name, ",
        "blis_no, blis_reg_address, ",
        "blis_period_type, blis_period_start, ",
        "blis_period_end, lar_name, ",
        "lar_id_card, lar_id_card_portrait_img, ",
        "lar_id_card_national_emblem_img, lar_id_card_address, ",
        "lar_id_card_period_type, lar_id_card_period_start, ",
        "lar_id_card_period_end, complete_status, ",
        "mer_status, create_salesman_id, ",
        "create_salesman_name, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{orgNo,jdbcType=VARCHAR}, #{orgName,jdbcType=VARCHAR}, ",
        "#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
        "#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
        "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
        "#{regPhone,jdbcType=VARCHAR}, #{regName,jdbcType=VARCHAR}, ",
        "#{regEmail,jdbcType=VARCHAR}, #{merType,jdbcType=INTEGER}, ",
        "#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
        "#{merAbbreviate,jdbcType=VARCHAR}, #{merOperateType,jdbcType=INTEGER}, ",
        "#{merOnlineType,jdbcType=INTEGER}, #{merOnlineName,jdbcType=VARCHAR}, ",
        "#{merMccCode,jdbcType=VARCHAR}, #{merMccName,jdbcType=VARCHAR}, ",
        "#{blisUrl,jdbcType=VARCHAR}, #{blisName,jdbcType=VARCHAR}, ",
        "#{blisNo,jdbcType=VARCHAR}, #{blisRegAddress,jdbcType=VARCHAR}, ",
        "#{blisPeriodType,jdbcType=INTEGER}, #{blisPeriodStart,jdbcType=VARCHAR}, ",
        "#{blisPeriodEnd,jdbcType=VARCHAR}, #{larName,jdbcType=VARCHAR}, ",
        "#{larIdCard,jdbcType=VARCHAR}, #{larIdCardPortraitImg,jdbcType=VARCHAR}, ",
        "#{larIdCardNationalEmblemImg,jdbcType=VARCHAR}, #{larIdCardAddress,jdbcType=VARCHAR}, ",
        "#{larIdCardPeriodType,jdbcType=INTEGER}, #{larIdCardPeriodStart,jdbcType=VARCHAR}, ",
        "#{larIdCardPeriodEnd,jdbcType=VARCHAR}, #{completeStatus,jdbcType=INTEGER}, ",
        "#{merStatus,jdbcType=INTEGER}, #{createSalesmanId,jdbcType=BIGINT}, ",
        "#{createSalesmanName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsMer record);

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

    @SelectProvider(type=BsMerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="org_no", property="orgNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="org_name", property="orgName", jdbcType=JdbcType.VARCHAR),
        @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="reg_phone", property="regPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_name", property="regName", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_email", property="regEmail", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_type", property="merType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_operate_type", property="merOperateType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_online_type", property="merOnlineType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_online_name", property="merOnlineName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_mcc_code", property="merMccCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_mcc_name", property="merMccName", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_url", property="blisUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_name", property="blisName", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_no", property="blisNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_reg_address", property="blisRegAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_period_type", property="blisPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="blis_period_start", property="blisPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_period_end", property="blisPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_name", property="larName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card", property="larIdCard", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_portrait_img", property="larIdCardPortraitImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_national_emblem_img", property="larIdCardNationalEmblemImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_address", property="larIdCardAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_period_type", property="larIdCardPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="lar_id_card_period_start", property="larIdCardPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_period_end", property="larIdCardPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="complete_status", property="completeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_status", property="merStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_salesman_id", property="createSalesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="create_salesman_name", property="createSalesmanName", jdbcType=JdbcType.VARCHAR),
        @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<BsMer> selectByExample(BsMerExample example);

    @Select({
        "select",
        "id, org_no, org_name, company_id, company_name, agent_id, agent_name, salesman_id, ",
        "salesman_name, reg_phone, reg_name, reg_email, mer_type, mer_no, mer_name, mer_abbreviate, ",
        "mer_operate_type, mer_online_type, mer_online_name, mer_mcc_code, mer_mcc_name, ",
        "blis_url, blis_name, blis_no, blis_reg_address, blis_period_type, blis_period_start, ",
        "blis_period_end, lar_name, lar_id_card, lar_id_card_portrait_img, lar_id_card_national_emblem_img, ",
        "lar_id_card_address, lar_id_card_period_type, lar_id_card_period_start, lar_id_card_period_end, ",
        "complete_status, mer_status, create_salesman_id, create_salesman_name, create_time, ",
        "update_time, ext_1, ext_2, ext_3",
        "from bs_mer",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="org_no", property="orgNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="org_name", property="orgName", jdbcType=JdbcType.VARCHAR),
        @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="reg_phone", property="regPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_name", property="regName", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_email", property="regEmail", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_type", property="merType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_operate_type", property="merOperateType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_online_type", property="merOnlineType", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_online_name", property="merOnlineName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_mcc_code", property="merMccCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_mcc_name", property="merMccName", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_url", property="blisUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_name", property="blisName", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_no", property="blisNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_reg_address", property="blisRegAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_period_type", property="blisPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="blis_period_start", property="blisPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="blis_period_end", property="blisPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_name", property="larName", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card", property="larIdCard", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_portrait_img", property="larIdCardPortraitImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_national_emblem_img", property="larIdCardNationalEmblemImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_address", property="larIdCardAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_period_type", property="larIdCardPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="lar_id_card_period_start", property="larIdCardPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="lar_id_card_period_end", property="larIdCardPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="complete_status", property="completeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="mer_status", property="merStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_salesman_id", property="createSalesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="create_salesman_name", property="createSalesmanName", jdbcType=JdbcType.VARCHAR),
        @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)
    })
    BsMer selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsMerSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsMer record, @Param("example") BsMerExample example);

    @UpdateProvider(type=BsMerSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsMer record, @Param("example") BsMerExample example);

    @UpdateProvider(type=BsMerSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsMer record);

    @Update({
        "update bs_mer",
        "set org_no = #{orgNo,jdbcType=VARCHAR},",
          "org_name = #{orgName,jdbcType=VARCHAR},",
          "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},",
          "reg_phone = #{regPhone,jdbcType=VARCHAR},",
          "reg_name = #{regName,jdbcType=VARCHAR},",
          "reg_email = #{regEmail,jdbcType=VARCHAR},",
          "mer_type = #{merType,jdbcType=INTEGER},",
          "mer_no = #{merNo,jdbcType=VARCHAR},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR},",
          "mer_operate_type = #{merOperateType,jdbcType=INTEGER},",
          "mer_online_type = #{merOnlineType,jdbcType=INTEGER},",
          "mer_online_name = #{merOnlineName,jdbcType=VARCHAR},",
          "mer_mcc_code = #{merMccCode,jdbcType=VARCHAR},",
          "mer_mcc_name = #{merMccName,jdbcType=VARCHAR},",
          "blis_url = #{blisUrl,jdbcType=VARCHAR},",
          "blis_name = #{blisName,jdbcType=VARCHAR},",
          "blis_no = #{blisNo,jdbcType=VARCHAR},",
          "blis_reg_address = #{blisRegAddress,jdbcType=VARCHAR},",
          "blis_period_type = #{blisPeriodType,jdbcType=INTEGER},",
          "blis_period_start = #{blisPeriodStart,jdbcType=VARCHAR},",
          "blis_period_end = #{blisPeriodEnd,jdbcType=VARCHAR},",
          "lar_name = #{larName,jdbcType=VARCHAR},",
          "lar_id_card = #{larIdCard,jdbcType=VARCHAR},",
          "lar_id_card_portrait_img = #{larIdCardPortraitImg,jdbcType=VARCHAR},",
          "lar_id_card_national_emblem_img = #{larIdCardNationalEmblemImg,jdbcType=VARCHAR},",
          "lar_id_card_address = #{larIdCardAddress,jdbcType=VARCHAR},",
          "lar_id_card_period_type = #{larIdCardPeriodType,jdbcType=INTEGER},",
          "lar_id_card_period_start = #{larIdCardPeriodStart,jdbcType=VARCHAR},",
          "lar_id_card_period_end = #{larIdCardPeriodEnd,jdbcType=VARCHAR},",
          "complete_status = #{completeStatus,jdbcType=INTEGER},",
          "mer_status = #{merStatus,jdbcType=INTEGER},",
          "create_salesman_id = #{createSalesmanId,jdbcType=BIGINT},",
          "create_salesman_name = #{createSalesmanName,jdbcType=VARCHAR},",
          "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(BsMer record);
}