package com.zhongshu.card.server.core.service.statistics;

import com.zhongshu.card.client.model.org.OrganizationUserSearch;
import com.zhongshu.card.server.core.dao.org.OrganizationUserDao;
import com.zhongshu.card.server.core.service.base.SuperService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 项目、机构人员统计
 */
@Slf4j
@Service
public class OrgUserStatisticsService extends SuperService {

    @Autowired
    private OrganizationUserDao orgUserDao;

    /**
     * 统计项目用户数量
     *
     * @param projectOid
     * @return
     */
    public long countProjectAllUsers(String projectOid) {
        OrganizationUserSearch param = new OrganizationUserSearch();
        param.setProjectOid(projectOid);
        param.setIsSearchProject(Boolean.TRUE);
        param.setIsOrg(Boolean.TRUE);
        return orgUserDao.countUser(param);
    }

}
