package com.hai.dao;

import com.hai.entity.ApiStarbucksProducts;
import com.hai.entity.ApiStarbucksProductsExample;
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 ApiStarbucksProductsMapper extends ApiStarbucksProductsMapperExt {
    @SelectProvider(type=ApiStarbucksProductsSqlProvider.class, method="countByExample")
    long countByExample(ApiStarbucksProductsExample example);

    @DeleteProvider(type=ApiStarbucksProductsSqlProvider.class, method="deleteByExample")
    int deleteByExample(ApiStarbucksProductsExample example);

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

    @Insert({
        "insert into api_starbucks_products (goods_id, `name`, ",
        "des, default_image, ",
        "cup_size, temperature, ",
        "cream, espresso, ",
        "milk, milk_bubble, ",
        "category_name, market_tall_price, ",
        "market_grande_price, market_venti_price, ",
        "sales_tall_price, sales_grande_price, ",
        "sales_venti_price, operator_id, ",
        "operator_name, create_time, ",
        "update_time, `status`, ",
        "ext_1, ext_2, ext_3)",
        "values (#{goodsId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
        "#{des,jdbcType=VARCHAR}, #{defaultImage,jdbcType=VARCHAR}, ",
        "#{cupSize,jdbcType=VARCHAR}, #{temperature,jdbcType=VARCHAR}, ",
        "#{cream,jdbcType=VARCHAR}, #{espresso,jdbcType=VARCHAR}, ",
        "#{milk,jdbcType=VARCHAR}, #{milkBubble,jdbcType=VARCHAR}, ",
        "#{categoryName,jdbcType=VARCHAR}, #{marketTallPrice,jdbcType=DECIMAL}, ",
        "#{marketGrandePrice,jdbcType=DECIMAL}, #{marketVentiPrice,jdbcType=DECIMAL}, ",
        "#{salesTallPrice,jdbcType=DECIMAL}, #{salesGrandePrice,jdbcType=DECIMAL}, ",
        "#{salesVentiPrice,jdbcType=DECIMAL}, #{operatorId,jdbcType=BIGINT}, ",
        "#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(ApiStarbucksProducts record);

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

    @SelectProvider(type=ApiStarbucksProductsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="des", property="des", jdbcType=JdbcType.VARCHAR),
        @Result(column="default_image", property="defaultImage", jdbcType=JdbcType.VARCHAR),
        @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="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="market_tall_price", property="marketTallPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="market_grande_price", property="marketGrandePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="market_venti_price", property="marketVentiPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_tall_price", property="salesTallPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_grande_price", property="salesGrandePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_venti_price", property="salesVentiPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @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<ApiStarbucksProducts> selectByExample(ApiStarbucksProductsExample example);

    @Select({
        "select",
        "id, goods_id, `name`, des, default_image, cup_size, temperature, cream, espresso, ",
        "milk, milk_bubble, category_name, market_tall_price, market_grande_price, market_venti_price, ",
        "sales_tall_price, sales_grande_price, sales_venti_price, operator_id, operator_name, ",
        "create_time, update_time, `status`, ext_1, ext_2, ext_3",
        "from api_starbucks_products",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="des", property="des", jdbcType=JdbcType.VARCHAR),
        @Result(column="default_image", property="defaultImage", jdbcType=JdbcType.VARCHAR),
        @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="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="market_tall_price", property="marketTallPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="market_grande_price", property="marketGrandePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="market_venti_price", property="marketVentiPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_tall_price", property="salesTallPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_grande_price", property="salesGrandePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sales_venti_price", property="salesVentiPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @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)
    })
    ApiStarbucksProducts selectByPrimaryKey(Long id);

    @UpdateProvider(type=ApiStarbucksProductsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ApiStarbucksProducts record, @Param("example") ApiStarbucksProductsExample example);

    @UpdateProvider(type=ApiStarbucksProductsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ApiStarbucksProducts record, @Param("example") ApiStarbucksProductsExample example);

    @UpdateProvider(type=ApiStarbucksProductsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ApiStarbucksProducts record);

    @Update({
        "update api_starbucks_products",
        "set goods_id = #{goodsId,jdbcType=BIGINT},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "des = #{des,jdbcType=VARCHAR},",
          "default_image = #{defaultImage,jdbcType=VARCHAR},",
          "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},",
          "category_name = #{categoryName,jdbcType=VARCHAR},",
          "market_tall_price = #{marketTallPrice,jdbcType=DECIMAL},",
          "market_grande_price = #{marketGrandePrice,jdbcType=DECIMAL},",
          "market_venti_price = #{marketVentiPrice,jdbcType=DECIMAL},",
          "sales_tall_price = #{salesTallPrice,jdbcType=DECIMAL},",
          "sales_grande_price = #{salesGrandePrice,jdbcType=DECIMAL},",
          "sales_venti_price = #{salesVentiPrice,jdbcType=DECIMAL},",
          "operator_id = #{operatorId,jdbcType=BIGINT},",
          "operator_name = #{operatorName,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(ApiStarbucksProducts record);
}