package com.ruoyi.system.mapper;
|
|
import java.util.List;
|
|
import com.ruoyi.common.annotation.DataSource;
|
import com.ruoyi.common.enums.DataSourceType;
|
import com.ruoyi.system.domain.SysTaskPayment;
|
import org.apache.ibatis.annotations.Param;
|
|
/**
|
* 任务支付Mapper接口
|
*
|
* @author ruoyi
|
* @date 2025-01-15
|
*/
|
@DataSource(DataSourceType.MASTER)
|
public interface SysTaskPaymentMapper {
|
|
/**
|
* 根据任务ID查询最近一次已支付的记录
|
*
|
* @param taskId 任务ID
|
* @return 支付记录
|
*/
|
SysTaskPayment selectLatestPaidByTaskId(Long taskId);
|
|
/**
|
* 根据任务ID查询所有已支付记录
|
*
|
* @param taskId 任务ID
|
* @return 已支付记录列表
|
*/
|
List<SysTaskPayment> selectAllPaidByTaskId(Long taskId);
|
|
/**
|
* 根据任务ID查询所有支付记录
|
*
|
* @param taskId 任务ID
|
* @return 支付记录列表
|
*/
|
List<SysTaskPayment> selectByTaskId(Long taskId);
|
|
/**
|
* 根据ID查询支付记录
|
*
|
* @param id 主键
|
* @return 支付记录
|
*/
|
SysTaskPayment selectById(Long id);
|
|
/**
|
* 根据商户订单号查询支付记录
|
*
|
* @param outTradeNo 商户订单号
|
* @return 支付记录
|
*/
|
SysTaskPayment selectByOutTradeNo(String outTradeNo);
|
|
/**
|
* 新增支付记录
|
*
|
* @param payment 支付记录
|
* @return 结果
|
*/
|
int insert(SysTaskPayment payment);
|
|
/**
|
* 更新支付记录
|
*
|
* @param payment 支付记录
|
* @return 结果
|
*/
|
int update(SysTaskPayment payment);
|
|
/**
|
* 更新支付状态
|
*
|
* @param id 主键
|
* @param payStatus 支付状态
|
* @param tradeNo 交易号
|
* @return 结果
|
*/
|
int updatePayStatus(@Param("id") Long id, @Param("payStatus") String payStatus,
|
@Param("tradeNo") String tradeNo);
|
|
/**
|
* 根据旧系统支付ID查询新系统支付记录
|
*
|
* @param pid 旧系统PaidMoney.id
|
* @return 支付记录
|
*/
|
SysTaskPayment selectByPid(Long pid);
|
|
/**
|
* 更新同步信息(pid、syncStatus、syncTime)
|
*
|
* @param id 主键
|
* @param pid 旧系统支付ID
|
* @param syncStatus 同步状态
|
* @param syncTime 同步时间
|
* @return 结果
|
*/
|
int updateSyncInfo(@Param("id") Long id, @Param("pid") Long pid,
|
@Param("syncStatus") Integer syncStatus, @Param("syncTime") java.util.Date syncTime);
|
|
/**
|
* 查询未同步的支付成功记录(用于批量同步)
|
*
|
* @return 支付记录列表
|
*/
|
List<SysTaskPayment> selectUnsyncedPaidPayments();
|
}
|