liuxiaolong
2019-05-06 f99bc8c6a1d10610373738edd7d0aa0181c81d99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.cloud.user.dao;
 
import com.cloud.model.sys.SysOrganization;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
 
import java.util.List;
import java.util.Map;
 
@Mapper
public interface SysOrganizationDao {
 
    int saveSelective(SysOrganization org);
 
    int save(SysOrganization org);
 
    int update(SysOrganization org);
 
    int updateById(SysOrganization org);
 
    SysOrganization findById(@Param("id") Long id, @Param("orgId") Long orgId);
 
    @Delete("delete from sys_organization where id = #{id} and orgId = #{orgId}")
    int delete(@Param("id") Long id, @Param("orgId") Long orgId);
 
    List<SysOrganization> findData(Map<String, Object> params);
 
    int count(Map<String, Object> params);
 
    //@Select("select * from sys_organization t where parentIds LIKE '%,${orgId},%'order by t.sort")
    List<SysOrganization> findAll(Map<String,Object> params);
 
    //@Select("select parentIds from sys_organization where id = #{currentId} and orgId = #{orgId}")
    String findCurentParentIds(@Param("currentId") Long currentId, @Param("orgId")Long orgId);
 
    //@Select("select * from sys_organization where id in (${parentIds}) and orgId = #{orgId} and type = #{type}")
    SysOrganization findUpByType(@Param("type")Integer type,@Param("orgId") Long orgId,@Param("parentIds")String parentIds);
 
    //查询上级第一个机构
    SysOrganization findUpById(@Param("currentId")Long currentId,@Param("parentIds")String parentId, @Param("partack") String partack);
 
    //@Select("select * from sys_organization where parentIds like '%${parentIds}%' and orgId = #{orgId} and type = #{type}")
    List<SysOrganization> findDownByType(@Param("type")Integer type,@Param("orgId") Long orgId,@Param("parentIds")String parentIds);
 
    List<String> finCurentOrgs(@Param("parentIds")String parendIds,@Param("orgId")Long orgId);
 
    /**
     * 查找所有父节点的名称,并以指定分隔符分隔
     * @param parendIds
     * @param orgId
     * @param separator 分隔符
     * @return
     */
    String getParentNames(@Param("parentIds")String parendIds,@Param("orgId")Long orgId,@Param("separator") String separator);
 
    //查找所有的总部
    List<SysOrganization> findHeadquarters(@Param("currentId") Long currentId, @Param("type")String type);
 
    //查找下级的指定类型的所有子机构
    List<SysOrganization> findSubOrg(@Param("headId") Long headId, @Param("isSelf") boolean isSelf, @Param("type")String type);
 
    //机构逻辑删除
    Integer deleteOrg(Map<String, Object> params);
 
    List<Map<String,Object>> findCheckSchool(Map<String,Object> params);
 
    List<Integer> findDownByOffIds(Map<String, Object> param);
 
    boolean isImportStudentClass(Map<String, Object> param);
 
    Map<String,Object> isisImportTeacherOffice(Map<String, Object> param);
 
    String findCompactName(Integer officeId);
 
    List<Integer> findOrgIds(Map<String,Object> params);
 
    String findOrgName(Integer id);
 
    Integer isRepeatOrgName(@Param("parentId") Long parentId,@Param("name")String name);
}