package com.chinaweal.aiccs.org.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinaweal.aiccs.org.entity.OrgUnits;
import com.chinaweal.aiccs.org.entity.TUsers;
import com.chinaweal.aicorg.model.AICUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author <a href="https://blog.lroyia.top">lroyia</a>
 * @since 2021-02-07
 */
public interface TUsersMapper extends BaseMapper<TUsers> {

    void updateTusers(TUsers tUsers);

    TUsers selectTusersByUsernameAndPass(@Param("username") String userName, @Param("passwordJm") String passwordJm);

    TUsers selectTusersByUsername(@Param("username") String userName);

    TUsers selectTusersById(@Param("userId") String intoSponsorId);

    OrgUnits byOrgUnitName(@Param("orgUnitName") String orgUnitName);

    OrgUnits byOrgUnitId(String orgUnitId);

    List<OrgUnits> queryAllOrg();

    List<OrgUnits> listOrgParentId(@Param("parentId") String parentId, @Param("orgLevel") String orgLevel);

    List<AICUser> findUsersByDeptAndPermission(@Param("orgUnitId") String orgUnitId, @Param("permission") String permission);

    List<AICUser> findUsersByUnitAndUnDepAndPermission(@Param("orgUnitId") String orgUnitId, @Param("orgDeptID") String orgDeptID, @Param("permission") String permission);

    String queryOrgByUserid(@Param("userid")String userid);

    String queryOrgNumByUserid(@Param("userid")String userid);
    /**
     * 根据用户Id查询用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     * @author lroyia
     * @since 2023年4月26日 10:38:43
     */
    AICUser selectUserById(@Param("userId") String userId);

}
