[BO] 관리자 에러 수정

This commit is contained in:
kangsunlee
2025-07-15 12:04:36 +09:00
parent cb8525c7b2
commit 2ed5495ac6
19 changed files with 408 additions and 383 deletions

View File

@@ -23,8 +23,14 @@
LEFT JOIN uicode u ON u.parent_id = 'code.region.main' AND u.id = a.region_main_code
WHERE a.is_deleted = false
<if test="cmd.searchField != null and cmd.searchValue != null and cmd.searchValue != ''">
<if test="cmd.searchValue != null and cmd.searchValue != ''">
<choose>
<when test="cmd.searchField == ''">
AND (
a.id ILIKE '%' || #{cmd.searchValue} || '%'
OR a.name ILIKE '%' || #{cmd.searchValue} || '%'
)
</when>
<when test="cmd.searchField == 'name'">AND a.name LIKE '%' || #{cmd.searchValue} || '%'</when>
<when test="cmd.searchField == 'id'">AND a.id LIKE '%' || #{cmd.searchValue} || '%'</when>
</choose>
@@ -48,24 +54,7 @@
)
</if>
<if test="pageable.sort != null and !pageable.sort.isEmpty()">
ORDER BY
<foreach collection="pageable.sort" item="order" separator=",">
<choose>
<when test="order.property eq 'id'">a.id</when>
<when test="order.property eq 'email'">a.email</when>
<when test="order.property eq 'accountDisabled'">a.account_disabled</when>
<when test="order.property eq 'accountLocked'">a.account_locked</when>
<when test="order.property eq 'createdAt'">a.created_at</when>
<when test="order.property eq 'updatedAt'">a.updated_at</when>
<otherwise>a.created_at</otherwise>
</choose>
<choose>
<when test="order.direction.toString() eq 'DESC'">DESC</when>
<otherwise>ASC</otherwise>
</choose>
</foreach>
</if>
ORDER BY a.seq DESC
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
</select>