Files
frontend/apps/wr/app/store/stats/rswtStat/excel.tsx
T
YangJinSoo94 8cccf62a91 - 법적대상여부 (Y/N > 대상/미대상)
- 설치완료일자 NULL이면 빈칸으로
- 중수도+대체수 이용량 시도,시군구 합계 추가
2025-06-20 10:28:21 +09:00

46 lines
1.4 KiB
TypeScript

import type { RswtStatProps } from ".";
export const excelRswtStat = (excelList:RswtStatProps[]) : (string | number)[][] => {
const excelData: (string | number)[][] = [];
excelList.forEach((item) => {
excelData.push([
//시도
String(item.ctpvCd) ?? "",
//시군구
String(item.sggCd) ?? "",
//행정구역명
String(item.areaNm) ?? "",
//건축물명
String(item.bdstNm) ?? "",
//건축물용도코드(빈칸)
//String(item.bdstUsgCd) ?? "",
"",
//주소
String(item.daddr) ?? "",
//법적의무대상여부
String(item.lawTrgtYn)==="Y" ? "대상" : "미대상",
//설치완료일자
item.instlCmptnDt ? String(item.instlCmptnDt).substring(0, 10) : "",
//가동개시일(빈칸)
//String(item.instlCst) ?? "",
"",
//건축물면적
item.archArea ?? "",
//처리용량
item.filtrTrtmfctCpct ?? "",
//물사용량
item.wtrUsqty ?? "",
//중수도+대체수이용량
item.rswtAltSum ?? "",
//중수도이용량
item.rswtrUsqty ?? "",
//대체수이용량
item.altUswtrUtztnQnt ?? "",
//중수도용도
String(item.utztnUsgCd) ?? "",
//연간운영비
item.anlOperCst ?? "",
]);
});
return excelData;
}