package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.Department;
import com.ruoyi.system.domain.dto.DepartMentDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * (Department)表数据库访问层
 *
 * @author makejava
 * @since 2024-05-27 17:35:52
 */

public interface DepartmentMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    Department queryById(Integer id);

    /**
     * 查询指定行数据
     *
     * @param department 查询条件
     * @param pageable         分页对象
     * @return 对象列表
     */
    List<Department> queryAllByLimit(Department department, @Param("pageable") Pageable pageable);

    /**
     * 统计总行数
     *
     * @param department 查询条件
     * @return 总行数
     */
    long count(Department department);


    List<DepartMentDto> getDepartments(String departmentName);

    /**
     * @Author: Yujianq
     * @Date: 2024/6/12 15:37
     * @Description: 通过部门ID查询资产总数
     * @param departmentId
     * @return: java.lang.Long
     */
    Long getDepartmentAssetNum(Integer departmentId);

}

