qiangdanxitong/backend/src/main/java/com/designhub/mapper/ProgressDeductionLogMapper.java
Your Name 78aac4dc9a fix: 修复扣分明细表格UI样式和数据不一致问题
1. 修复表格UI样式,严格对比用户管理页面,添加滚动条,防止闪白
2. 修复扣分数据不一致:sumMonthlyDeduction只统计主任务扣分,与明细保持一致
2026-01-13 17:21:04 +08:00

36 lines
1.2 KiB
Java

package com.designhub.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.designhub.entity.ProgressDeductionLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
/**
* 进度未更新扣分记录Mapper
*/
@Mapper
public interface ProgressDeductionLogMapper extends BaseMapper<ProgressDeductionLog> {
/**
* 查询用户指定月份的扣分总额(仅主任务)
*/
@Select("SELECT COALESCE(SUM(deduction_score), 0) FROM progress_deduction_log " +
"WHERE user_id = #{userId} " +
"AND YEAR(deduction_date) = #{year} " +
"AND MONTH(deduction_date) = #{month} " +
"AND task_item_id IS NULL")
BigDecimal sumMonthlyDeduction(@Param("userId") Long userId,
@Param("year") int year,
@Param("month") int month);
/**
* 查询用户总扣分
*/
@Select("SELECT COALESCE(SUM(deduction_score), 0) FROM progress_deduction_log WHERE user_id = #{userId}")
BigDecimal sumTotalDeduction(@Param("userId") Long userId);
}