diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java b/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java index 3d1a4b5..85d7cf9 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinCivBoard680.java @@ -1,6 +1,5 @@ package com.xit.biz.ctgy.entity; -import com.xit.biz.ctgy.CtgyConstants; import com.xit.core.oauth2.utils.HeaderUtil; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -9,10 +8,13 @@ import org.hibernate.annotations.DynamicUpdate; import org.springframework.data.domain.Persistable; import javax.persistence.*; -import java.io.Serializable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "MinCivBoard680", description = "게시판") @Table(name = "min_civ_board680", schema = "", catalog = "") @Entity diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java index c091380..f4e418c 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680.java @@ -9,6 +9,10 @@ import org.springframework.data.domain.Persistable; import javax.persistence.*; import java.time.LocalDate; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "MinSimsa680", description = "민원심사") @Table(name = "min_simsa680", schema = "", catalog = "") @Entity diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java index b6c4e0e..fd3155b 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinSimsa680Sc.java @@ -12,6 +12,10 @@ import javax.persistence.Id; import javax.persistence.Table; import java.time.LocalDate; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "MinSimsa680Sc", description = "민원심사") @Table(name = "min_simsa680_sc", schema = "", catalog = "") @Entity diff --git a/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java b/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java index 3ad72f4..a2b9b70 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java +++ b/src/main/java/com/xit/biz/ctgy/entity/MinUserinfo.java @@ -12,6 +12,10 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Objects; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "MinUserinfo", description = "null") @Table(name = "min_userinfo", schema = "", catalog = "") @Entity diff --git a/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java b/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java index 4915a68..efb6174 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java +++ b/src/main/java/com/xit/biz/ctgy/entity/Tf680Main.java @@ -4,10 +4,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; +import org.springframework.data.domain.Persistable; import javax.persistence.*; import java.io.Serializable; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "Tf680Main", description = "메인") @Table(name = "tf680_main", schema = "", catalog = "") @Entity @@ -17,9 +22,7 @@ import java.io.Serializable; @NoArgsConstructor(access = AccessLevel.PROTECTED) @Getter @Builder -public class Tf680Main implements Serializable { - private static final long SerialVersionUID = 1L; - +public class Tf680Main implements Persistable { @Id @Schema(required = true, title = "메인코드", example = " ", description = "Input Description...") @Column(name = "mm_code", nullable = false) @@ -330,4 +333,13 @@ public class Tf680Main implements Serializable { private String virtlacnutnoF; + @Override + public Long getId() { + return this.mmCode; + } + + @Override + public boolean isNew() { + return this.mmCode == 0L; + } } diff --git a/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java b/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java index 39644c3..0fe9a68 100644 --- a/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java +++ b/src/main/java/com/xit/biz/ctgy/entity/Tf680Recall.java @@ -9,6 +9,10 @@ import org.springframework.data.domain.Persistable; import javax.persistence.*; import java.io.Serializable; +/** + * ID를 manual set 하는 경우 + * Persistable 구현 필요 : persitance 처리시 신규인지 체크에 필요한 getId 와 isNew Override + */ @Schema(name = "Tf680Recall", description = "민원") @Table(name = "tf680_recall", schema = "", catalog = "") @Entity @@ -27,10 +31,7 @@ public class Tf680Recall implements Persistable { @Schema(required = false, title = "메인코드", example = " ", description = "Input Description...") @Column(name = "rc_maincode", nullable = true) - //@OneToOne(fetch = FetchType.LAZY) - //@JoinColumn(name = "mm_code") private Long rcMaincode; - //private Tf680Main tf680Main; @Schema(required = false, title = "민원구분(1:의견진술, 2:이의신청)", example = " ", description = "Input Description...") @Column(name = "rc_gb", nullable = true) diff --git a/src/main/java/com/xit/biz/ctgy/repository/IBoardRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IBoardRepository.java index e050030..7b8495b 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IBoardRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IBoardRepository.java @@ -4,6 +4,7 @@ import com.xit.biz.ctgy.entity.MinCivBoard680; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import java.util.List; @@ -14,7 +15,7 @@ public interface IBoardRepository extends JpaRepository, I @Modifying(clearAutomatically = true) @Query("UPDATE MinCivBoard680 m SET m.ciHit = m.ciHit + 1 WHERE m.ciCode = :ciCode") - int updateInHitForMinCivBoard680(Long ciCode); + int updateInHitForMinCivBoard680(@Param("ciCode") Long ciCode); List findByCiRef(Long ciCode); } diff --git a/src/main/java/com/xit/biz/ctgy/repository/IPublicBoardRepository.java b/src/main/java/com/xit/biz/ctgy/repository/IPublicBoardRepository.java index 63e4240..603fa97 100644 --- a/src/main/java/com/xit/biz/ctgy/repository/IPublicBoardRepository.java +++ b/src/main/java/com/xit/biz/ctgy/repository/IPublicBoardRepository.java @@ -7,6 +7,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface IPublicBoardRepository extends JpaRepository { @@ -17,5 +18,5 @@ public interface IPublicBoardRepository extends JpaRepository { @Modifying @Query(value = "UPDATE #{#entityName} m SET m.rcIrTransfer = '1', m.rcState = '0' WHERE m.rcCode = :msMaincode") - int updateRcIrTransferAndRcState(@Param("msMaincode")Long msMaincode); + int updateRcIrTransferAndRcState(@Param("msMaincode") Long msMaincode); }