[BO] 공통코드 지역/세부지역, 업종대분류/업종중분류 - 계층형으로 일괄 변경
This commit is contained in:
@@ -23,6 +23,13 @@ class UICodeTopTierDao implements UICodeTopTierPortOut {
|
||||
return recursiveMapping(topTier);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public UICodeTopTier connect(String id) {
|
||||
UICode topTier = mapper.findTopTierId(id);
|
||||
return recursiveMapping(topTier);
|
||||
}
|
||||
|
||||
private UICodeTopTier recursiveMapping(UICode topTier) {
|
||||
List<UICode> children = mapper.findChildren(topTier.getId());
|
||||
|
||||
|
||||
@@ -7,5 +7,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface UICodeTopTierMapper {
|
||||
UICode findTopTier(); // parent_id IS NULL 인 UICode 조회
|
||||
UICode findTopTierId(String id); // UICode id 조회
|
||||
List<UICode> findChildren(String parentId); // 재귀 하위 코드
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ import app.module.core.usecase.uicode.toptier.ports.application.domain.UICodeTop
|
||||
public interface UICodeTopTierPortIn {
|
||||
|
||||
UICodeTopTier connect();
|
||||
UICodeTopTier connect(String id);
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ import app.module.core.usecase.uicode.toptier.ports.application.domain.UICodeTop
|
||||
public interface UICodeTopTierPortOut {
|
||||
|
||||
UICodeTopTier connect();
|
||||
UICodeTopTier connect(String id);
|
||||
}
|
||||
|
||||
@@ -16,4 +16,10 @@ public class UICodeTopTierService implements UICodeTopTierPortIn {
|
||||
public UICodeTopTier connect() {
|
||||
return portOut.connect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UICodeTopTier connect(String parentId) {
|
||||
return portOut.connect(parentId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,4 +19,12 @@
|
||||
AND is_deleted = false
|
||||
ORDER BY order_no ASC
|
||||
</select>
|
||||
|
||||
<select id="findTopTierId"
|
||||
resultType="app.module.core.config.adapters.persistence.entity.UICode">
|
||||
SELECT id, code_text, order_no, parent_id
|
||||
FROM uicode
|
||||
WHERE id = #{id}
|
||||
AND is_deleted = false
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user