Przeglądaj źródła

fix(mapper): 修复 PointsLogMapper.selectSum SQL 占位符转义及字段名错误

- 修复 @Select 中 $\{ew.customSqlSegment\} 的错误转义导致字面解析问题
- 将 SUM(points) 修正为 SUM(amount),与 points_log 表结构一致
- 修复任务完成接口 /api/tasks/{id}/complete 在 calculateLatePenalty 路径抛 BadSqlGrammarException
Xiaogang Liao 5 dni temu
rodzic
commit
145d6ce420

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/mapper/PointsLogMapper.java

@@ -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);
 }