package com.hfkj.dao;

import com.hfkj.entity.CyymallOrderDetail;
import com.hfkj.entity.CyymallOrderDetailExample;
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 CyymallOrderDetailMapper extends CyymallOrderDetailMapperExt {
    @SelectProvider(type=CyymallOrderDetailSqlProvider.class, method="countByExample")
    long countByExample(CyymallOrderDetailExample example);

    @DeleteProvider(type=CyymallOrderDetailSqlProvider.class, method="deleteByExample")
    int deleteByExample(CyymallOrderDetailExample example);

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

    @Insert({
        "insert into cyymall_order_detail (order_id, goods_id, ",
        "num, total_price, ",
        "addtime, is_delete, ",
        "pic, integral, is_level, ",
        "batch_price_tips, supplier_price, ",
        "vgoods_id, vgoods_price, ",
        "verify_card_sale_id, give_goods_id, ",
        "attr)",
        "values (#{orderId,jdbcType=INTEGER}, #{goodsId,jdbcType=INTEGER}, ",
        "#{num,jdbcType=INTEGER}, #{totalPrice,jdbcType=DECIMAL}, ",
        "#{addtime,jdbcType=INTEGER}, #{isDelete,jdbcType=SMALLINT}, ",
        "#{pic,jdbcType=VARCHAR}, #{integral,jdbcType=INTEGER}, #{isLevel,jdbcType=SMALLINT}, ",
        "#{batchPriceTips,jdbcType=VARCHAR}, #{supplierPrice,jdbcType=DECIMAL}, ",
        "#{vgoodsId,jdbcType=INTEGER}, #{vgoodsPrice,jdbcType=DECIMAL}, ",
        "#{verifyCardSaleId,jdbcType=INTEGER}, #{giveGoodsId,jdbcType=INTEGER}, ",
        "#{attr,jdbcType=LONGVARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(CyymallOrderDetail record);

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

    @SelectProvider(type=CyymallOrderDetailSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER),
        @Result(column="is_level", property="isLevel", jdbcType=JdbcType.SMALLINT),
        @Result(column="batch_price_tips", property="batchPriceTips", jdbcType=JdbcType.VARCHAR),
        @Result(column="supplier_price", property="supplierPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="vgoods_id", property="vgoodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="vgoods_price", property="vgoodsPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="verify_card_sale_id", property="verifyCardSaleId", jdbcType=JdbcType.INTEGER),
        @Result(column="give_goods_id", property="giveGoodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="attr", property="attr", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<CyymallOrderDetail> selectByExampleWithBLOBs(CyymallOrderDetailExample example);

    @SelectProvider(type=CyymallOrderDetailSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER),
        @Result(column="is_level", property="isLevel", jdbcType=JdbcType.SMALLINT),
        @Result(column="batch_price_tips", property="batchPriceTips", jdbcType=JdbcType.VARCHAR),
        @Result(column="supplier_price", property="supplierPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="vgoods_id", property="vgoodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="vgoods_price", property="vgoodsPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="verify_card_sale_id", property="verifyCardSaleId", jdbcType=JdbcType.INTEGER),
        @Result(column="give_goods_id", property="giveGoodsId", jdbcType=JdbcType.INTEGER)
    })
    List<CyymallOrderDetail> selectByExample(CyymallOrderDetailExample example);

    @Select({
        "select",
        "id, order_id, goods_id, num, total_price, addtime, is_delete, pic, integral, ",
        "is_level, batch_price_tips, supplier_price, vgoods_id, vgoods_price, verify_card_sale_id, ",
        "give_goods_id, attr",
        "from cyymall_order_detail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="addtime", property="addtime", jdbcType=JdbcType.INTEGER),
        @Result(column="is_delete", property="isDelete", jdbcType=JdbcType.SMALLINT),
        @Result(column="pic", property="pic", jdbcType=JdbcType.VARCHAR),
        @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER),
        @Result(column="is_level", property="isLevel", jdbcType=JdbcType.SMALLINT),
        @Result(column="batch_price_tips", property="batchPriceTips", jdbcType=JdbcType.VARCHAR),
        @Result(column="supplier_price", property="supplierPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="vgoods_id", property="vgoodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="vgoods_price", property="vgoodsPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="verify_card_sale_id", property="verifyCardSaleId", jdbcType=JdbcType.INTEGER),
        @Result(column="give_goods_id", property="giveGoodsId", jdbcType=JdbcType.INTEGER),
        @Result(column="attr", property="attr", jdbcType=JdbcType.LONGVARCHAR)
    })
    CyymallOrderDetail selectByPrimaryKey(Integer id);

    @UpdateProvider(type=CyymallOrderDetailSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CyymallOrderDetail record, @Param("example") CyymallOrderDetailExample example);

    @UpdateProvider(type=CyymallOrderDetailSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") CyymallOrderDetail record, @Param("example") CyymallOrderDetailExample example);

    @UpdateProvider(type=CyymallOrderDetailSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CyymallOrderDetail record, @Param("example") CyymallOrderDetailExample example);

    @UpdateProvider(type=CyymallOrderDetailSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CyymallOrderDetail record);

    @Update({
        "update cyymall_order_detail",
        "set order_id = #{orderId,jdbcType=INTEGER},",
          "goods_id = #{goodsId,jdbcType=INTEGER},",
          "num = #{num,jdbcType=INTEGER},",
          "total_price = #{totalPrice,jdbcType=DECIMAL},",
          "addtime = #{addtime,jdbcType=INTEGER},",
          "is_delete = #{isDelete,jdbcType=SMALLINT},",
          "pic = #{pic,jdbcType=VARCHAR},",
          "integral = #{integral,jdbcType=INTEGER},",
          "is_level = #{isLevel,jdbcType=SMALLINT},",
          "batch_price_tips = #{batchPriceTips,jdbcType=VARCHAR},",
          "supplier_price = #{supplierPrice,jdbcType=DECIMAL},",
          "vgoods_id = #{vgoodsId,jdbcType=INTEGER},",
          "vgoods_price = #{vgoodsPrice,jdbcType=DECIMAL},",
          "verify_card_sale_id = #{verifyCardSaleId,jdbcType=INTEGER},",
          "give_goods_id = #{giveGoodsId,jdbcType=INTEGER},",
          "attr = #{attr,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(CyymallOrderDetail record);

    @Update({
        "update cyymall_order_detail",
        "set order_id = #{orderId,jdbcType=INTEGER},",
          "goods_id = #{goodsId,jdbcType=INTEGER},",
          "num = #{num,jdbcType=INTEGER},",
          "total_price = #{totalPrice,jdbcType=DECIMAL},",
          "addtime = #{addtime,jdbcType=INTEGER},",
          "is_delete = #{isDelete,jdbcType=SMALLINT},",
          "pic = #{pic,jdbcType=VARCHAR},",
          "integral = #{integral,jdbcType=INTEGER},",
          "is_level = #{isLevel,jdbcType=SMALLINT},",
          "batch_price_tips = #{batchPriceTips,jdbcType=VARCHAR},",
          "supplier_price = #{supplierPrice,jdbcType=DECIMAL},",
          "vgoods_id = #{vgoodsId,jdbcType=INTEGER},",
          "vgoods_price = #{vgoodsPrice,jdbcType=DECIMAL},",
          "verify_card_sale_id = #{verifyCardSaleId,jdbcType=INTEGER},",
          "give_goods_id = #{giveGoodsId,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CyymallOrderDetail record);
}