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 findData(Map params); int count(Map params); //@Select("select * from sys_organization t where parentIds LIKE '%,${orgId},%'order by t.sort") List findAll(Map 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 findDownByType(@Param("type")Integer type,@Param("orgId") Long orgId,@Param("parentIds")String parentIds); List 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 findHeadquarters(@Param("currentId") Long currentId, @Param("type")String type); //查找下级的指定类型的所有子机构 List findSubOrg(@Param("headId") Long headId, @Param("isSelf") boolean isSelf, @Param("type")String type); //机构逻辑删除 Integer deleteOrg(Map params); List> findCheckSchool(Map params); List findDownByOffIds(Map param); boolean isImportStudentClass(Map param); Map isisImportTeacherOffice(Map param); String findCompactName(Integer officeId); List findOrgIds(Map params); String findOrgName(Integer id); Integer isRepeatOrgName(@Param("parentId") Long parentId,@Param("name")String name); }