fix(hrm): 考勤汇总 yearMonth 字段加反引号,修复列表 500
现象:考勤统计汇总页面(/hrm/attendance/summary/page)报系统异常。
根因:HrmAttendanceSummaryDO.yearMonth 未加 @TableField,
MyBatis-Plus 按驼峰转下划线生成 year_month 列名,而 year_month
是 MySQL 保留字,SELECT 未加反引号导致 SQL 语法错误。
修复:加 @TableField(\`year_month\`),反引号包裹保留字。
| | |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.*; |
| | |
| | | |
| | | /** |
| | | * 年月,格式:yyyy-MM |
| | | * |
| | | * year_month 是 MySQL 保留字,需加反引号,否则查询报 SQL 语法错误 |
| | | */ |
| | | @TableField("`year_month`") |
| | | private String yearMonth; |
| | | |
| | | /** |