package cn.iocoder.yudao.module.system.service.biz;

import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.EvaluationProcessConfigDO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.EvaluationTemplatesConfigDO;
import cn.iocoder.yudao.module.system.dal.mysql.biz.EvaluationProcessConfigMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import org.springframework.validation.annotation.Validated;

import java.util.List;


/**
 * 能力评估配置 Service 实现类
 *
 * @author 系统管理员
 */
@Service
@Validated
public class EvaluationProcessConfigServiceImpl implements EvaluationProcessConfigService {

    @Resource
    private EvaluationProcessConfigMapper evaluationProcessConfigMapper;


    @Override
    public Long createEvaluationProcessConfig(EvaluationProcessConfigDO createReqVO) {
        evaluationProcessConfigMapper.insert(createReqVO);
        return createReqVO.getId();
    }

    @Override
    public void updateEvaluationProcessConfig(EvaluationProcessConfigDO updateReqVO) {
        evaluationProcessConfigMapper.updateById(updateReqVO);
    }

    @Override
    public void deleteEvaluationProcessConfig(Long id) {
        evaluationProcessConfigMapper.deleteById(id);
    }

    @Override
    public EvaluationProcessConfigDO getEvaluationProcessConfig(Long id) {
        return evaluationProcessConfigMapper.selectById(id);
    }

    @Override
    public List<EvaluationProcessConfigDO> getEvaluationProcessConfigList(Long evaluationProcessId) {
        return evaluationProcessConfigMapper.selectList(new LambdaQueryWrapperX<EvaluationProcessConfigDO>()
                .eq(EvaluationProcessConfigDO::getEvaluationProcessId, evaluationProcessId)
                .eq(EvaluationProcessConfigDO::getDeleted, Boolean.FALSE));
    }
}