From 70c781a54e114f38726e68f2bc6b2f131add0ee7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-TKLFCPR\\ython" Date: Sat, 20 Jun 2026 20:50:34 +0900 Subject: [PATCH] =?UTF-8?q?feat(uiws):=20UIWS=20=EC=97=85=EB=AC=B4?= =?UTF-8?q?=EB=AA=A8=EB=93=88(=EC=97=85=EB=AC=B4=EC=9D=BC=EC=A7=80=C2=B7?= =?UTF-8?q?=EC=9D=BC=EC=A0=95=C2=B7=EC=AA=BD=EC=A7=80=C2=B7=ED=86=B5?= =?UTF-8?q?=EA=B3=84)+2FA=20=EC=9D=B4=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .../schedule/mapper/UiwsScheduleMapper.java | 93 +++++++++++++++++++ .../schedule/service/AttachmentService.java | 4 +- .../uiws/schedule/service/DiaryService.java | 4 +- .../schedule/service/ScheduleService.java | 4 +- .../resources/mapper/uiws/ScheduleMapper.xml | 2 +- 5 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 backend/src/main/java/com/zioinfo/mall/uiws/schedule/mapper/UiwsScheduleMapper.java diff --git a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/mapper/UiwsScheduleMapper.java b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/mapper/UiwsScheduleMapper.java new file mode 100644 index 0000000..3d756b0 --- /dev/null +++ b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/mapper/UiwsScheduleMapper.java @@ -0,0 +1,93 @@ +package com.zioinfo.mall.uiws.schedule.mapper; + +import com.zioinfo.mall.uiws.schedule.model.UiwsAttach; +import com.zioinfo.mall.uiws.schedule.model.UiwsDiary; +import com.zioinfo.mall.uiws.schedule.model.UiwsSchedule; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +/** + * 일정·일지·첨부 MyBatis 매퍼. 원본 JPA ScheduleRepository/DiaryRepository/AttachRepository 변환 이식. + * 데이터 가시범위: scopeAll(true=ADMIN 전체) OR owner IN (ownerIds). ownerIds 는 항상 본인 포함(빈 IN 회피). + */ +@Mapper +public interface UiwsScheduleMapper { + + // ── schedule + int insertSchedule(UiwsSchedule s); + + int updateSchedule(UiwsSchedule s); + + UiwsSchedule findScheduleById(@Param("scheduleId") Long scheduleId); + + boolean existsScheduleById(@Param("scheduleId") Long scheduleId); + + int deleteScheduleById(@Param("scheduleId") Long scheduleId); + + /** 달력: 기간 겹침([from,to) 배타 상한) + type + 개인소유/부서필터. */ + List findInRange(@Param("from") LocalDateTime from, + @Param("to") LocalDateTime to, + @Param("scheType") String scheType, + @Param("ownerId") String ownerId, + @Param("deptId") String deptId); + + List searchAll(@Param("from") LocalDateTime from, + @Param("to") LocalDateTime to, + @Param("scheType") String scheType, + @Param("scopeAll") boolean scopeAll, + @Param("ownerIds") List ownerIds, + @Param("limit") int limit, + @Param("offset") int offset); + + long countAll(@Param("from") LocalDateTime from, + @Param("to") LocalDateTime to, + @Param("scheType") String scheType, + @Param("scopeAll") boolean scopeAll, + @Param("ownerIds") List ownerIds); + + List searchPopup(@Param("keyword") String keyword, + @Param("scopeAll") boolean scopeAll, + @Param("ownerIds") List ownerIds); + + // ── diary + int insertDiary(UiwsDiary d); + + int updateDiary(UiwsDiary d); + + UiwsDiary findDiaryById(@Param("diaryId") Long diaryId); + + boolean existsDiaryById(@Param("diaryId") Long diaryId); + + int deleteDiaryById(@Param("diaryId") Long diaryId); + + List searchDiary(@Param("from") LocalDate from, + @Param("to") LocalDate to, + @Param("limit") int limit, + @Param("offset") int offset); + + long countDiary(@Param("from") LocalDate from, @Param("to") LocalDate to); + + // ── attach + int insertAttach(UiwsAttach a); + + UiwsAttach findAttachById(@Param("attachId") Long attachId); + + int updateAttachRef(@Param("attachId") Long attachId, + @Param("refType") String refType, + @Param("refId") Long refId, + @Param("actor") String actor); + + List findAttachByRef(@Param("refType") String refType, @Param("refId") Long refId); + + int deleteAttachById(@Param("attachId") Long attachId); + + int deleteAttachByRef(@Param("refType") String refType, @Param("refId") Long refId); + + // ── 사용자명 라벨(코어 user 재사용) + List> findUserNames(@Param("ids") List ids); +} diff --git a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/AttachmentService.java b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/AttachmentService.java index a897c2c..704b391 100644 --- a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/AttachmentService.java +++ b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/AttachmentService.java @@ -4,7 +4,7 @@ import com.zioinfo.mall.uiws.common.UiwsApiException; import com.zioinfo.mall.uiws.common.UiwsCurrentUser; import com.zioinfo.mall.uiws.common.UiwsErrorCode; import com.zioinfo.mall.uiws.schedule.dto.ScheduleDtos.AttachmentDto; -import com.zioinfo.mall.uiws.schedule.mapper.ScheduleMapper; +import com.zioinfo.mall.uiws.schedule.mapper.UiwsScheduleMapper; import com.zioinfo.mall.uiws.schedule.model.UiwsAttach; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -28,7 +28,7 @@ public class AttachmentService { public static final String REF_DIARY = "DIARY"; private static final Set VALID_REF_TYPES = Set.of(REF_SCHEDULE, REF_DIARY); - private final ScheduleMapper mapper; + private final UiwsScheduleMapper mapper; private final FileStorageService fileStorageService; @Transactional diff --git a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/DiaryService.java b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/DiaryService.java index aed766f..78f734d 100644 --- a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/DiaryService.java +++ b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/DiaryService.java @@ -4,7 +4,7 @@ import com.zioinfo.mall.uiws.common.UiwsApiException; import com.zioinfo.mall.uiws.common.UiwsCurrentUser; import com.zioinfo.mall.uiws.common.UiwsErrorCode; import com.zioinfo.mall.uiws.schedule.dto.ScheduleDtos.*; -import com.zioinfo.mall.uiws.schedule.mapper.ScheduleMapper; +import com.zioinfo.mall.uiws.schedule.mapper.UiwsScheduleMapper; import com.zioinfo.mall.uiws.schedule.model.UiwsDiary; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -24,7 +24,7 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class DiaryService { - private final ScheduleMapper mapper; + private final UiwsScheduleMapper mapper; private final AttachmentService attachmentService; @Transactional(readOnly = true) diff --git a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/ScheduleService.java b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/ScheduleService.java index 82b279f..86196f9 100644 --- a/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/ScheduleService.java +++ b/backend/src/main/java/com/zioinfo/mall/uiws/schedule/service/ScheduleService.java @@ -5,7 +5,7 @@ import com.zioinfo.mall.uiws.common.UiwsCurrentUser; import com.zioinfo.mall.uiws.common.UiwsDataScope; import com.zioinfo.mall.uiws.common.UiwsErrorCode; import com.zioinfo.mall.uiws.schedule.dto.ScheduleDtos.*; -import com.zioinfo.mall.uiws.schedule.mapper.ScheduleMapper; +import com.zioinfo.mall.uiws.schedule.mapper.UiwsScheduleMapper; import com.zioinfo.mall.uiws.schedule.model.UiwsSchedule; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -32,7 +32,7 @@ public class ScheduleService { private static final String TYPE_DEPT = "DEPT"; private static final DateTimeFormatter DT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); - private final ScheduleMapper mapper; + private final UiwsScheduleMapper mapper; private final AttachmentService attachmentService; @Transactional(readOnly = true) diff --git a/backend/src/main/resources/mapper/uiws/ScheduleMapper.xml b/backend/src/main/resources/mapper/uiws/ScheduleMapper.xml index f01bdc9..bcb663a 100644 --- a/backend/src/main/resources/mapper/uiws/ScheduleMapper.xml +++ b/backend/src/main/resources/mapper/uiws/ScheduleMapper.xml @@ -3,7 +3,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - +