fix(system): cast null-check params to ::text in SysMessageMapper (PG $2 type inference 500)

PostgreSQL cannot infer the type of a bare bind in '(? IS NULL OR col = ?)',
failing GET /api/admin/messages with BadSqlGrammarException. Cast the
null-check occurrence to ::text (findAll category/locale, delete locale).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
zio 2026-07-14 02:02:31 +09:00
parent 1d46da8398
commit ecc00f8739

View File

@ -15,8 +15,8 @@ public interface SysMessageMapper {
@Select("SELECT msg_code AS \"msgCode\", locale, category, title, template, use_yn AS \"useYn\", "
+ "to_char(updated_at,'YYYY-MM-DD\"T\"HH24:MI:SS') AS \"updatedAt\" FROM sys_message "
+ "WHERE tenant_id = #{tenantId} "
+ "AND (#{category} IS NULL OR category = #{category}) "
+ "AND (#{locale} IS NULL OR locale = #{locale}) "
+ "AND (#{category}::text IS NULL OR category = #{category}) "
+ "AND (#{locale}::text IS NULL OR locale = #{locale}) "
+ "ORDER BY category, msg_code, locale")
List<Map<String, Object>> findAll(@Param("tenantId") String tenantId,
@Param("category") String category,
@ -45,7 +45,7 @@ public interface SysMessageMapper {
int upsert(Map<String, Object> p);
@Delete("DELETE FROM sys_message WHERE tenant_id = #{tenantId} AND msg_code = #{msgCode} "
+ "AND (#{locale} IS NULL OR locale = #{locale})")
+ "AND (#{locale}::text IS NULL OR locale = #{locale})")
int delete(@Param("tenantId") String tenantId,
@Param("msgCode") String msgCode,
@Param("locale") String locale);