package com.usky.system.controller.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.system.RemoteDeptService;
import com.usky.system.domain.SysDept;
import com.usky.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author han
 * @date 2023/12/08 11:21
 */
@RestController
public class SysDeptControllerApi implements RemoteDeptService {
    @Autowired
    private ISysDeptService iSysDeptService;
    @Override
    public List<Map<String, Object>> getDeptList(Integer tenantId) {
       QueryWrapper<SysDept> queryWrapper = Wrappers.query();;
        queryWrapper.select("dept_id","dept_name")
                .eq("tenant_id",tenantId)
                .eq("del_flag",0);
        return iSysDeptService.listMaps(queryWrapper);
    }
}
