新增用户服务实现类UsersServiceImpl,包含用户CRUD操作 新增角色服务实现类RolesServiceImpl,包含角色管理功能 新增验证工具类ValidateUtil,提供参数验证功能 更新所有实体类添加@Builder注解 更新所有Mapper接口添加selectInfo和updateInfo方法 更新application.properties添加server.port配置 修复OrdersServiceImpl中Logger使用问题 添加updateInfo方法使用文档
52 lines
1.5 KiB
Java
52 lines
1.5 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 用户名
|
|
* @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);
|
|
}
|