/**
 * Company Name : 中贸促信息技术有限责任公司
 * Project Name:project
 * File Name:OperateService.java
 * Package Name:org.ccpit.base.privilegeManage
 * Date:2015年9月23日下午3:34:18
 * Copyright (c) 2015, dingwei@ccpit.org All Rights Reserved.
 *
*/

package org.ccpit.base.privilegeManage;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * ClassName:OperateService <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason:	 TODO ADD REASON. <br/>
 * Date:     2015年9月23日 下午3:34:18 <br/>
 * @author   dingwei
 * @version  
 * @since    JDK 1.6
 * @see 	 
 */
@Repository
@Transactional
public class OperateService {

	@Autowired
	private OperateDao operateDao;
	
	public boolean addOperate(Operate operate){
		return operateDao.save(operate);
	}
	
	public boolean updateOperate(Operate operate){
		return operateDao.update(operate);
	}
	
	public boolean delOperateByID(long id){
		return operateDao.deleteById(id);
	}
	
	public Operate getOperateByID(long id){
		return operateDao.queryById(id);
	}
	
	public List<Operate> getOperateList(){
		return operateDao.queryAll();
	}
	
	public List<Operate> getChildOperateById(long id){
		return operateDao.getChildOrgById(id);
	}
}

