package com.fastbee.rechargecard.mapper;

import java.util.List;
import com.fastbee.rechargecard.domain.NgUserRechargeRecords;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 用户充值记录Mapper接口
 *
 * @author kerwincui
 * @date 2024-12-19
 */
@Mapper
public interface NgUserRechargeRecordsMapper
{
    /**
     * 根据订单号查询充值记录
     * @param rechargeCode
     * @return
     */
    @Select("select * from ng_user_recharge_records where recharge_code=#{rechargeCode}")
    public NgUserRechargeRecords SelectRechargeRecodeByRechargeCode(String rechargeCode);
    /**
     * 查询用户充值记录
     *
     * @param
     * @return 用户充值记录
     */
    public List<NgUserRechargeRecords> selectNgUserRechargeRecordsByCardNumber(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 根据订单编号查询用户充值记录
     * @param rechargeCode
     * @return
     */
    @Select("select * from ng_user_recharge_records where recharge_code=#{rechargeCode}")
    public NgUserRechargeRecords selectNgUserRechargeRecordsByRechargeCode(String rechargeCode);

    /**
     * 查询充值机充值记录
     *
     * @param
     * @return 用户充值记录
     */
    public List<NgUserRechargeRecords> selectNgUserRechargeRecordsBySerialNumber(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 查询用户充值记录列表
     *
     * @param ngUserRechargeRecords 用户充值记录
     * @return 用户充值记录集合
     */
    public List<NgUserRechargeRecords> selectNgUserRechargeRecordsList(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 新增用户充值记录
     *
     * @param ngUserRechargeRecords 用户充值记录
     * @return 结果
     */
    public int insertNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 修改用户充值记录
     *
     * @param ngUserRechargeRecords 用户充值记录
     * @return 结果
     */
    public int updateNgUserRechargeRecords(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 微信支付成功后修改用户充值记录状态为已支付
     */
    public int updateNgUserRechargeRecordsWechat(NgUserRechargeRecords ngUserRechargeRecords);

    /**
     * 删除用户充值记录
     *
     * @param id 用户充值记录主键
     * @return 结果
     */
    public int deleteNgUserRechargeRecordsById(Long id);

    /**
     * 批量删除用户充值记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteNgUserRechargeRecordsByIds(Long[] ids);
}
