package com.hfkj.dao;

import com.hfkj.entity.BsOrderAfterSalesOpRecord;
import com.hfkj.entity.BsOrderAfterSalesOpRecordExample;
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 BsOrderAfterSalesOpRecordMapper extends BsOrderAfterSalesOpRecordMapperExt {
    @SelectProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="countByExample")
    long countByExample(BsOrderAfterSalesOpRecordExample example);

    @DeleteProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderAfterSalesOpRecordExample example);

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

    @Insert({
        "insert into bs_order_after_sales_op_record (apply_no, `status`, ",
        "photo, remarks, ",
        "op_user_type, op_user_id, ",
        "op_user_name, create_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{applyNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{photo,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, ",
        "#{opUserType,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ",
        "#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderAfterSalesOpRecord record);

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

    @SelectProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", 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<BsOrderAfterSalesOpRecord> selectByExample(BsOrderAfterSalesOpRecordExample example);

    @Select({
        "select",
        "id, apply_no, `status`, photo, remarks, op_user_type, op_user_id, op_user_name, ",
        "create_time, ext_1, ext_2, ext_3",
        "from bs_order_after_sales_op_record",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="op_user_type", property="opUserType", jdbcType=JdbcType.INTEGER),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", 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)
    })
    BsOrderAfterSalesOpRecord selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderAfterSalesOpRecord record, @Param("example") BsOrderAfterSalesOpRecordExample example);

    @UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderAfterSalesOpRecord record, @Param("example") BsOrderAfterSalesOpRecordExample example);

    @UpdateProvider(type=BsOrderAfterSalesOpRecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderAfterSalesOpRecord record);

    @Update({
        "update bs_order_after_sales_op_record",
        "set apply_no = #{applyNo,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "photo = #{photo,jdbcType=VARCHAR},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "op_user_type = #{opUserType,jdbcType=INTEGER},",
          "op_user_id = #{opUserId,jdbcType=BIGINT},",
          "op_user_name = #{opUserName,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsOrderAfterSalesOpRecord record);
}