package com.njcn.mapper.user;


import com.njcn.pojo.user.AppUser;
import com.njcn.pojo.user.UserDetail;
import com.njcn.sso.pojo.user.User;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

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

public interface UserMapper extends Mapper<User> {

    //根据id查询所有
    User selectId(String userIndex);

    //审核新增用户
    int updateExaminer(@Param(value = "userIndex") String userIndex);

    //修改密码
    int updatePassword(User user);

    //根据guid查询更新人
    String selectIdName(@Param(value = "userIndex") String userIndex);

    List<User> selectAllUser();

    List<User> selectNormalAndCasualUser(Map<String, Object> optionMap);

    List<User> selectNormalAndCasualUsers(Map<String, Object> optionMap);

    List<User> getPhone(@Param(value = "phone") String phone, @Param(value = "state") int state);

    int deleteUserByIndex(@Param(value = "userIndex") String index, @Param(value = "state") int state);

    int updateState(@Param("userindex") String userindex, @Param("state") int state);

    //将用户状态从异常恢复正常
    void dealUserActive(String userIndex);

    List<String> getAllName();

    List<User> getAllUser();

    int updateLockState(@Param("state") int state, @Param("userIndex") String userIndex);

    void updateByPrimaryKeyBySql(User user);

    User selectByIndex(String index);

    List<String> getAdminName(@Param("userindex") String userindex);

    List<User> selectAllManagers(Map<String, Object> optionMap);

    User getUser(@Param("userIndex") String userIndex);

    User getAppBaseUser(@Param("userIndex") String user_id);

    List<AppUser> getAllDevcodes(List<String> deptsIndexs);
    
    /**
     * 查询需要通知的用户
     * @return
     */
    List<User> getMailUsers();

    UserDetail getUserAll(String userIndex);

    /**
     * 根据监测点查询出所有的手机主用户，且非删除的用户
     */
    List<String> getPushPhoneNum(Long lineIndex);
}
