package com.gic.haoban.manage.service.service.role.impl;

import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.service.dao.mapper.role.TabHaobanRoleMenuMapper;
import com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu;
import com.gic.haoban.manage.service.service.role.HaobanRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 好办小程序权限菜单(TabHaobanRoleMenu)表服务实现类
 *
 * @author mozhu
 * @since 2022-09-09 11:36:07
 */
@Service
public class HaobanRoleMenuServiceImpl implements HaobanRoleMenuService {

    @Autowired
    private TabHaobanRoleMenuMapper tabHaobanRoleMenuMapper;


    @Override
    public int insertBatch(List<TabHaobanRoleMenu> roleMenuList) {
        return this.tabHaobanRoleMenuMapper.insertBatch(roleMenuList);
    }

    @Override
    public boolean deleteByRoleId(Long roleId) {
        return tabHaobanRoleMenuMapper.deleteByRoleId(roleId) > 0;
    }

    @Override
    public List<String> getByWxEnterpriseIdAndRoleId(String wxEnterpriseId, Long roleId) {
        return tabHaobanRoleMenuMapper.getByWxEnterpriseIdAndRoleId(wxEnterpriseId, roleId);
    }

    @Override
    public boolean deleteByWxEnterpriseId(String wxEnterpriseId) {
        return tabHaobanRoleMenuMapper.deleteByWxEnterpriseId(wxEnterpriseId);
    }

    @Override
    public List<String> getMenuInMenuCodes(String wxEnterpriseId, Long roleId, List<String> menuCodes) {
        return tabHaobanRoleMenuMapper.getMenuInMenuCodes(wxEnterpriseId, roleId, menuCodes);
    }


    @Override
    public boolean deleteByMenuCode(String menuCode, String wxEnterpriseId) {
        return tabHaobanRoleMenuMapper.deleteByMenuCode(menuCode, wxEnterpriseId) > 0;
    }
}
