package com.hfkj.dao;

import com.hfkj.entity.BsStoreGroupContent;
import com.hfkj.entity.BsStoreGroupContentExample;
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 BsStoreGroupContentMapper extends BsStoreGroupContentMapperExt {
    @SelectProvider(type=BsStoreGroupContentSqlProvider.class, method="countByExample")
    long countByExample(BsStoreGroupContentExample example);

    @DeleteProvider(type=BsStoreGroupContentSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsStoreGroupContentExample example);

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

    @Insert({
        "insert into bs_store_group_content (store_id, `name`, ",
        "original_price, price, ",
        "img, astrict, validity, ",
        "service_time, completion_degree, ",
        "create_time, update_time, ",
        "`status`, op_id, op_name, ",
        "ext_1, ext_2, ext_3)",
        "values (#{storeId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
        "#{originalPrice,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, ",
        "#{img,jdbcType=VARCHAR}, #{astrict,jdbcType=VARCHAR}, #{validity,jdbcType=VARCHAR}, ",
        "#{serviceTime,jdbcType=VARCHAR}, #{completionDegree,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsStoreGroupContent record);

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

    @SelectProvider(type=BsStoreGroupContentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="astrict", property="astrict", jdbcType=JdbcType.VARCHAR),
        @Result(column="validity", property="validity", jdbcType=JdbcType.VARCHAR),
        @Result(column="service_time", property="serviceTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="completion_degree", property="completionDegree", jdbcType=JdbcType.INTEGER),
        @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="op_id", property="opId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_name", property="opName", 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<BsStoreGroupContent> selectByExample(BsStoreGroupContentExample example);

    @Select({
        "select",
        "id, store_id, `name`, original_price, price, img, astrict, validity, service_time, ",
        "completion_degree, create_time, update_time, `status`, op_id, op_name, ext_1, ",
        "ext_2, ext_3",
        "from bs_store_group_content",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="original_price", property="originalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="astrict", property="astrict", jdbcType=JdbcType.VARCHAR),
        @Result(column="validity", property="validity", jdbcType=JdbcType.VARCHAR),
        @Result(column="service_time", property="serviceTime", jdbcType=JdbcType.VARCHAR),
        @Result(column="completion_degree", property="completionDegree", jdbcType=JdbcType.INTEGER),
        @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="op_id", property="opId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_name", property="opName", 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)
    })
    BsStoreGroupContent selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsStoreGroupContentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsStoreGroupContent record, @Param("example") BsStoreGroupContentExample example);

    @UpdateProvider(type=BsStoreGroupContentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsStoreGroupContent record, @Param("example") BsStoreGroupContentExample example);

    @UpdateProvider(type=BsStoreGroupContentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsStoreGroupContent record);

    @Update({
        "update bs_store_group_content",
        "set store_id = #{storeId,jdbcType=BIGINT},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "original_price = #{originalPrice,jdbcType=DECIMAL},",
          "price = #{price,jdbcType=DECIMAL},",
          "img = #{img,jdbcType=VARCHAR},",
          "astrict = #{astrict,jdbcType=VARCHAR},",
          "validity = #{validity,jdbcType=VARCHAR},",
          "service_time = #{serviceTime,jdbcType=VARCHAR},",
          "completion_degree = #{completionDegree,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "op_id = #{opId,jdbcType=BIGINT},",
          "op_name = #{opName,jdbcType=VARCHAR},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsStoreGroupContent record);
}