qiangdanxitong/backend/src/main/java/com/designhub/mapper/ProgressDeductionLogMapper.java
Your Name dceff515b7 feat: 添加每日进度更新检查功能
- 设计师大厅排行榜默认折叠,点击展开
- 系统设置添加每日未更新扣分配置项
- 每天18点检查设计师是否更新进度,未更新则扣分并发钉钉通知
- 扣分同步到数据分析页面设计师绩效的延误扣分
2026-01-08 14:46:41 +08:00

35 lines
1.1 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}")
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);
}