# 2026-08-11 工作记录 ## 日志诊断:cms-api (websoft-modules) 报错 来源文件:/Users/gxwebsoft/Downloads/websoft-modules (1).log ### 主报错(反复出现,需修复) - 现象:`CmsWebsiteController.update()` → `updateById(cmsWebsite)` 生成非法 SQL `UPDATE cms_website WHERE website_id=? AND deleted=0`(SET 子句为空) - 抛错链:MyBatis-Plus `TenantLineInnerInterceptor` 用 jsqlparser 解析该空 SET SQL → `ParseException: Encountered unexpected token: "WHERE"` → `MybatisPlusException: Failed to process` - 根因:`application.yml` 未设置全局 `field-strategy`,MP 3.4.x 默认 `NOT_NULL`。当 PUT /cms/website 的 body 只有 websiteId(websiteCode 被置 null,其余字段全 null)时,`updateById` 没有任何非空字段可写 → SET 为空 → SQL 非法。 - 实体佐证:`CmsWebsite` 的 `@TableLogic deleted` 进 WHERE、`@TableId websiteId` 进 WHERE、`updateTime` 无 `@TableField(fill)` 自动填充 → 无字段兜底。 - 已修复(2026-08-11):在 `CmsWebsiteController.update()` 调用 `updateById` 前,用 `BeanUtil.beanToMap` 判断是否存在非 id/deleted 的非空字段;为空则直接 `success` 跳过 DB 更新。已新增 import `cn.hutool.core.bean.BeanUtil`。 ### 次要报错(非紧急) - 01:44:17 MQTT:client `hjm_car_1786362857263` keepAlive=20s 超时,`MQTT连接丢失`(GPS 回调)。Paho 通常会自动重连,疑为 broker 网络/keepalive 问题。 - 07:35:20 WARN Druid:`removeAbandoned is true, not use in production.` 连接池 abandoned 清理开启,Druid 不建议生产环境开启,属配置告警。