72 lines
2.0 KiB
Java
72 lines
2.0 KiB
Java
/************************************************************
|
|
*
|
|
* @packageName : io.company.localhost.commoncodService
|
|
* @fileName : commoncodService.java
|
|
* @author : 공현지
|
|
* @date : 25.01.07
|
|
* @description :
|
|
*
|
|
* ===========================================================
|
|
* DATE AUTHOR NOTE
|
|
* -----------------------------------------------------------
|
|
* 24.12.06 공현지 최초 생성
|
|
*
|
|
*************************************************************/
|
|
package io.company.localhost.service;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import io.company.localhost.common.dto.MapDto;
|
|
import io.company.localhost.common.exception.NotFoundHandler;
|
|
import io.company.localhost.mapper.commoncodMapper;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
@Service
|
|
@RequiredArgsConstructor
|
|
public class commoncodService {
|
|
|
|
private final commoncodMapper commoncodmapper;
|
|
|
|
public List<MapDto> selectWordCategory() {
|
|
return commoncodmapper.selectWordCategory();
|
|
}
|
|
|
|
public Long insertCategory(MapDto map) {
|
|
Long count = commoncodmapper.selectcheckCategoryExists(map);
|
|
if(count > 0) {
|
|
return -1L;
|
|
}
|
|
return commoncodmapper.insertCategory(map);
|
|
}
|
|
|
|
public List<MapDto> selectColorList(String type) {
|
|
return commoncodmapper.selectColorList(type);
|
|
}
|
|
|
|
public List<MapDto> selectMbtiList() {
|
|
return commoncodmapper.selectMbtiList();
|
|
}
|
|
|
|
public List<MapDto> selectYearCategories() {
|
|
return commoncodmapper.selectYearCategories();
|
|
}
|
|
|
|
public List<MapDto> selectPwhintList() {
|
|
return commoncodmapper.selectPwhintList();
|
|
}
|
|
|
|
public List<MapDto> selectCategoryList() {
|
|
return commoncodmapper.selectCategories();
|
|
}
|
|
|
|
public List<MapDto> selectVacationType() {
|
|
List<MapDto> codeList = commoncodmapper.selectVacationType();
|
|
|
|
// 데이터가 비어있으면 빈 리스트 반환 (null 방지)
|
|
return (codeList != null) ? codeList : new ArrayList<>();
|
|
}
|
|
}
|