/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.criterion.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.criterion.entity.EvaluationCriterion;
import com.jeeplus.modules.criterion.mapper.EvaluationCriterionMapper;

/**
 * criterionService
 * @author 邱悦
 * @version 2021-12-28
 */
@Service
@Transactional(readOnly = true)
public class EvaluationCriterionService extends TreeService<EvaluationCriterionMapper, EvaluationCriterion> {

	public EvaluationCriterion get(String id) {
		return super.get(id);
	}

	public List<EvaluationCriterion> findList(EvaluationCriterion evaluationCriterion) {
		if (StringUtils.isNotBlank(evaluationCriterion.getParentIds())){
			evaluationCriterion.setParentIds(","+evaluationCriterion.getParentIds()+",");
		}
		return super.findList(evaluationCriterion);
	}

	@Transactional(readOnly = false)
	public void save(EvaluationCriterion evaluationCriterion) {
		super.save(evaluationCriterion);
	}

	@Transactional(readOnly = false)
	public void delete(EvaluationCriterion evaluationCriterion) {
		super.delete(evaluationCriterion);
	}

}