package com.hai.dao;

import com.hai.entity.HighDiscountPackageActual;
import com.hai.entity.HighDiscountPackageActualExample;
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 HighDiscountPackageActualMapper extends HighDiscountPackageActualMapperExt {
    @SelectProvider(type=HighDiscountPackageActualSqlProvider.class, method="countByExample")
    long countByExample(HighDiscountPackageActualExample example);

    @DeleteProvider(type=HighDiscountPackageActualSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighDiscountPackageActualExample example);

    @Delete({
        "delete from high_discount_package_actual",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into high_discount_package_actual (discount_package_id, created_user_id, ",
        "created_time, user_id, ",
        "allocation_time, child_order_id, ",
        "`status`, ext_1, ext_2, ",
        "ext_3)",
        "values (#{discountPackageId,jdbcType=INTEGER}, #{createdUserId,jdbcType=INTEGER}, ",
        "#{createdTime,jdbcType=TIMESTAMP}, #{userId,jdbcType=INTEGER}, ",
        "#{allocationTime,jdbcType=TIMESTAMP}, #{childOrderId,jdbcType=BIGINT}, ",
        "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
        "#{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighDiscountPackageActual record);

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

    @SelectProvider(type=HighDiscountPackageActualSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="allocation_time", property="allocationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
        @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<HighDiscountPackageActual> selectByExample(HighDiscountPackageActualExample example);

    @Select({
        "select",
        "id, discount_package_id, created_user_id, created_time, user_id, allocation_time, ",
        "child_order_id, `status`, ext_1, ext_2, ext_3",
        "from high_discount_package_actual",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="discount_package_id", property="discountPackageId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="allocation_time", property="allocationTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="child_order_id", property="childOrderId", jdbcType=JdbcType.BIGINT),
        @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)
    })
    HighDiscountPackageActual selectByPrimaryKey(Integer id);

    @UpdateProvider(type=HighDiscountPackageActualSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighDiscountPackageActual record, @Param("example") HighDiscountPackageActualExample example);

    @UpdateProvider(type=HighDiscountPackageActualSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighDiscountPackageActual record, @Param("example") HighDiscountPackageActualExample example);

    @UpdateProvider(type=HighDiscountPackageActualSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighDiscountPackageActual record);

    @Update({
        "update high_discount_package_actual",
        "set discount_package_id = #{discountPackageId,jdbcType=INTEGER},",
          "created_user_id = #{createdUserId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "user_id = #{userId,jdbcType=INTEGER},",
          "allocation_time = #{allocationTime,jdbcType=TIMESTAMP},",
          "child_order_id = #{childOrderId,jdbcType=BIGINT},",
          "`status` = #{status,jdbcType=INTEGER},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(HighDiscountPackageActual record);
}