package com.hai.dao;

import com.hai.entity.GoodsReview;
import com.hai.entity.GoodsReviewExample;
import java.util.List;
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.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface GoodsReviewMapper extends GoodsReviewMapperExt {
    @SelectProvider(type=GoodsReviewSqlProvider.class, method="countByExample")
    long countByExample(GoodsReviewExample example);

    @DeleteProvider(type=GoodsReviewSqlProvider.class, method="deleteByExample")
    int deleteByExample(GoodsReviewExample example);

    @Insert({
        "insert into goods_review (user_id, order_id, ",
        "goods_id, sku_id, review_describe, ",
        "show_img, `status`, ",
        "create_time, op_id, ",
        "op_name, ext_1, ext_2, ",
        "ext_3)",
        "values (#{userId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, ",
        "#{goodsId,jdbcType=BIGINT}, #{skuId,jdbcType=BIGINT}, #{reviewDescribe,jdbcType=VARCHAR}, ",
        "#{showImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{opId,jdbcType=BIGINT}, ",
        "#{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
        "#{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(GoodsReview record);

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

    @SelectProvider(type=GoodsReviewSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="sku_id", property="skuId", jdbcType=JdbcType.BIGINT),
        @Result(column="review_describe", property="reviewDescribe", jdbcType=JdbcType.VARCHAR),
        @Result(column="show_img", property="showImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @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<GoodsReview> selectByExample(GoodsReviewExample example);

    @UpdateProvider(type=GoodsReviewSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") GoodsReview record, @Param("example") GoodsReviewExample example);

    @UpdateProvider(type=GoodsReviewSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") GoodsReview record, @Param("example") GoodsReviewExample example);
}