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

import java.util.List;

import com.jeeplus.common.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.common.persistence.Page;
import com.jeeplus.modules.casecategory.entity.CaseCategory;
import com.jeeplus.modules.casecategory.dao.CaseCategoryDao;

/**
 * 案例分类Service
 * @author liuw
 * @version 2018-01-24
 */
@Service
@Transactional(readOnly = true)
public class CaseCategoryService extends TreeService<CaseCategoryDao, CaseCategory> {

	public CaseCategory get(String id) {
		return super.get(id);
	}
	
	public List<CaseCategory> findList(CaseCategory caseCategory) {
		if (StringUtils.isNotBlank(caseCategory.getParentIds())){
			caseCategory.setParentIds(","+caseCategory.getParentIds()+",");
		}
		return super.findList(caseCategory);
	}
	
	public Page<CaseCategory> findPage(Page<CaseCategory> page, CaseCategory caseCategory) {
		return super.findPage(page, caseCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(CaseCategory caseCategory) {
		super.save(caseCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(CaseCategory caseCategory) {
		super.delete(caseCategory);
	}
	
	
	
	
}