SysDepartMapper.java 4.9 KB
package com.skua.modules.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.vo.DepartTree;
import com.skua.modules.system.vo.SysDeptUserVO;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

/**
 * 部门 Mapper 接口
 */
public interface SysDepartMapper extends BaseMapper<SysDepart> {

    /**
     * 根据用户ID查询部门集合
     */
    public List<SysDepart> queryUserDeparts(@Param("userId") String userId);

    @Select("select * from sys_depart where org_code = #{orgCode}")
    public List<SysDepart> getDeptIdByCode(@Param("orgCode") String orgCode);

    /**
     * <pre>
     * 	根据厂id获取机构人员树
     * </pre>
     *
     * @param departId
     * @return
     * @author Li Yuanyuan, 2020年8月31日 上午9:52:46
     */
    public List<SysDeptUserVO> queryDeptAndEmpTreeList(@Param("departId") String departId);

    /**
     * 获取厂区树
     *
     * @return
     */
    public List<SysDeptUserVO> queryFactoryTreeList();

    List<SysDepart> getFactoryList();

    List<SysDepart> getCmpyList();

    List<SysDepart> getDepartTree(@Param("orgCode") String orgCode);

    List<SysDepart> getDepartTreeByJt(@Param("orgCode") String orgCode);

    List<SysDepart> getDepartTreeByJt2(@Param("orgCode") String orgCode);

    List<SysDepart> getCenterByJt(@Param("orgCode") String orgCode);

    List<SysDepart> getJtList();

    List<SysDepart> getDepartList(@Param("orgCode") String orgCode);

    List<SysDepart> getAllDepartList();

    List<SysDepart> getSuperDepartTree();

    List<SysDeptUserVO> queryDeptUserTreeList(@Param("id") String id);

    /**
     * <pre>
     * 	获取该节点及父级部门树
     * </pre>
     *
     * @param id
     * @return
     * @author Li Yuanyuan, 2020年9月2日 下午5:44:08
     */
    public List<SysDepart> getParentDepartTree(@Param("id") String id);

    /**
     * 获取片区
     *
     * @return
     */
    public List<SysDepart> getAreaList(@Param("areaIds") String areaIds);

    /**
     * 根据片区id获取水厂数据
     *
     * @param areaId
     * @return
     */
    public List<SysDepart> queryDepartListByAreaId(String areaId, String[] departIds);

    public Map<String, Object> getAreaIdByDepartId(@Param("departId") String departId);

    List<SysDepart> queryDeptInfo(String userId);

    /**
     * @return java.util.List<com.skua.modules.system.entity.SysDepart>
     * @Description 获取所有分中心列表
     * @Date 2020-10-28 10:44
     * @Param []
     **/
    List<SysDepart> getCenterAllList(@Param("centers") List<String> centers);

    /**
     * 实时数据片区列表获取
     *
     * @param areaIds
     * @return
     */
    public List<SysDepart> getAreaListForMonitor(@Param("areaIds") String areaIds);

    /**
     * 实时数据厂区列表获取
     *
     * @param userId
     * @return
     */
    public List<SysDepart> queryUserDepartsForMonitor(@Param("userId") String userId);

    /**
     * 实时数据集团用户厂区列表获取
     *
     * @param orgCode
     * @return
     */
    public List<SysDepart> getDepartTreeByJtForMonitor(@Param("orgCode") String orgCode);

    String queryDepartNameById(@Param("departId") String departId);

    @Select("select a.id as departId,a.depart_name as departName,b.device_id as deviceId,b.device_status as deviceStatus from sys_depart a " +
            "left join sys_factory_device b on a.id= b.depart_id ${ew.customSqlSegment} ")
    List<Map<String, Object>> queryFactoryDevice(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);

    public Map<String,Object> queryUserDepartsMap(@Param("userId") String userId);

    String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId);

    String getChildDepartId(@Param("departIds") String departIds);

    List<SysDeptUserVO> queryDeptAndUserTreeList(@Param("departId") String departId);

    List<SysDeptUserVO> queryDeptAndSystemTreeList(@Param("departId") String departId);

    @Anonymous
    List<DepartTree> getJimuDepartTree(@Param("pid") String pid);

    @Anonymous
    List<DepartTree> getJimuDepartTreeFY(@Param("pid") String pid, @Param("departIds") String departIds);

    @Anonymous
    List<DepartTree> getJimuDepartTreeL(@Param("pid") String pid, @Param("departIds") String departIds);

    @Anonymous
    List<DepartTree> getJimuDepartTreeELSE(@Param("departIds") String departIds);

    @Anonymous
    SysDepart getById(@Param("pid") String pid);

    @Anonymous
    List<SysDepart> getChildDepartList(@Param("departIds") String departIds);

    @Anonymous
    List<SysDepart> queryDepartsByIds(@Param("ids") String ids);
}