perf: 발주기관 건설현장 입력 시 기업사용자 찾기 쿼리 성능 개선

main
thkim 2026-02-06 10:27:25 +09:00
parent c5a8096ee0
commit d66f5bb604
1 changed files with 21 additions and 52 deletions

View File

@ -80,48 +80,17 @@
web_member_in wmi web_member_in wmi
WHERE WHERE
wmi.CLS = 1 wmi.CLS = 1
and wmi.COMPANY_NAME NOT IN ('111', 'a') AND wmi.COMPANY_NAME IS NOT NULL
and wmi.COMPANY_NAME is not NULL AND wmi.COMPANY_NAME NOT IN ('111', 'a')
and wmi.COMPANY_NAME LIKE '%' || #{companyName} || '%' <choose>
UNION <when test='companyName != null and companyName.length() >= 2'>
SELECT AND CONTAINS(wmi.COMPANY_NAME, '%' || #{companyName} || '%') > 0
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME, </when>
wmi.USERID, <otherwise>
TRIM(wmi.PART_NAME) AS PART_NAME, AND 1 = 0
wmi.EMAIL </otherwise>
FROM </choose>
web_member_in wmi AND ROWNUM &lt;= 50
WHERE
wmi.CLS = 1
and wmi.COMPANY_NAME NOT IN ('111', 'a')
and wmi.COMPANY_NAME is not NULL
and wmi.USER_NAME like '%' || #{companyName} || '%'
UNION
SELECT
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
wmi.USERID,
TRIM(wmi.PART_NAME) AS PART_NAME,
wmi.EMAIL
FROM
web_member_in wmi
WHERE
wmi.CLS = 1
and wmi.COMPANY_NAME NOT IN ('111', 'a')
and wmi.COMPANY_NAME is not NULL
and wmi.USERID like '%' || #{companyName} || '%'
UNION
SELECT
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
wmi.USERID,
TRIM(wmi.PART_NAME) AS PART_NAME,
wmi.EMAIL
FROM
web_member_in wmi
WHERE
wmi.CLS = 1
and wmi.COMPANY_NAME NOT IN ('111', 'a')
and wmi.COMPANY_NAME is not NULL
and wmi.EMAIL like '%' || #{companyName} || '%'
</select> </select>
<select id="getDepartments" parameterType="map" resultType="egovMap"> <select id="getDepartments" parameterType="map" resultType="egovMap">