package com.hfkj.dao;

import com.hfkj.entity.BsOrderCouponNo;
import com.hfkj.entity.BsOrderCouponNoExample;
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 BsOrderCouponNoMapper extends BsOrderCouponNoMapperExt {
    @SelectProvider(type=BsOrderCouponNoSqlProvider.class, method="countByExample")
    long countByExample(BsOrderCouponNoExample example);

    @DeleteProvider(type=BsOrderCouponNoSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderCouponNoExample example);

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

    @Insert({
        "insert into bs_order_coupon_no (coupon_order_id, order_no, ",
        "channel_order_no, goods_vpd_source, ",
        "goods_vpd_key, goods_vpd_source_cou_no, ",
        "expire_status, expire_time, ",
        "`status`, exception_status, ",
        "create_time, deliver_time, ",
        "finish_time, update_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{couponOrderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ",
        "#{channelOrderNo,jdbcType=VARCHAR}, #{goodsVpdSource,jdbcType=INTEGER}, ",
        "#{goodsVpdKey,jdbcType=VARCHAR}, #{goodsVpdSourceCouNo,jdbcType=VARCHAR}, ",
        "#{expireStatus,jdbcType=BIT}, #{expireTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=INTEGER}, #{exceptionStatus,jdbcType=BIT}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{deliverTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderCouponNo record);

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

    @SelectProvider(type=BsOrderCouponNoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="coupon_order_id", property="couponOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_vpd_source", property="goodsVpdSource", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_vpd_key", property="goodsVpdKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_vpd_source_cou_no", property="goodsVpdSourceCouNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="expire_status", property="expireStatus", jdbcType=JdbcType.BIT),
        @Result(column="expire_time", property="expireTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deliver_time", property="deliverTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @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<BsOrderCouponNo> selectByExample(BsOrderCouponNoExample example);

    @Select({
        "select",
        "id, coupon_order_id, order_no, channel_order_no, goods_vpd_source, goods_vpd_key, ",
        "goods_vpd_source_cou_no, expire_status, expire_time, `status`, exception_status, ",
        "create_time, deliver_time, finish_time, update_time, ext_1, ext_2, ext_3",
        "from bs_order_coupon_no",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="coupon_order_id", property="couponOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_vpd_source", property="goodsVpdSource", jdbcType=JdbcType.INTEGER),
        @Result(column="goods_vpd_key", property="goodsVpdKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_vpd_source_cou_no", property="goodsVpdSourceCouNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="expire_status", property="expireStatus", jdbcType=JdbcType.BIT),
        @Result(column="expire_time", property="expireTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="deliver_time", property="deliverTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @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)
    })
    BsOrderCouponNo selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderCouponNoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderCouponNo record, @Param("example") BsOrderCouponNoExample example);

    @UpdateProvider(type=BsOrderCouponNoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderCouponNo record, @Param("example") BsOrderCouponNoExample example);

    @UpdateProvider(type=BsOrderCouponNoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderCouponNo record);

    @Update({
        "update bs_order_coupon_no",
        "set coupon_order_id = #{couponOrderId,jdbcType=BIGINT},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "channel_order_no = #{channelOrderNo,jdbcType=VARCHAR},",
          "goods_vpd_source = #{goodsVpdSource,jdbcType=INTEGER},",
          "goods_vpd_key = #{goodsVpdKey,jdbcType=VARCHAR},",
          "goods_vpd_source_cou_no = #{goodsVpdSourceCouNo,jdbcType=VARCHAR},",
          "expire_status = #{expireStatus,jdbcType=BIT},",
          "expire_time = #{expireTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "exception_status = #{exceptionStatus,jdbcType=BIT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "deliver_time = #{deliverTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,jdbcType=TIMESTAMP},",
          "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(BsOrderCouponNo record);
}