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:
parent
1d46da8398
commit
ecc00f8739
@ -15,8 +15,8 @@ public interface SysMessageMapper {
|
|||||||
@Select("SELECT msg_code AS \"msgCode\", locale, category, title, template, use_yn AS \"useYn\", "
|
@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 "
|
+ "to_char(updated_at,'YYYY-MM-DD\"T\"HH24:MI:SS') AS \"updatedAt\" FROM sys_message "
|
||||||
+ "WHERE tenant_id = #{tenantId} "
|
+ "WHERE tenant_id = #{tenantId} "
|
||||||
+ "AND (#{category} IS NULL OR category = #{category}) "
|
+ "AND (#{category}::text IS NULL OR category = #{category}) "
|
||||||
+ "AND (#{locale} IS NULL OR locale = #{locale}) "
|
+ "AND (#{locale}::text IS NULL OR locale = #{locale}) "
|
||||||
+ "ORDER BY category, msg_code, locale")
|
+ "ORDER BY category, msg_code, locale")
|
||||||
List<Map<String, Object>> findAll(@Param("tenantId") String tenantId,
|
List<Map<String, Object>> findAll(@Param("tenantId") String tenantId,
|
||||||
@Param("category") String category,
|
@Param("category") String category,
|
||||||
@ -45,7 +45,7 @@ public interface SysMessageMapper {
|
|||||||
int upsert(Map<String, Object> p);
|
int upsert(Map<String, Object> p);
|
||||||
|
|
||||||
@Delete("DELETE FROM sys_message WHERE tenant_id = #{tenantId} AND msg_code = #{msgCode} "
|
@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,
|
int delete(@Param("tenantId") String tenantId,
|
||||||
@Param("msgCode") String msgCode,
|
@Param("msgCode") String msgCode,
|
||||||
@Param("locale") String locale);
|
@Param("locale") String locale);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user