Browse Source

CW 공통코드 사용을 위한 공통소스 추가

SH 2 weeks ago
parent
commit
e6f15143d1

+ 20 - 0
src/main/java/sgc/portal/cw/cwcom/dto/CWCOMSearch.java

@@ -0,0 +1,20 @@
+package sgc.portal.cw.cwcom.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+import sgc.portal.base.BaseSearchDto;
+
+@Getter
+@Setter
+public class CWCOMSearch extends BaseSearchDto {
+    /*
+     * JSON Serialize, Deserialize 는 sgc.portal.base.format 패키지에 있는
+     * 객체들을 사용하여 동작한다.
+     * 기본 포멧은 Date -> yyyyMMdd, DateTime -> yyyyMMddHHmmss 이므로
+     * Front, Back 모두 포멧에 맞춰 요청과 응답을 해야한다.
+     * sgc.portal.base.util.DateTime 클래스는 Date 를 상속받은 클래스로
+     * 단순히 시간까지 표현해야하는지 여부를 판단하기 위한 클래스로 시간까지 표현해야하는 경우
+     * sgc.portal.base.util.DateTime 클래스를 사용하도록 한다.
+     */
+	private String cmpnCd;		/*회사 코드*/
+}

+ 14 - 0
src/main/java/sgc/portal/cw/cwcom/persistence/CWCOMMapper.java

@@ -0,0 +1,14 @@
+package sgc.portal.cw.cwcom.persistence;
+
+import org.apache.ibatis.annotations.Mapper;
+import sgc.portal.base.util.EasyHashMap;
+import sgc.portal.cw.cwcom.dto.CWCOMSearch;
+
+import java.util.List;
+
+@Mapper
+public interface CWCOMMapper {
+	
+	//회의실
+	List<EasyHashMap<String, Object>> getComboRomCd(CWCOMSearch search);
+}

+ 22 - 0
src/main/java/sgc/portal/cw/cwcom/service/CWCOMService.java

@@ -0,0 +1,22 @@
+package sgc.portal.cw.cwcom.service;
+
+import org.springframework.stereotype.Service;
+import sgc.portal.base.util.EasyHashMap;
+import sgc.portal.cw.cwcom.dto.CWCOMSearch;
+import sgc.portal.cw.cwcom.persistence.CWCOMMapper;
+
+import java.util.List;
+
+@Service
+public class CWCOMService {
+    private final CWCOMMapper mapper;
+
+    public CWCOMService(CWCOMMapper mapper) {
+        this.mapper = mapper;
+    }
+    
+    //본부
+    public List<EasyHashMap<String, Object>> getComboRomCd(CWCOMSearch search) {
+        return mapper.getComboRomCd(search);
+    }
+}

+ 24 - 0
src/main/java/sgc/portal/cw/cwcom/web/CWCOMController.java

@@ -0,0 +1,24 @@
+package sgc.portal.cw.cwcom.web;
+
+import org.springframework.web.bind.annotation.*;
+import sgc.portal.base.util.EasyHashMap;
+import sgc.portal.cw.cwcom.dto.CWCOMSearch;
+import sgc.portal.cw.cwcom.service.CWCOMService;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/cw/cwcom")
+public class CWCOMController {
+    private final CWCOMService service;
+
+    public CWCOMController(CWCOMService service) {
+        this.service = service;
+    }
+    
+    //회의실
+    @PostMapping("/CWCOM/getComboRomCd")
+    public List<EasyHashMap<String, Object>> getComboRomCd(@RequestBody CWCOMSearch search) {
+        return service.getComboRomCd(search);
+    }
+}

+ 12 - 0
src/main/resources/sqlmap/mappers/cw/cwcom/CWCOMMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
+
+<mapper namespace="sgc.portal.cw.cwcom.persistence.CWCOMMapper">
+	<select id="getComboRomCd" resultType="easyHashMap">
+		SELECT A.MEETINGROOM_ID AS COMBO_CD
+		 	, B.MR_LOCATION || ' - ' || A.BUNHO AS COMBO_NM
+		  FROM ZEHR_ROM_INFO A, ZEHR_ROM_LOCTN B
+		 WHERE A.LOCATION_ID = B.LOCATION_ID
+		 ORDER BY COMBO_NM
+	</select>
+</mapper>