add 积分系统功能

This commit is contained in:
Guoqs
2025-12-24 15:41:11 +08:00
parent c2a1ae1966
commit e135db56b0
11 changed files with 917 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberPointsInfo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
/**
* 用户积分Mapper接口
*/
public interface MemberPointsInfoMapper {
/**
* 根据主键查询
*/
MemberPointsInfo selectByPrimaryKey(Long id);
/**
* 根据会员ID查询积分信息
*/
MemberPointsInfo selectByMemberId(@Param("memberId") String memberId);
/**
* 插入积分记录
*/
int insert(MemberPointsInfo record);
/**
* 选择性插入积分记录
*/
int insertSelective(MemberPointsInfo record);
/**
* 根据主键更新
*/
int updateByPrimaryKey(MemberPointsInfo record);
/**
* 根据主键选择性更新
*/
int updateByPrimaryKeySelective(MemberPointsInfo record);
/**
* 原子性增加积分
*/
int addPoints(@Param("memberId") String memberId, @Param("points") BigDecimal points);
/**
* 原子性扣减积分
*/
int deductPoints(@Param("memberId") String memberId, @Param("points") BigDecimal points);
/**
* 根据主键删除
*/
int deleteByPrimaryKey(Long id);
}

View File

@@ -0,0 +1,57 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.MemberPointsRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 积分流水Mapper接口
*/
public interface MemberPointsRecordMapper {
/**
* 根据主键查询
*/
MemberPointsRecord selectByPrimaryKey(Long id);
/**
* 根据会员ID查询积分流水列表
*/
List<MemberPointsRecord> selectByMemberId(@Param("memberId") String memberId);
/**
* 根据会员ID分页查询积分流水列表
*/
List<MemberPointsRecord> selectByMemberIdWithPage(@Param("memberId") String memberId);
/**
* 根据订单号查询积分流水
*/
List<MemberPointsRecord> selectByOrderCode(@Param("orderCode") String orderCode);
/**
* 插入积分流水记录
*/
int insert(MemberPointsRecord record);
/**
* 选择性插入积分流水记录
*/
int insertSelective(MemberPointsRecord record);
/**
* 根据主键更新
*/
int updateByPrimaryKey(MemberPointsRecord record);
/**
* 根据主键选择性更新
*/
int updateByPrimaryKeySelective(MemberPointsRecord record);
/**
* 根据主键删除
*/
int deleteByPrimaryKey(Long id);
}