package com.blueland.dao;

/**
 * @author 代码自动生成工具
 * @version 1.0
 * @since
 */

import java.util.*;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blueland.bo.*;


import com.blueland.model.TUcOrg;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


@Mapper
public interface TucOrgDao extends BaseMapper<TUcOrg> {

    List<Org> getListNoPage(@Param("bo") Org entity);

    Page<Org> getOrgPage(@Param("page") Page<Org> page, @Param("bo") Org org);

    List<Org> getOrgChildLst(@Param("bo") Org org);

    Page<Org> getOrgChildPage(@Param("page") Page<Org> page, @Param("bo") Org org);

    List<Org> findOrgIdList(@Param("bo") Org org);

    List<TreeEntity> searchOrg(@Param("bo") Org org);

    List<Org> getChildLstByOrgId(@Param(value = "orgId") String orgId);

    /**
     * 根据组织类型查询所有组织
     * @param startDeptcode
     * @param
     * @return
     * @author hpp
     * @Time 2020年12月7日 上午10:34:29
     */
    List<Map<String, String>> getOrgByWorktype(@Param(value = "startDeptcode") String startDeptcode, @Param(value = "orgworktype") String orgworktype);

    /**
     * 只查询部门code和名称
     * @return
     */
    @InterceptorIgnore(tenantLine = "true")
    List<Org> list(@Param("appId") String appId);

    Org getOne(@Param("bo") Org org);

    @InterceptorIgnore(tenantLine = "true")
    Org getByAppId(@Param("bo") Org org);

    @InterceptorIgnore(tenantLine = "true")
    List<Org> findList(@Param("bo") Org org);

    Page<Org> findPage(@Param("page") Page<Org> page, @Param("bo") Org org);

    @InterceptorIgnore(tenantLine = "true")
    Integer countOrgById(@Param("id") String id, @Param("appId") String appId);

    @InterceptorIgnore(tenantLine = "true")
    void deleteOrgByAppId(@Param("appId") String appId);

    String getTopOrgId();

    String getSellOrgId(@Param("deptCode") String deptCode);

    @InterceptorIgnore(tenantLine = "true")
    String getAppIdByParentId(@Param("parentId") String parentId);

    @InterceptorIgnore(tenantLine = "true")
    String getOrgIdByAppId(@Param("appId") String appId, @Param("deptId") String deptId);

    Org getByOgId(@Param("orgId") String orgId);

    Org getByOgIdAndType(@Param("orgId") String orgId, @Param("type") String type);
}
