From 944b9475b16cd607e2e08a0788bc6464e1a077dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A3=BC=EC=9A=B0=EC=84=B1?= Date: Sat, 14 Jun 2025 20:25:19 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9B=94=EB=B3=84,=20=EC=9E=84=EC=82=B0?= =?UTF-8?q?=EB=AC=BC=20sql=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monthly/GetMonthlyInputStatussMapper.xml | 2 +- .../product/GetForestProductsMapper.xml | 2 +- .../adapters/web/GetMontylysUIController.java | 28 ++- .../adapters/web/model/GetMontylyssReqVO.java | 16 ++ .../templates/info/monthly/monthlys.html | 160 +++++------------- 5 files changed, 86 insertions(+), 122 deletions(-) create mode 100644 front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java diff --git a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml index dc27d809..c104e6a9 100644 --- a/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml +++ b/core/src/main/resources/mappers/monthly/GetMonthlyInputStatussMapper.xml @@ -17,7 +17,7 @@ a.created_at AS createdAt, a.created_by AS createdBy, a.updated_at AS updatedAt, - a.updated_by AS updatedBy + a.updated_by AS updatedBy, COUNT(*) OVER () AS total FROM monthly_input_status a WHERE a.is_deleted = false diff --git a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml index fb326f84..f18b4593 100644 --- a/core/src/main/resources/mappers/product/GetForestProductsMapper.xml +++ b/core/src/main/resources/mappers/product/GetForestProductsMapper.xml @@ -30,7 +30,7 @@ a.created_at AS createdAt, a.created_by AS createdBy, a.updated_at AS updatedAt, - a.updated_by AS updatedBy + a.updated_by AS updatedBy, COUNT(*) OVER () AS total FROM forest_product a WHERE a.is_deleted = false diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java index 98ec695c..d40c7b7c 100644 --- a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java +++ b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/GetMontylysUIController.java @@ -3,7 +3,18 @@ package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web; import app.module.core.config.application.util.CommonUtil; import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn; import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd; +import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss; +import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd; +import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNotices; +import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNoticesCmd; +import app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMontylyssReqVO; import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.web.PageableDefault; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @@ -12,14 +23,23 @@ import org.springframework.web.bind.annotation.GetMapping; @RequiredArgsConstructor class GetMontylysUIController { - private final GetHouseholdPortIn getHouseholdPortIn; + + private final GetMonthlyInputStatussPortIn portIn; + @GetMapping(path = "/info/monthly") - String operate(Model model) { + String operate(Model model, + @PageableDefault(sort = "month", direction = Sort.Direction.DESC, page = 0, size = 13) Pageable pageable, + GetMontylyssReqVO reqVO) { - model.addAttribute("userInfo", - getHouseholdPortIn.operate(new GetHouseholdCmd(CommonUtil.getLoginUsername())).orElseThrow()); + Page notices = + portIn.operate( + pageable, + new GetMonthlyInputStatussCmd( + reqVO.getSearchField(), reqVO.getSearchValue())); + model.addAttribute("reqVO", reqVO); + model.addAttribute("list", notices); return "info/monthly/monthlys"; } } \ No newline at end of file diff --git a/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java new file mode 100644 index 00000000..dffe04f2 --- /dev/null +++ b/front/src/main/java/app/module/front/usecase/info/monthly/getMonthlysUI/adapters/web/model/GetMontylyssReqVO.java @@ -0,0 +1,16 @@ +package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetMontylyssReqVO { + + private String searchField; + private String searchValue; +} diff --git a/front/src/main/resources/templates/info/monthly/monthlys.html b/front/src/main/resources/templates/info/monthly/monthlys.html index 59e58ddd..5d89cbb8 100644 --- a/front/src/main/resources/templates/info/monthly/monthlys.html +++ b/front/src/main/resources/templates/info/monthly/monthlys.html @@ -2,126 +2,54 @@ -
-
- - - -
-
- - - -
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
- - - - - - - - - - -
- - -
-
-
- -
-
+
+
+
+
+

+ 월별 등록된 임산물 현황을
확인하세요. +

+
+ +
+
-