shjung 2 éve
szülő
commit
32787c093e

+ 16 - 16
src/main/java/com/its/op/controller/its/database/TbLinkParaStupController.java

@@ -29,17 +29,17 @@ public class TbLinkParaStupController {
     }
 
     @ApiOperation(value = "개별조회(TB_LINK_PARA_STUP)", response = TbLinkParaStupDto.class)
-    @GetMapping(value = "/{paramId}", produces = {"application/json; charset=utf8"})
-    public TbLinkParaStupDto findById(@PathVariable final Long paramId) {
-        return this.service.findById(paramId);
+    @GetMapping(value = "/{paraId}", produces = {"application/json; charset=utf8"})
+    public TbLinkParaStupDto findById(@PathVariable final Long paraId) {
+        return this.service.findById(paraId);
     }
 
     @ApiOperation(value = "개별정보변경/생성(TB_LINK_PARA_STUP)", response = TbLinkParaStupDto.class)
-    @PostMapping(value = "/{paramId}", produces = {"application/json; charset=utf8"})
+    @PostMapping(value = "/{paraId}", produces = {"application/json; charset=utf8"})
     public TbLinkParaStupDto mergeInfo(
-            @PathVariable final Long paramId,
+            @PathVariable final Long paraId,
             @RequestBody final TbLinkParaStupDto.TbLinkParaStupModReq req) {
-        return this.service.mergeInfo(paramId, req.getPara(), req.getDetl(), req.getClcts());
+        return this.service.mergeInfo(paraId, req.getPara(), req.getDetl(), req.getClcts());
     }
 
     @ApiOperation(value = "신규 파라미터 ID 조회(TB_LINK_PARA_STUP)", response = NewIdLongDto.class)
@@ -49,11 +49,11 @@ public class TbLinkParaStupController {
     }
 
     @ApiOperation(value = "파라미터 사용여부 조회(삭제시 사용)", response = UsageCountDto.class)
-    @GetMapping(value = "/usage/{paramId}", produces = {"application/json; charset=utf8"})
+    @GetMapping(value = "/usage/{paraId}", produces = {"application/json; charset=utf8"})
     public UsageCountDto findUsageId(
-            @ApiParam(name = "paramId", value = "파라미터 ID", example = "1", required = true)
-            @PathVariable final Long paramId) {
-        return this.service.findUsageId(paramId);
+            @ApiParam(name = "paraId", value = "파라미터 ID", example = "1", required = true)
+            @PathVariable final Long paraId) {
+        return this.service.findUsageId(paraId);
     }
 
 //    @ApiOperation(value = "파라미터 정보삭제-개별(TB_LINK_PARA_STUP)", response = TbAtrdDto.class)
@@ -63,18 +63,18 @@ public class TbLinkParaStupController {
 //    }
 
     @ApiOperation(value = "선택구간 파라미터 적용", response = TbLinkParaStupDto.class)
-    @PostMapping(value = "/apply/select/{paramId}/{ids}", produces = {"application/json; charset=utf8"})
+    @PostMapping(value = "/apply/select/{paraId}/{ids}", produces = {"application/json; charset=utf8"})
     public TbLinkParaStupDto applyParamSelect(
-            @PathVariable final Long paramId,
+            @PathVariable final Long paraId,
             @PathVariable final List<Long> ids) {
-        return this.service.applyParamSelect(paramId, ids);
+        return this.service.applyParamSelect(paraId, ids);
     }
 
     @ApiOperation(value = "전체구간 파라미터 적용", response = TbLinkParaStupDto.class)
-    @PostMapping(value = "/apply/all/{paramId}", produces = {"application/json; charset=utf8"})
+    @PostMapping(value = "/apply/all/{paraId}", produces = {"application/json; charset=utf8"})
     public TbLinkParaStupDto applyParamAll(
-            @PathVariable final Long paramId) {
-        return this.service.applyParamAll(paramId);
+            @PathVariable final Long paraId) {
+        return this.service.applyParamAll(paraId);
     }
 
 }

+ 7 - 4
src/main/java/com/its/op/dao/repository/its/link/TbLinkRepository.java

@@ -3,6 +3,7 @@ package com.its.op.dao.repository.its.link;
 import com.its.op.entity.its.link.TbLink;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
@@ -24,10 +25,12 @@ public interface TbLinkRepository extends JpaRepository<TbLink, Long> , JpaSpeci
     @Query("select count(p.linkId) from TbLink p where p.delYn = 'N'")
     Integer findAllCount();
 
-    @Query("update TbLink p set p.paraId = :paramId")
-    Integer updateParamAll(@Param("paramId") Long paramId);
+    @Modifying
+    @Query("update TbLink p set p.paraId = :paraId")
+    Integer updateParamAll(@Param("paraId") Long paraId);
 
-    @Query("update TbLink p set p.paraId = :paramId where p.linkId in :linkIds")
-    Integer updateParamSelect(@Param("paramId") Long paramId, @Param("ids") List<Long> linkIds);
+    @Modifying
+    @Query("update TbLink p set p.paraId = :paraId where p.linkId in :linkIds")
+    Integer updateParamIds(@Param("paraId") Long paramId, @Param("linkIds") List<Long> linkIds);
 
 }

+ 8 - 8
src/main/java/com/its/op/service/its/link/TbLinkParaStupService.java

@@ -176,26 +176,26 @@ public class TbLinkParaStupService {
 
     /**
      * 선택한 링크에 대하여 파라미터 값 변경
-     * @param paramId
+     * @param paraId
      * @param ids
      * @return
      */
     @Transactional
-    public TbLinkParaStupDto applyParamSelect(Long paramId, List<Long> ids) {
-        TbLinkParaStupDto result = findById(paramId);
-        this.linkRepo.updateParamSelect(paramId, ids);
+    public TbLinkParaStupDto applyParamSelect(Long paraId, List<Long> ids) {
+        TbLinkParaStupDto result = findById(paraId);
+        this.linkRepo.updateParamIds(paraId, ids);
         return result;
     }
 
     /**
      * 모든 링크에 대하여 파라미터 값 변경
-     * @param paramId
+     * @param paraId
      * @return
      */
     @Transactional
-    public TbLinkParaStupDto applyParamAll(Long paramId) {
-        TbLinkParaStupDto result = findById(paramId);
-        this.linkRepo.updateParamAll(paramId);
+    public TbLinkParaStupDto applyParamAll(Long paraId) {
+        TbLinkParaStupDto result = findById(paraId);
+        this.linkRepo.updateParamAll(paraId);
         return result;
     }
 }