package com.interplug.qcast.biz.commCode; import java.util.List; import org.springframework.stereotype.Service; import com.interplug.qcast.biz.commCode.dto.CommCodeDetailRequest; import com.interplug.qcast.biz.commCode.dto.CommCodeHeaderRequest; import lombok.RequiredArgsConstructor; @Service @RequiredArgsConstructor public class CommCodeService { private final CommCodeMapper commCodeMapper; public int setCommHUpdate(List headReqList) { int resultCnt = 0; if (!headReqList.isEmpty()) { for (CommCodeHeaderRequest headReq : headReqList) { if ("Y".equals(headReq.getQcCommYn())) { headReq.setDelFlg(0); } else { headReq.setDelFlg(1); } resultCnt += commCodeMapper.setCommHUpdate(headReq); } } return resultCnt; } public int setCommLUpdate(List detailReqList) { int resultCnt = 0; if (!detailReqList.isEmpty()) { for (CommCodeDetailRequest detailReq : detailReqList) { if ("A".equals(detailReq.getClStatCd())) { detailReq.setClDelFlg(0); } else { detailReq.setClDelFlg(1); } resultCnt += commCodeMapper.setCommLUpdate(detailReq); } } return resultCnt; } }