package com.zcloud.basic.info.persistence.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jjb.saas.framework.datascope.annotation.DataScope;
import com.jjb.saas.framework.datascope.annotation.DataScopes;
import com.zcloud.basic.info.persistence.dataobject.DepartmentLeaderStatictiscDO;
import com.zcloud.basic.info.persistence.dataobject.UserCorpInfoDO;
import com.zcloud.basic.info.persistence.dataobject.UserDO;
import com.zcloud.basic.info.persistence.dataobject.UserImgDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * web-infrastructure
 *
 * @Author zhangyue
 * @Date 2025-11-04 14:07:36
 */
@Mapper
@DataScopes({
        @DataScope(method = "selectUserPage", menuPerms = ""),
        @DataScope(method = "listXgf", menuPerms = ""),
})
public interface UserMapper extends BaseMapper<UserDO> {
    List<UserDO> selectListAll(@Param("params") Map<String, Object> params);

    IPage<UserDO> selectUserPage(IPage<UserDO> page, @Param("ew") QueryWrapper<UserDO> queryWrapper, String menuPerms);

    UserDO getInfoById(@Param("id") Long id);

    UserDO getInfoByUserName(@Param("params") Map<String, Object> params);

    List<DepartmentLeaderStatictiscDO> getDepartmentLeaderByDepartmentId(List<Long> departmentIds);

    Integer countUser(@Param("params") Map<String, Object> params);

    IPage<UserDO> listXgf(IPage<UserDO> iPage, Map<String, Object> params, String menuPerms);

    List<UserCorpInfoDO> getListByUserIds(List<Long> userIds);

    void deletedUserByPhone(String phone);

    UserDO getUserIdByPhone(String phone);

    IPage<UserDO> pageByNopermission(IPage<UserDO> iPage, @Param("ew") QueryWrapper<UserDO> queryWrapper);

    void updateFaceByPhone(String userAvatarUrl, String phone);


    List<UserImgDO> listBase64ByUrl(@Param("params") Map<String, Object> params);
}

