使用PostgreSQL 18, 设计删除字段
is_deleted BOOLEAN NOT NULL DEFAULT FALSE, -- 是否删除
this.saveOrUpdate(entity);
更新时SQL提示: Caused by: org.postgresql.util.PSQLException: 错误: 操作符不存在: boolean = integer
2026-01-26 11:26:28.473 DEBUG 436442 --- [ XNIO-1 task-2] o.s.core.tenant.BladeTenantInterceptor : original SQL: UPDATE employee SET account_id=?, staff_number=?, real_name=?, department_id=?, position_id=?, birth_date=?, hire_date=?, employment_type=?, emergency_contact=?, emergency_phone=?, created_by=?, modified_time=? WHERE id=? AND is_deleted=0
2026-01-26 11:26:28.475 DEBUG 436442 --- [ XNIO-1 task-2] o.s.core.tenant.BladeTenantInterceptor : SQL to parse, SQL: UPDATE employee SET account_id=?, staff_number=?, real_name=?, department_id=?, position_id=?, birth_date=?, hire_date=?, employment_type=?, emergency_contact=?, emergency_phone=?, created_by=?, modified_time=? WHERE id=? AND is_deleted=0
2026-01-26 11:26:28.475 DEBUG 436442 --- [ XNIO-1 task-2] o.s.core.tenant.BladeTenantInterceptor : parse the finished SQL: UPDATE employee SET account_id = ?, staff_number = ?, real_name = ?, department_id = ?, position_id = ?, birth_date = ?, hire_date = ?, employment_type = ?, emergency_contact = ?, emergency_phone = ?, created_by = ?, modified_time = ? WHERE id = ? AND is_deleted = 0
2026-01-26 11:26:28.496 ERROR 436442 --- [ XNIO-1 task-2] o.s.c.l.e.BladeRestExceptionTranslator : 业务异常
org.springblade.core.log.exception.ServiceException: org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: boolean = integer
Hint: 没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
Position: 281
### The error may exist in com/hwkis/berrymall/plm/modules/system/mapper/EmployeeMapper.java (best guess)
### The error may involve com.hwkis.berrymall.plm.modules.system.mapper.EmployeeMapper.updateById-Inline
### The error occurred while setting parameters
### SQL: UPDATE employee SET account_id = ?, staff_number = ?, real_name = ?, department_id = ?, position_id = ?, birth_date = ?, hire_date = ?, employment_type = ?, emergency_contact = ?, emergency_phone = ?, created_by = ?, modified_time = ? WHERE id = ? AND is_deleted = 0
### Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: boolean = integer
Hint: 没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
Position: 281
; bad SQL grammar []
Caused by: org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: boolean = integer
Hint: 没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
Position: 281
### The error may exist in com/hwkis/berrymall/plm/modules/system/mapper/EmployeeMapper.java (best guess)
### The error may involve com.hwkis.berrymall.plm.modules.system.mapper.EmployeeMapper.updateById-Inline
### The error occurred while setting parameters
### SQL: UPDATE employee SET account_id = ?, staff_number = ?, real_name = ?, department_id = ?, position_id = ?, birth_date = ?, hire_date = ?, employment_type = ?, emergency_contact = ?, emergency_phone = ?, created_by = ?, modified_time = ? WHERE id = ? AND is_deleted = 0
### Cause: org.postgresql.util.PSQLException: 错误: 操作符不存在: boolean = integer
Hint: 没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
Position: 281
; bad SQL grammar []
扫一扫访问 Blade技术社区 移动端