diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index fd36cfc673..b2619618c5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -323,22 +323,8 @@ agency.ORGANIZATION_NAME AS agencyName, agency.LEVEL AS level, agency.CUSTOMER_ID as customerId, - ( CASE WHEN agency.longitude is null THEN - ( SELECT longitude FROM customer_agency - WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) - ORDER BY pid ASC LIMIT 1 - ) - ELSE agency.longitude - END - ) longitude, - ( CASE WHEN agency.latitude is null THEN - ( SELECT latitude FROM customer_agency - WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) - ORDER BY pid ASC LIMIT 1 - ) - ELSE agency.latitude - END - ) latitude + agency.longitude, + agency.latitude FROM CUSTOMER_AGENCY agency WHERE @@ -423,22 +409,8 @@ ca.pids pids, ca.pid pid, ca.level level, - ( CASE WHEN ca.longitude is null THEN - ( SELECT longitude FROM customer_agency - WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) - ORDER BY pid ASC LIMIT 1 - ) - ELSE ca.longitude - END - ) longitude, - ( CASE WHEN ca.latitude is null THEN - ( SELECT latitude FROM customer_agency - WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) - ORDER BY pid ASC LIMIT 1 - ) - ELSE ca.latitude - END - ) latitude + ca.longitude, + ca.latitude FROM customer_agency ca INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id