admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/UserMoneyDebtMapper.java
@@ -1,36 +1,48 @@
package com.yeshi.fanli.dao.mybatis.money;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
public interface UserMoneyDebtMapper extends BaseMapper<UserMoneyDebt> {
   /**
    * 根据用户ID与sourceId查询记录
    *
    * @param uid
    * @param sourceId
    * @return
    */
   UserMoneyDebt selectByUidAndTypeAndSourceId(@Param("uid") Long uid, @Param("type") UserMoneyDebtTypeEnum type,
         @Param("sourceId") Long sourceId);
   UserMoneyDebt selectByTypeAndSourceId(@Param("type") UserMoneyDebtTypeEnum type, @Param("sourceId") Long sourceId);
   /**
    * 查询欠债
    *
    * @param uid
    * @param start
    * @param count
    * @return
    */
   List<UserMoneyDebt> listByUidWithHasLeftMoney(@Param("uid") Long uid, @Param("start") long start,
         @Param("count") int count);
package com.yeshi.fanli.dao.mybatis.money;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yeshi.fanli.dao.BaseMapper;
import com.yeshi.fanli.entity.money.UserMoneyDebt;
import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
public interface UserMoneyDebtMapper extends BaseMapper<UserMoneyDebt> {
    /**
     * 根据用户ID与sourceId查询记录
     *
     * @param uid
     * @param sourceId
     * @return
     */
    UserMoneyDebt selectByUidAndTypeAndSourceId(@Param("uid") Long uid, @Param("type") UserMoneyDebtTypeEnum type,
                                                @Param("sourceId") Long sourceId);
    UserMoneyDebt selectByTypeAndSourceId(@Param("type") UserMoneyDebtTypeEnum type, @Param("sourceId") Long sourceId);
    /**
     * 查询欠债
     *
     * @param uid
     * @param start
     * @param count
     * @return
     */
    List<UserMoneyDebt> listByUidWithHasLeftMoney(@Param("uid") Long uid, @Param("start") long start,
                                                  @Param("count") int count);
    /**
     * 查询需要还欠款的用户ID
     * @param start
     * @param count
     * @return
     */
    List<Long> listUidWithHasDebtToRepay(@Param("start") long start,
                                         @Param("count") int count);
    long countUidWithHasDebtToRepay();
}