package com.zd.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zd.system.mapper.SysPermitMenuDeptMapper;
import com.zd.system.domain.SysPermitMenuDept;
import com.zd.system.service.ISysPermitMenuDeptService;

/**
 * 权限菜单和部门关联Service业务层处理
 *
 * @author liubo
 * @date 2022-03-21
 */
@Service
public class SysPermitMenuDeptServiceImpl implements ISysPermitMenuDeptService {
    @Autowired
    private SysPermitMenuDeptMapper sysPermitMenuDeptMapper;

    /**
     * 查询权限菜单和部门关联
     *
     * @param permitMenuId 权限菜单和部门关联主键
     * @return 权限菜单和部门关联
     */
    @Override
    public SysPermitMenuDept selectSysPermitMenuDeptByPermitMenuId(Long permitMenuId) {
        return sysPermitMenuDeptMapper.selectSysPermitMenuDeptByPermitMenuId(permitMenuId);
    }

    /**
     * 查询权限菜单和部门关联列表
     *
     * @param sysPermitMenuDept 权限菜单和部门关联
     * @return 权限菜单和部门关联
     */
    @Override
    public List<SysPermitMenuDept> selectSysPermitMenuDeptList(SysPermitMenuDept sysPermitMenuDept) {
        return sysPermitMenuDeptMapper.selectSysPermitMenuDeptList(sysPermitMenuDept);
    }

    /**
     * 新增权限菜单和部门关联
     *
     * @param sysPermitMenuDept 权限菜单和部门关联
     * @return 结果
     */
    @Override
    public int insertSysPermitMenuDept(SysPermitMenuDept sysPermitMenuDept) {
        return sysPermitMenuDeptMapper.insertSysPermitMenuDept(sysPermitMenuDept);
    }

    /**
     * 修改权限菜单和部门关联
     *
     * @param sysPermitMenuDept 权限菜单和部门关联
     * @return 结果
     */
    @Override
    public int updateSysPermitMenuDept(SysPermitMenuDept sysPermitMenuDept) {
        return sysPermitMenuDeptMapper.updateSysPermitMenuDept(sysPermitMenuDept);
    }

    /**
     * 批量删除权限菜单和部门关联
     *
     * @param permitMenuIds 需要删除的权限菜单和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteSysPermitMenuDeptByPermitMenuIds(Long[] permitMenuIds) {
        return sysPermitMenuDeptMapper.deleteSysPermitMenuDeptByPermitMenuIds(permitMenuIds);
    }

    /**
     * 删除权限菜单和部门关联信息
     *
     * @param permitMenuId 权限菜单和部门关联主键
     * @return 结果
     */
    @Override
    public int deleteSysPermitMenuDeptByPermitMenuId(Long permitMenuId) {
        return sysPermitMenuDeptMapper.deleteSysPermitMenuDeptByPermitMenuId(permitMenuId);
    }
}
