Files
TaoTaoWang_backend/src/main/java/com/qf/backend/mapper/UsersMapper.java
qingfeng1121 d99580f0c9 feat(登录): 实现用户登录功能及相关模块
- 添加LoginController处理登录请求
- 实现UserLoginService登录逻辑,包括角色和权限验证
- 新增LoginRequest和LoginUser DTO
- 在UsersService中添加登录方法
- 添加RoleInitializer初始化系统角色
- 更新项目结构文档
- 临时禁用Spring Security配置
2025-12-02 14:55:30 +08:00

59 lines
1.7 KiB
Java

package com.qf.backend.mapper;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.backend.entity.Users;
/**
* 用户基本信息表 Mapper 接口
*/
public interface UsersMapper extends BaseMapper<Users> {
/**
* 登录
* @param username 用户名
* @param password 密码
* @return 用户对象
*/
@Select("select * from users where username = #{username} and password = #{password}")
Users login(String username, String password);
/**
* 根据用户名查询用户
* @param username 用户名
* @return 用户对象
*/
@Select("select * from users where username = #{username}")
Users selectByUsername(String username);
/**
* 根据邮箱查询用户
* @param email 邮箱
* @return 用户对象
*/
@Select("select * from Users where email = #{email}")
Users selectByEmail(String email);
/**
* 根据手机号查询用户
* @param phone 手机号
* @return 用户对象
*/
@Select("select * from Users where phone = #{phone}")
Users selectByPhone(String phone);
/**
* 查询用户信息
* @param users 用户信息
* @param queryWrapper 查询条件包装器
* @return 用户对象
*/
Users selectInfo(Users users, QueryWrapper<Users> queryWrapper);
/**
* 更新用户信息
* @param users 用户信息
* @param updateWrapper 更新条件包装器
* @return 是否成功
*/
int updateInfo(Users users, UpdateWrapper<Users> updateWrapper);
}