- 修复 @Select 中 $\{ew.customSqlSegment\} 的错误转义导致字面解析问题 - 将 SUM(points) 修正为 SUM(amount),与 points_log 表结构一致 - 修复任务完成接口 /api/tasks/{id}/complete 在 calculateLatePenalty 路径抛 BadSqlGrammarException
@@ -10,6 +10,6 @@ import org.apache.ibatis.annotations.Select;
@Mapper
public interface PointsLogMapper extends BaseMapper<PointsLog> {
- @Select("SELECT COALESCE(SUM(points), 0) FROM points_log ${'$'}{ew.customSqlSegment}")
+ @Select("SELECT COALESCE(SUM(amount), 0) FROM points_log ${ew.customSqlSegment}")
Integer selectSum(@Param("ew") LambdaQueryWrapper<PointsLog> wrapper);
}