package com.hfkj.dao;

import com.hfkj.entity.BsOrderStarbucks;
import com.hfkj.entity.BsOrderStarbucksExample;
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 BsOrderStarbucksMapper extends BsOrderStarbucksMapperExt {
    @SelectProvider(type=BsOrderStarbucksSqlProvider.class, method="countByExample")
    long countByExample(BsOrderStarbucksExample example);

    @DeleteProvider(type=BsOrderStarbucksSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderStarbucksExample example);

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

    @Insert({
        "insert into bs_order_starbucks (store_code, platform_code, ",
        "platform_unique_id, product_id, ",
        "cup_size, temperature, ",
        "cream, espresso, ",
        "milk, milk_bubble, ",
        "num, img, `name`, ",
        "order_no, child_order_no, ",
        "mer_id, user_id, user_phone, ",
        "price, store_address, ",
        "store_name, pay_type, ",
        "`status`, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{storeCode,jdbcType=VARCHAR}, #{platformCode,jdbcType=VARCHAR}, ",
        "#{platformUniqueId,jdbcType=VARCHAR}, #{productId,jdbcType=INTEGER}, ",
        "#{cupSize,jdbcType=VARCHAR}, #{temperature,jdbcType=VARCHAR}, ",
        "#{cream,jdbcType=VARCHAR}, #{espresso,jdbcType=VARCHAR}, ",
        "#{milk,jdbcType=VARCHAR}, #{milkBubble,jdbcType=VARCHAR}, ",
        "#{num,jdbcType=INTEGER}, #{img,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ",
        "#{price,jdbcType=DECIMAL}, #{storeAddress,jdbcType=VARCHAR}, ",
        "#{storeName,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ",
        "#{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(BsOrderStarbucks record);

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

    @SelectProvider(type=BsOrderStarbucksSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="store_code", property="storeCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_unique_id", property="platformUniqueId", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="cup_size", property="cupSize", jdbcType=JdbcType.VARCHAR),
        @Result(column="temperature", property="temperature", jdbcType=JdbcType.VARCHAR),
        @Result(column="cream", property="cream", jdbcType=JdbcType.VARCHAR),
        @Result(column="espresso", property="espresso", jdbcType=JdbcType.VARCHAR),
        @Result(column="milk", property="milk", jdbcType=JdbcType.VARCHAR),
        @Result(column="milk_bubble", property="milkBubble", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="store_address", property="storeAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @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<BsOrderStarbucks> selectByExample(BsOrderStarbucksExample example);

    @Select({
        "select",
        "id, store_code, platform_code, platform_unique_id, product_id, cup_size, temperature, ",
        "cream, espresso, milk, milk_bubble, num, img, `name`, order_no, child_order_no, ",
        "mer_id, user_id, user_phone, price, store_address, store_name, pay_type, `status`, ",
        "create_time, update_time, ext_1, ext_2, ext_3",
        "from bs_order_starbucks",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="store_code", property="storeCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_unique_id", property="platformUniqueId", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="cup_size", property="cupSize", jdbcType=JdbcType.VARCHAR),
        @Result(column="temperature", property="temperature", jdbcType=JdbcType.VARCHAR),
        @Result(column="cream", property="cream", jdbcType=JdbcType.VARCHAR),
        @Result(column="espresso", property="espresso", jdbcType=JdbcType.VARCHAR),
        @Result(column="milk", property="milk", jdbcType=JdbcType.VARCHAR),
        @Result(column="milk_bubble", property="milkBubble", jdbcType=JdbcType.VARCHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="store_address", property="storeAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @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)
    })
    BsOrderStarbucks selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderStarbucksSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderStarbucks record, @Param("example") BsOrderStarbucksExample example);

    @UpdateProvider(type=BsOrderStarbucksSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderStarbucks record, @Param("example") BsOrderStarbucksExample example);

    @UpdateProvider(type=BsOrderStarbucksSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderStarbucks record);

    @Update({
        "update bs_order_starbucks",
        "set store_code = #{storeCode,jdbcType=VARCHAR},",
          "platform_code = #{platformCode,jdbcType=VARCHAR},",
          "platform_unique_id = #{platformUniqueId,jdbcType=VARCHAR},",
          "product_id = #{productId,jdbcType=INTEGER},",
          "cup_size = #{cupSize,jdbcType=VARCHAR},",
          "temperature = #{temperature,jdbcType=VARCHAR},",
          "cream = #{cream,jdbcType=VARCHAR},",
          "espresso = #{espresso,jdbcType=VARCHAR},",
          "milk = #{milk,jdbcType=VARCHAR},",
          "milk_bubble = #{milkBubble,jdbcType=VARCHAR},",
          "num = #{num,jdbcType=INTEGER},",
          "img = #{img,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "price = #{price,jdbcType=DECIMAL},",
          "store_address = #{storeAddress,jdbcType=VARCHAR},",
          "store_name = #{storeName,jdbcType=VARCHAR},",
          "pay_type = #{payType,jdbcType=INTEGER},",
          "`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(BsOrderStarbucks record);
}