package com.iamberry.wechat.service.admin.dao.impl;

import java.util.List;

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

import com.iamberry.wechat.core.entity.admin.AdminChildHavePermission;
import com.iamberry.wechat.service.admin.dao.AdminPermissionsDAO;
import com.iamberry.wechat.service.mapper.AdminChildPermissionsMapper;

@Repository
public class AdminPermissionsDAOImpl implements AdminPermissionsDAO{
	@Autowired
	private AdminChildPermissionsMapper adminchildPermissionsMapper;
	public void setAdminChildPermissionsMapper(AdminChildPermissionsMapper adminchildPermissionsMapper) {
		this.adminchildPermissionsMapper = adminchildPermissionsMapper;
	}
	/**
	 * 根据二级管理ID，保存二级管理员权限
	 * @param id
	 * @return
	 */
	@Override
	public List<AdminChildHavePermission> selectPermissionById(Integer id) {
		// TODO Auto-generated method stub
		return adminchildPermissionsMapper.selectPermissionById(id);
	}
	/**
	 * 根据二级管理ID，获取此二级管理员所有的权限
	 * @param id
	 * @return
	 */
	@Override
	public Integer insertPermissionById(AdminChildHavePermission adminChildHavePermission) {
		// TODO Auto-generated method stub
		return adminchildPermissionsMapper.insertPermissionById(adminChildHavePermission);
	}
	/**
	 * 根据二级管理ID，删除所有二级权限
	 * @param id
	 * @return
	 */
	@Override
	public Integer deletePermissionById(Integer adminChildId) {
		// TODO Auto-generated method stub
		return adminchildPermissionsMapper.deletePermissionById(adminChildId);
	}

	
	
}
