first commit
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.domain.other.TtAnnouncement;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiAnnouncementMapper {
|
||||
|
||||
List<TtAnnouncement> getAnnouncementList(Long userId);
|
||||
|
||||
List<TtAnnouncement> getSystemAnnouncementList();
|
||||
|
||||
TtAnnouncement getAnnouncementByAnnouncementId(Integer announcementId);
|
||||
|
||||
int countUnreadAnnouncement(Long userId);
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface ApiAnnouncementReadMapper {
|
||||
|
||||
int countAnnouncementRead(@Param("announcementId") Integer announcementId, @Param("userId") Long userId);
|
||||
|
||||
int addAnnouncementRead(@Param("announcementId") Integer announcementId, @Param("userId") Long userId);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.domain.entity.BoxTransferRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ApiBoxTransferRecordMapper extends BaseMapper<BoxTransferRecord> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.domain.vo.ApiMessageDataVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiMessageMapper {
|
||||
List<ApiMessageDataVO> getMessageList(@Param("userId") Long userId, @Param("id") Integer id);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.domain.other.TtNotice;
|
||||
import com.ruoyi.user.model.vo.ApiNoticeVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiNoticeMapper {
|
||||
|
||||
List<ApiNoticeVO> getNoticeList(Long userId);
|
||||
|
||||
List<ApiNoticeVO> getNoticeListByCategoryPrefix(@Param("userId") Long userId, @Param("categoryPrefix") String categoryPrefix);
|
||||
|
||||
ApiNoticeVO getNoticeByNoticeId(@Param("userId") Long userId, @Param("noticeId") Integer noticeId);
|
||||
|
||||
int countUnreadNotice(Long userId);
|
||||
|
||||
int addNotice(TtNotice ttNotice);
|
||||
|
||||
int editNotice(TtNotice ttNotice);
|
||||
|
||||
int removeNoticeByNoticeId(Integer noticeId);
|
||||
|
||||
/**
|
||||
* 批量设置指定分类的通知为已读
|
||||
*
|
||||
* @param userId 用户 ID
|
||||
* @param categoryPrefix 分类前缀(GAME_表示游戏通知,SYS_表示系统通知)
|
||||
* @return 影响行数
|
||||
*/
|
||||
int markNoticesAsReadByCategory(@Param("userId") Long userId, @Param("categoryPrefix") String categoryPrefix);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.domain.other.ApiShoppingBody;
|
||||
import com.ruoyi.domain.vo.ApiShoppingDataVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiShoppingMapper {
|
||||
List<ApiShoppingDataVO> list(@Param("shoppingBody") ApiShoppingBody shoppingBody, @Param("exchangePriceRatio") Integer exchangePriceRatio);
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.user.model.TtTaskCenterUser;
|
||||
import com.ruoyi.user.model.dto.YesterdayExpenditureDTO;
|
||||
import com.ruoyi.user.model.vo.ApiTaskCenterVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiTaskCenterMapper {
|
||||
|
||||
List<ApiTaskCenterVO> selectApiTaskCenterVOList(Integer userId);
|
||||
|
||||
List<YesterdayExpenditureDTO> getYesterdayExpenditure();
|
||||
|
||||
BigDecimal selectCreditByTaskIdAndUserId(@Param("taskId") Integer taskId, @Param("userId") Integer userId);
|
||||
|
||||
TtTaskCenterUser selectTtTaskCenterUserByTaskIdAndUserId(@Param("taskId") Integer taskId, @Param("userId") Integer userId);
|
||||
|
||||
int insertYesterdayExpenditureBonusPoints(List<TtTaskCenterUser> ttTaskCenterUserList);
|
||||
|
||||
int deleteYesterdayExpenditureBonusPoints(Integer taskId);
|
||||
|
||||
int markAsClaimedByUserIdAndType(@Param("taskId") Integer taskId, @Param("userId") Integer userId);
|
||||
|
||||
int insertTaskCenterRecord(TtTaskCenterUser ttTaskCenterUser);
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.user.model.vo.ApiConsumeRankingVO;
|
||||
import com.ruoyi.user.model.vo.ApiRechargeRankingVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiUserBlendErcashMapper {
|
||||
|
||||
/**
|
||||
* 获取指定日期的消费排行榜
|
||||
*/
|
||||
List<ApiRechargeRankingVO> getRechargeRankingByDate(String date);
|
||||
|
||||
/**
|
||||
* 今日消费流水 Top10。
|
||||
* 统计口径:tt_user_blend_ercash 中 type=0 (OUTPUT) 且 source 命中
|
||||
* {@link com.ruoyi.domain.common.constant.TtAccountRecordSource#getGameBetCodes()},
|
||||
* 按用户聚合后按总消费降序,排除机器人 (user_type='03')。
|
||||
*
|
||||
* @param beginT 今日 00:00:00
|
||||
* @param endT 今日 23:59:59
|
||||
* @param sourceList 计入消费的 source 集合
|
||||
* @param limit 返回条数(默认 10)
|
||||
*/
|
||||
List<ApiConsumeRankingVO> topConsumeRanking(@Param("beginT") String beginT,
|
||||
@Param("endT") String endT,
|
||||
@Param("sourceList") List<Integer> sourceList,
|
||||
@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 查询指定用户在 [beginT, endT] 区间内、命中 sourceList 的累计消费(绝对值)。
|
||||
* 没有任何流水时返回 0。
|
||||
*/
|
||||
BigDecimal userConsumeTotal(@Param("userId") Long userId,
|
||||
@Param("beginT") String beginT,
|
||||
@Param("endT") String endT,
|
||||
@Param("sourceList") List<Integer> sourceList);
|
||||
|
||||
/**
|
||||
* 统计在同样口径下消费总额严格大于 myTotal 的用户数(用于推算个人排名)。
|
||||
* 排名 = countUsersAheadOf(myTotal) + 1。
|
||||
*/
|
||||
Integer countUsersAheadOf(@Param("myTotal") BigDecimal myTotal,
|
||||
@Param("beginT") String beginT,
|
||||
@Param("endT") String endT,
|
||||
@Param("sourceList") List<Integer> sourceList);
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import com.ruoyi.domain.vo.UserPackSackDataVO;
|
||||
import com.ruoyi.domain.vo.client.PackSackGlobalData;
|
||||
import com.ruoyi.domain.vo.client.WelfareBoxVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ApiUserPackSackMapper {
|
||||
List<UserPackSackDataVO> getPackSack(Integer userId);
|
||||
|
||||
List<UserPackSackDataVO> clientPackSack(
|
||||
@Param("uidList") List<Integer> uidList,
|
||||
@Param("statusList") List<Integer> statusList,
|
||||
@Param("sourceList") List<Integer> sourceList,
|
||||
@Param("name") String name,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("priceSort") Integer priceSort,
|
||||
@Param("timeSort") Integer timeSort);
|
||||
|
||||
PackSackGlobalData packSackGlobalData(@Param("userId") Integer userId,
|
||||
@Param("statusList") List<Integer> statusList);
|
||||
|
||||
PackSackGlobalData welfareBoxGlobalData(@Param("userId") Integer userId);
|
||||
|
||||
List<WelfareBoxVO> getWelfareBoxList(@Param("userId") Long userId,
|
||||
@Param("limit") Integer limit,
|
||||
@Param("size") Integer size);
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.user.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 推广CDKEY兑换 Mapper(service-user模块直接访问promo_cdkey/promo_cdkey_redeem表)
|
||||
*/
|
||||
@Mapper
|
||||
public interface PromoCdkeyUserMapper {
|
||||
|
||||
/**
|
||||
* 根据CDKEY码查询进行中的CDKEY
|
||||
*/
|
||||
@Select("SELECT id, title, cdkey_code, amount_min, amount_max, num, usable_count, " +
|
||||
"used_count, status, creator_id, creator_name, opening_time, validity, create_time " +
|
||||
"FROM promo_cdkey WHERE cdkey_code = #{code} AND status = 0 LIMIT 1")
|
||||
Map<String, Object> findActiveCdkey(@Param("code") String code);
|
||||
|
||||
/**
|
||||
* 递减可用次数
|
||||
*/
|
||||
@Update("UPDATE promo_cdkey SET usable_count = usable_count - 1, used_count = used_count + 1 " +
|
||||
"WHERE id = #{id} AND usable_count > 0")
|
||||
int decrementUsableCount(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 当可用次数为0时更新状态为已结束
|
||||
*/
|
||||
@Update("UPDATE promo_cdkey SET status = 1 WHERE id = #{id} AND usable_count <= 0")
|
||||
int updateStatusIfExhausted(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 检查用户是否已兑换过该CDKEY
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM promo_cdkey_redeem WHERE cdkey_id = #{cdkeyId} AND redeemer_id = #{redeemerId}")
|
||||
int countUserRedeem(@Param("cdkeyId") Long cdkeyId, @Param("redeemerId") Long redeemerId);
|
||||
|
||||
/**
|
||||
* 插入兑换记录
|
||||
*/
|
||||
@Insert("INSERT INTO promo_cdkey_redeem (cdkey_id, cdkey_code, redeemer_id, redeemer_name, unit_value, redeem_time) " +
|
||||
"VALUES (#{cdkeyId}, #{cdkeyCode}, #{redeemerId}, #{redeemerName}, #{unitValue}, #{redeemTime})")
|
||||
int insertRedeemRecord(@Param("cdkeyId") Long cdkeyId,
|
||||
@Param("cdkeyCode") String cdkeyCode,
|
||||
@Param("redeemerId") Long redeemerId,
|
||||
@Param("redeemerName") String redeemerName,
|
||||
@Param("unitValue") BigDecimal unitValue,
|
||||
@Param("redeemTime") Date redeemTime);
|
||||
}
|
||||
Reference in New Issue
Block a user