2348800e68
Build & Deploy to K8s / build-and-deploy (push) Successful in 9m22s
카테고리/캐스케이딩 시스템 (B/C/D) 전부 폐기:
- BE: mapper/Service/Controller 9세트 삭제 (cascading*, categoryTree, tableCategoryValue, categoryValueCascading, codeMerge)
- FE: 페이지 3 + API 8 + hooks 2 + 폐기 컴포넌트 6 삭제, 14곳 의존성 정리
- DB: 12 테이블 DROP, TABLE_TYPE_COLUMNS.CODE_CATEGORY → CODE_INFO rename
신설 commonCode 마스터-디테일:
- code_info: 1레벨 그룹 마스터
- code_detail: 2~∞ depth 재귀 트리 (parent_detail_id self-FK, depth 자동 계산)
- API: /api/common-codes/{info,detail}
- CodeCategoryFormModal/Panel → CodeInfoFormModal/Panel rename
- code_category 컬럼명 전부 code_info 로 치환 (mapper/Java/FE)
- 옛 commonCode API URL (/categories/...) → getCodeOptions 어댑터 + /detail?code_info=... 전환
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
149 lines
4.7 KiB
XML
149 lines
4.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="entitySearch">
|
|
|
|
<!-- ================================================================
|
|
정적 쿼리: 테이블 컬럼 목록 조회
|
|
================================================================ -->
|
|
|
|
<select id="getTableColumnList" parameterType="map" resultType="map">
|
|
SELECT column_name
|
|
|
|
FROM information_schema.columns
|
|
|
|
WHERE table_schema = 'public'
|
|
AND table_name = #{table_name}
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
정적 쿼리: category_values 라벨 조회
|
|
================================================================ -->
|
|
|
|
<select id="getCategoryValueList" parameterType="map" resultType="map">
|
|
SELECT value_code, value_label
|
|
|
|
FROM category_values
|
|
|
|
WHERE table_name = #{table_name}
|
|
AND column_name = #{column_name}
|
|
AND value_code IN
|
|
<foreach collection="rawValues" item="v" open="(" separator="," close=")">
|
|
#{v}
|
|
</foreach>
|
|
AND is_active = TRUE
|
|
<if test="company_code != null and company_code != "*"">
|
|
AND (company_code = #{company_code} OR company_code = '*')
|
|
</if>
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
정적 쿼리: table_type_columns의 code_info 조회
|
|
================================================================ -->
|
|
|
|
<select id="getCodeCategoryInfo" parameterType="map" resultType="map">
|
|
SELECT code_info
|
|
|
|
FROM table_type_columns
|
|
|
|
WHERE table_name = #{table_name}
|
|
AND column_name = #{column_name}
|
|
AND code_info IS NOT NULL
|
|
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
정적 쿼리: code_info 코드명 조회
|
|
================================================================ -->
|
|
|
|
<select id="getCodeInfoList" parameterType="map" resultType="map">
|
|
SELECT code_value, code_name
|
|
|
|
FROM code_info
|
|
|
|
WHERE code_info = #{code_info}
|
|
AND code_value IN
|
|
<foreach collection="rawValues" item="v" open="(" separator="," close=")">
|
|
#{v}
|
|
</foreach>
|
|
AND is_active = 'Y'
|
|
<if test="company_code != null and company_code != "*"">
|
|
AND (company_code = #{company_code} OR company_code = '*')
|
|
</if>
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
정적 쿼리: PK 컬럼 조회 (pg_index 사용)
|
|
================================================================ -->
|
|
|
|
<select id="getPrimaryKeyInfo" parameterType="map" resultType="map">
|
|
SELECT a.attname AS column_name
|
|
|
|
FROM pg_index i
|
|
|
|
JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)
|
|
|
|
WHERE i.indrelid = #{table_name}::regclass
|
|
AND i.indisprimary
|
|
|
|
ORDER BY array_position(i.indkey, a.attnum)
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
동적 쿼리: 엔티티 검색
|
|
tableName, whereClause, orderByColumn: ${...} 치환 (Java에서 sanitize)
|
|
condVal_N: #{...} 바인딩 (안전한 파라미터)
|
|
================================================================ -->
|
|
|
|
<select id="getEntitySearchList" parameterType="map" resultType="map">
|
|
SELECT * FROM ${tableName}
|
|
|
|
WHERE 1=1 ${whereClause}
|
|
|
|
ORDER BY ${orderByColumn} DESC
|
|
LIMIT #{page_limit} OFFSET #{page_offset}
|
|
</select>
|
|
|
|
<select id="getEntitySearchListCnt" parameterType="map" resultType="int">
|
|
SELECT COUNT(*) FROM ${tableName}
|
|
|
|
WHERE 1=1 ${whereClause}
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
동적 쿼리: 엔티티 옵션 (V2Select용)
|
|
selectColumns: "valueCol as value, labelCol as label [, extra...]"
|
|
================================================================ -->
|
|
|
|
<select id="getEntityOptionList" parameterType="map" resultType="map">
|
|
SELECT ${selectColumns}
|
|
|
|
FROM ${tableName}
|
|
|
|
WHERE 1=1 ${whereClause}
|
|
|
|
ORDER BY ${labelColumn} ASC
|
|
LIMIT 500
|
|
</select>
|
|
|
|
<!-- ================================================================
|
|
동적 쿼리: 컬럼 DISTINCT 값 조회
|
|
================================================================ -->
|
|
|
|
<select id="getDistinctValueList" parameterType="map" resultType="map">
|
|
SELECT DISTINCT ${valueColumn} AS value, ${labelColumn} AS label
|
|
|
|
FROM ${tableName}
|
|
|
|
WHERE ${valueColumn} IS NOT NULL
|
|
AND ${valueColumn}::text != ''
|
|
${whereClause}
|
|
|
|
ORDER BY ${labelColumn} ASC
|
|
LIMIT 500
|
|
</select>
|
|
|
|
</mapper>
|