7 小时以前 620bb4712a31791231c4381581f0f60088f079fe
src/main/java/com/ruoyi/project/system/mapper/SysUserDeptMapper.java
@@ -3,13 +3,41 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.project.system.domain.SysUserDept;
import com.ruoyi.project.system.domain.vo.SysUserDeptVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface SysUserDeptMapper extends BaseMapper<SysUserDept> {
    List<SysUserDeptVo> selectUserDeptList(@Param("userDeptVo") SysUserDeptVo userDeptVo);
    List<SysUserDeptVo> userLoginFacotryList(@Param("userDeptVo") SysUserDeptVo userDeptVo);
    List<Map<String, Object>> setSchemeApplicableStaffUserInfo(@Param("ids") List<Long> ids);
    @Select("<script>" +
            "select count(distinct sud.user_id) " +
            "from sys_user_dept sud " +
            "inner join sys_user su on su.user_id = sud.user_id " +
            "where su.del_flag = '0' " +
            "and sud.dept_id in " +
            "<foreach collection='deptIds' item='deptId' open='(' separator=',' close=')'>" +
            "#{deptId}" +
            "</foreach>" +
            "</script>")
    Long countDistinctUserIdsByDeptIds(@Param("deptIds") List<Long> deptIds);
    @Select("<script>" +
            "select distinct sud.user_id " +
            "from sys_user_dept sud " +
            "inner join sys_user su on su.user_id = sud.user_id " +
            "where su.del_flag = '0' " +
            "and sud.dept_id in " +
            "<foreach collection='deptIds' item='deptId' open='(' separator=',' close=')'>" +
            "#{deptId}" +
            "</foreach>" +
            "</script>")
    List<Long> selectDistinctUserIdsByDeptIds(@Param("deptIds") List<Long> deptIds);
}