main
parent
96e4058e14
commit
2b9c4e6377
@ -0,0 +1,35 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2023-02-21 09:46:06
|
||||
*/
|
||||
public interface StoreupDao extends BaseMapper<StoreupEntity> {
|
||||
|
||||
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Pagination page,@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
|
||||
package com.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.entity.TokenEntity;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
public interface TokenDao extends BaseMapper<TokenEntity> {
|
||||
|
||||
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
List<TokenEntity> selectListView(Pagination page,@Param("ew") Wrapper<TokenEntity> wrapper);
|
||||
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* token表
|
||||
*/
|
||||
@TableName("token")
|
||||
public class TokenEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userid;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
private String tablename;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
/**
|
||||
* token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Date expiratedtime;
|
||||
|
||||
/**
|
||||
* 新增时间
|
||||
*/
|
||||
private Date addtime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(Long userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public String getTablename() {
|
||||
return tablename;
|
||||
}
|
||||
|
||||
public void setTablename(String tablename) {
|
||||
this.tablename = tablename;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Date getExpiratedtime() {
|
||||
return expiratedtime;
|
||||
}
|
||||
|
||||
public void setExpiratedtime(Date expiratedtime) {
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public TokenEntity(Long userid, String username, String tablename,String role, String token, Date expiratedtime) {
|
||||
super();
|
||||
this.userid = userid;
|
||||
this.username = username;
|
||||
this.tablename = tablename;
|
||||
this.role = role;
|
||||
this.token = token;
|
||||
this.expiratedtime = expiratedtime;
|
||||
}
|
||||
|
||||
public TokenEntity() {
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotations.TableId;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.baomidou.mybatisplus.enums.IdType;
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
@TableName("users")
|
||||
public class UsersEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private String role;
|
||||
|
||||
private Date addtime;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public Date getAddtime() {
|
||||
return addtime;
|
||||
}
|
||||
|
||||
public void setAddtime(Date addtime) {
|
||||
this.addtime = addtime;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.NewsEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.NewsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
|
||||
/**
|
||||
* 公告信息
|
||||
*
|
||||
* @author // 作者信息
|
||||
* @email // 邮箱信息
|
||||
* @date 2023-02-21 09:46:06 // 创建日期
|
||||
*/
|
||||
public interface NewsService extends IService<NewsEntity> { // 声明一个接口,扩展 IService 用于基本的 CRUD 操作
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params); // 根据传入的参数进行分页查询,并返回分页结果
|
||||
|
||||
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper); // 根据条件包装器查询并返回 NewsVO 列表
|
||||
|
||||
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper); // 根据条件包装器查询并返回单个 NewsVO 对象
|
||||
|
||||
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper); // 根据条件包装器查询并返回 NewsView 列表
|
||||
|
||||
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper); // 根据条件包装器查询并返回单个 NewsView 对象
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper); // 根据参数和条件包装器进行分页查询,并返回分页结果
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.StoreupEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author // 作者信息
|
||||
* @email // 邮箱信息
|
||||
* @date 2023-02-21 09:46:06 // 创建日期
|
||||
*/
|
||||
public interface StoreupService extends IService<StoreupEntity> { // 声明一个接口,扩展 IService 用于基本的 CRUD 操作
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params); // 根据传入的参数进行分页查询,并返回分页结果
|
||||
|
||||
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper); // 根据条件包装器查询并返回 StoreupVO 列表
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper); // 根据条件包装器查询并返回单个 StoreupVO 对象
|
||||
|
||||
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper); // 根据条件包装器查询并返回 StoreupView 列表
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper); // 根据条件包装器查询并返回单个 StoreupView 对象
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper); // 根据参数和条件包装器进行分页查询,并返回分页结果
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.SystemintroEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.SystemintroVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.SystemintroView;
|
||||
/**
|
||||
* 关于我们
|
||||
*
|
||||
* @author // 作者信息
|
||||
* @email // 邮箱信息
|
||||
* @date 2023-02-21 09:46:06 // 创建日期
|
||||
*/
|
||||
public interface SystemintroService extends IService<SystemintroEntity> { // 声明一个接口,扩展 IService 用于基本的 CRUD 操作
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params); // 根据传入的参数进行分页查询,并返回分页结果
|
||||
|
||||
List<SystemintroVO> selectListVO(Wrapper<SystemintroEntity> wrapper); // 根据条件包装器查询并返回 SystemintroVO 列表
|
||||
|
||||
SystemintroVO selectVO(@Param("ew") Wrapper<SystemintroEntity> wrapper); // 根据条件包装器查询并返回单个 SystemintroVO 对象
|
||||
|
||||
List<SystemintroView> selectListView(Wrapper<SystemintroEntity> wrapper); // 根据条件包装器查询并返回 SystemintroView 列表
|
||||
|
||||
SystemintroView selectView(@Param("ew") Wrapper<SystemintroEntity> wrapper); // 根据条件包装器查询并返回单个 SystemintroView 对象
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params, Wrapper<SystemintroEntity> wrapper); // 根据参数和条件包装器进行分页查询,并返回分页结果
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.NewsDao;
|
||||
import com.entity.NewsEntity;
|
||||
import com.service.NewsService;
|
||||
import com.entity.vo.NewsVO;
|
||||
import com.entity.view.NewsView;
|
||||
|
||||
@Service("newsService") // 声明该类为服务层组件,并指定服务名称为 "newsService"
|
||||
public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements NewsService {
|
||||
|
||||
// 实现分页查询
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
// 创建一个分页对象,使用传入的参数获取页面信息
|
||||
Page<NewsEntity> page = this.selectPage(
|
||||
new Query<NewsEntity>(params).getPage(), // 获取分页对象
|
||||
new EntityWrapper<NewsEntity>() // 构建查询条件的包装器
|
||||
);
|
||||
return new PageUtils(page); // 返回分页结果包装
|
||||
}
|
||||
|
||||
// 实现带条件的分页查询
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper) {
|
||||
// 创建分页对象
|
||||
Page<NewsView> page = new Query<NewsView>(params).getPage();
|
||||
// 设置页面记录
|
||||
page.setRecords(baseMapper.selectListView(page, wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page); // 包装分页结果
|
||||
return pageUtil; // 返回分页结果
|
||||
}
|
||||
|
||||
// 查询符合条件的所有 NewsVO 对象
|
||||
@Override
|
||||
public List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper); // 调用 DAO 层方法执行查询
|
||||
}
|
||||
|
||||
// 查询单个 NewsVO 对象
|
||||
@Override
|
||||
public NewsVO selectVO(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper); // 调用 DAO 层方法执行查询
|
||||
}
|
||||
|
||||
// 查询符合条件的所有 NewsView 对象
|
||||
@Override
|
||||
public List<NewsView> selectListView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper); // 调用 DAO 层方法执行查询
|
||||
}
|
||||
|
||||
// 查询单个 NewsView 对象
|
||||
@Override
|
||||
public NewsView selectView(Wrapper<NewsEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper); // 调用 DAO 层方法执行查询
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.StoreupDao;
|
||||
import com.entity.StoreupEntity;
|
||||
import com.service.StoreupService;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
@Service("storeupService") // 将该类标记为服务,并指定 bean 的名称为 "storeupService"
|
||||
public class StoreupServiceImpl extends ServiceImpl<StoreupDao, StoreupEntity> implements StoreupService {
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
// 根据传入的参数创建分页对象,并调用 selectPage 方法获取数据
|
||||
Page<StoreupEntity> page = this.selectPage(
|
||||
new Query<StoreupEntity>(params).getPage(), // 构造分页信息
|
||||
new EntityWrapper<StoreupEntity>() // 创建 EntityWrapper 用于封装查询条件
|
||||
);
|
||||
// 返回封装好的分页结果
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper) {
|
||||
// 创建分页对象
|
||||
Page<StoreupView> page = new Query<StoreupView>(params).getPage();
|
||||
// 设置分页记录
|
||||
page.setRecords(baseMapper.selectListView(page, wrapper)); // 根据分页信息和条件查询数据
|
||||
// 返回封装好的分页结果
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回 StoreupVO 列表
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupVO selectVO(Wrapper<StoreupEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回单个 StoreupVO 对象
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回 StoreupView 列表
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupView selectView(Wrapper<StoreupEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回单个 StoreupView 对象
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.SystemintroDao;
|
||||
import com.entity.SystemintroEntity;
|
||||
import com.service.SystemintroService;
|
||||
import com.entity.vo.SystemintroVO;
|
||||
import com.entity.view.SystemintroView;
|
||||
|
||||
@Service("systemintroService") // 将该类标记为服务,并指定 bean 的名称为 "systemintroService"
|
||||
public class SystemintroServiceImpl extends ServiceImpl<SystemintroDao, SystemintroEntity> implements SystemintroService {
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
// 根据传入的参数创建分页对象,并调用 selectPage 方法获取数据
|
||||
Page<SystemintroEntity> page = this.selectPage(
|
||||
new Query<SystemintroEntity>(params).getPage(), // 构造分页信息
|
||||
new EntityWrapper<SystemintroEntity>() // 创建 EntityWrapper 用于封装查询条件
|
||||
);
|
||||
// 返回封装好的分页结果
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<SystemintroEntity> wrapper) {
|
||||
// 创建分页对象
|
||||
Page<SystemintroView> page = new Query<SystemintroView>(params).getPage();
|
||||
// 设置分页记录
|
||||
page.setRecords(baseMapper.selectListView(page, wrapper)); // 根据分页信息和条件查询数据
|
||||
// 返回封装好的分页结果
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SystemintroVO> selectListVO(Wrapper<SystemintroEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回 SystemintroVO 列表
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemintroVO selectVO(Wrapper<SystemintroEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回单个 SystemintroVO 对象
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SystemintroView> selectListView(Wrapper<SystemintroEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回 SystemintroView 列表
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SystemintroView selectView(Wrapper<SystemintroEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回单个 SystemintroView 对象
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
|
||||
package com.service.impl;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.dao.UsersDao;
|
||||
import com.entity.UsersEntity;
|
||||
import com.service.UsersService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
/**
|
||||
* 系统用户
|
||||
*/
|
||||
@Service("usersService") // 将该类标记为服务,并指定 bean 的名称为 "usersService"
|
||||
public class UsersServiceImpl extends ServiceImpl<UsersDao, UsersEntity> implements UsersService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
// 根据传入的参数创建分页对象,并调用 selectPage 方法获取用户数据
|
||||
Page<UsersEntity> page = this.selectPage(
|
||||
new Query<UsersEntity>(params).getPage(), // 构造分页信息
|
||||
new EntityWrapper<UsersEntity>() // 创建 EntityWrapper 用于封装查询条件
|
||||
);
|
||||
// 返回封装好的分页结果
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UsersEntity> selectListView(Wrapper<UsersEntity> wrapper) {
|
||||
// 根据 Wrapper 条件查询并返回 UsersEntity 列表
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<UsersEntity> wrapper) {
|
||||
// 创建分页对象
|
||||
Page<UsersEntity> page = new Query<UsersEntity>(params).getPage();
|
||||
// 设置分页记录
|
||||
page.setRecords(baseMapper.selectListView(page, wrapper)); // 根据分页信息和条件查询数据
|
||||
// 返回封装好的分页结果
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
Subproject commit cc7b302c004f658cc1d4cc64d5b66b62471ab275
|
Loading…
Reference in new issue