package com.hfkj.dao;

import com.hfkj.entity.BsDiscountPk;
import com.hfkj.entity.BsDiscountPkExample;
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 BsDiscountPkMapper extends BsDiscountPkMapperExt {
    @SelectProvider(type=BsDiscountPkSqlProvider.class, method="countByExample")
    long countByExample(BsDiscountPkExample example);

    @DeleteProvider(type=BsDiscountPkSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsDiscountPkExample example);

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

    @Insert({
        "insert into bs_discount_pk (discount_pk_no, discount_pk_name, ",
        "`describe`, list_img, ",
        "content, sale_price, ",
        "sale_num, start_time, ",
        "end_time, `status`, ",
        "create_time, create_user_type, ",
        "create_user_id, create_user_name, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{discountPkNo,jdbcType=VARCHAR}, #{discountPkName,jdbcType=VARCHAR}, ",
        "#{describe,jdbcType=VARCHAR}, #{listImg,jdbcType=VARCHAR}, ",
        "#{content,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, ",
        "#{saleNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ",
        "#{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{createUserType,jdbcType=INTEGER}, ",
        "#{createUserId,jdbcType=BIGINT}, #{createUserName,jdbcType=VARCHAR}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsDiscountPk record);

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

    @SelectProvider(type=BsDiscountPkSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="describe", property="describe", jdbcType=JdbcType.VARCHAR),
        @Result(column="list_img", property="listImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
        @Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @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<BsDiscountPk> selectByExample(BsDiscountPkExample example);

    @Select({
        "select",
        "id, discount_pk_no, discount_pk_name, `describe`, list_img, content, sale_price, ",
        "sale_num, start_time, end_time, `status`, create_time, create_user_type, create_user_id, ",
        "create_user_name, update_time, ext_1, ext_2, ext_3",
        "from bs_discount_pk",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="discount_pk_no", property="discountPkNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="discount_pk_name", property="discountPkName", jdbcType=JdbcType.VARCHAR),
        @Result(column="describe", property="describe", jdbcType=JdbcType.VARCHAR),
        @Result(column="list_img", property="listImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
        @Result(column="sale_price", property="salePrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_user_type", property="createUserType", jdbcType=JdbcType.INTEGER),
        @Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="create_user_name", property="createUserName", jdbcType=JdbcType.VARCHAR),
        @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)
    })
    BsDiscountPk selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsDiscountPk record, @Param("example") BsDiscountPkExample example);

    @UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsDiscountPk record, @Param("example") BsDiscountPkExample example);

    @UpdateProvider(type=BsDiscountPkSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsDiscountPk record);

    @Update({
        "update bs_discount_pk",
        "set discount_pk_no = #{discountPkNo,jdbcType=VARCHAR},",
          "discount_pk_name = #{discountPkName,jdbcType=VARCHAR},",
          "`describe` = #{describe,jdbcType=VARCHAR},",
          "list_img = #{listImg,jdbcType=VARCHAR},",
          "content = #{content,jdbcType=VARCHAR},",
          "sale_price = #{salePrice,jdbcType=DECIMAL},",
          "sale_num = #{saleNum,jdbcType=INTEGER},",
          "start_time = #{startTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "create_user_type = #{createUserType,jdbcType=INTEGER},",
          "create_user_id = #{createUserId,jdbcType=BIGINT},",
          "create_user_name = #{createUserName,jdbcType=VARCHAR},",
          "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(BsDiscountPk record);
}