package com.hai.dao;

import com.hai.entity.OutRechargeUser;
import com.hai.entity.OutRechargeUserExample;
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 OutRechargeUserMapper extends OutRechargeUserMapperExt {
    @SelectProvider(type=OutRechargeUserSqlProvider.class, method="countByExample")
    long countByExample(OutRechargeUserExample example);

    @DeleteProvider(type=OutRechargeUserSqlProvider.class, method="deleteByExample")
    int deleteByExample(OutRechargeUserExample example);

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

    @Insert({
        "insert into out_recharge_user (recharge_name, phone, ",
        "create_time, `status`, ",
        "operator_id, operator_name)",
        "values (#{rechargeName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
        "#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(OutRechargeUser record);

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

    @SelectProvider(type=OutRechargeUserSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR)
    })
    List<OutRechargeUser> selectByExample(OutRechargeUserExample example);

    @Select({
        "select",
        "id, recharge_name, phone, create_time, `status`, operator_id, operator_name",
        "from out_recharge_user",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
        @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR)
    })
    OutRechargeUser selectByPrimaryKey(Long id);

    @UpdateProvider(type=OutRechargeUserSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") OutRechargeUser record, @Param("example") OutRechargeUserExample example);

    @UpdateProvider(type=OutRechargeUserSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") OutRechargeUser record, @Param("example") OutRechargeUserExample example);

    @UpdateProvider(type=OutRechargeUserSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(OutRechargeUser record);

    @Update({
        "update out_recharge_user",
        "set recharge_name = #{rechargeName,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "operator_id = #{operatorId,jdbcType=BIGINT},",
          "operator_name = #{operatorName,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(OutRechargeUser record);
}