1.0
xin
2025-04-15 e718afd02965c6a4018506acb1ae99baca0c5645
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
package com.oying.modules.system.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.oying.modules.system.domain.Dept;
import com.oying.modules.system.domain.dto.DeptQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Set;
 
/**
* @author Z
* @date 2023-06-20
*/
@Mapper
public interface DeptMapper extends BaseMapper<Dept> {
 
    List<Dept> findAll(@Param("criteria") DeptQueryCriteria criteria);
 
    List<Dept> findByPid(@Param("pid") Long pid);
 
    List<Dept> findByPidIsNull();
 
    Set<Dept> findByRoleId(@Param("roleId") Long roleId);
 
    @Select("select count(*) from sys_dept where pid = #{pid}")
    int countByPid(@Param("pid") Long pid);
 
    @Select("update sys_dept set sub_count = #{count} where dept_id = #{id}")
    void updateSubCntById(@Param("count") Integer count, @Param("id") Long id);
}