You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.5 KiB
69 lines
2.5 KiB
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);
|
|
}
|
|
}
|