分页2
This commit is contained in:
@@ -21,6 +21,6 @@ public interface BannerDao extends BaseMapper<Banner> {
|
||||
|
||||
// List<Banner> selectList(@Param("classify") Integer classify);
|
||||
|
||||
IPage<Banner> selectBannerPage(Page<Banner> page,@Param("classify") Integer classify);
|
||||
List<Banner> selectBanner(@Param("classify") Integer classify);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.banner.dao.BannerDao;
|
||||
@@ -53,8 +55,8 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
|
||||
@Override
|
||||
public PageUtils selectBannerPage(Integer page, Integer limit, Integer classify) {
|
||||
Page<Banner> pages = new Page<>(page, limit);
|
||||
return new PageUtils(bannerDao.selectBannerPage(pages, classify));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(bannerDao.selectBanner(classify)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface InviteDao extends BaseMapper<Invite> {
|
||||
Double selectInviteSum(@Param("state") Integer state, @Param("userId") Long userId);
|
||||
|
||||
// IPage<Map<String,Object>> selectInviteUser(Page<Map<String,Object>> page, @Param("userId") Long userId,@Param("state") Integer state,@Param("userType") Integer userType);
|
||||
IPage<Map<String,Object>> selectInviteUser(Page<Map<String,Object>> page,@Param("code") String code);
|
||||
List<Map<String,Object>> selectInviteUser(@Param("code") String code);
|
||||
|
||||
Invite selectInviteByUser(@Param("userId")Long userId,@Param("inviteeUserId") Long inviteeUserId,@Param("userType") Integer userType);
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface InviteDao extends BaseMapper<Invite> {
|
||||
|
||||
Double sumInviteMoney(@Param("time")String time,@Param("flag")Integer flag);
|
||||
|
||||
IPage<Map<String,Object>> inviteAnalysis(Page<Map<String,Object>> page,@Param("time")String time,@Param("flag")Integer flag);
|
||||
List<Map<String,Object>> inviteAnalysis(@Param("time")String time,@Param("flag")Integer flag);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.DateUtils;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.modules.app.entity.UserEntity;
|
||||
@@ -71,9 +73,9 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
|
||||
@Override
|
||||
public PageUtils selectInviteUser(int page, int limit, Long userId, Integer state, Integer userType) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
UserEntity userEntity = userService.queryByUserId(userId);
|
||||
return new PageUtils(inviteDao.selectInviteUser(pages, userEntity.getInvitationCode()));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(inviteDao.selectInviteUser(userEntity.getInvitationCode())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,8 +100,8 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
||||
|
||||
@Override
|
||||
public PageUtils inviteAnalysis(int page, int limit, String time, Integer flag) {
|
||||
Page<Map<String, Object>> pages = new Page<>(page, limit);
|
||||
return new PageUtils(inviteDao.inviteAnalysis(pages, time, flag));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(inviteDao.inviteAnalysis(time, flag)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.sqx.modules.job.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.job.dao.ScheduleJobLogDao;
|
||||
import com.sqx.modules.job.entity.ScheduleJobEntity;
|
||||
import com.sqx.modules.job.entity.ScheduleJobLogEntity;
|
||||
import com.sqx.modules.job.service.ScheduleJobLogService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -20,12 +25,11 @@ public class ScheduleJobLogServiceImpl extends ServiceImpl<ScheduleJobLogDao, Sc
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String jobId = (String)params.get("jobId");
|
||||
|
||||
IPage<ScheduleJobLogEntity> page = this.page(
|
||||
new Query<ScheduleJobLogEntity>().getPage(params),
|
||||
new QueryWrapper<ScheduleJobLogEntity>().like(StringUtils.isNotBlank(jobId),"job_id", jobId).orderByDesc("create_time")
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<ScheduleJobLogEntity>().like(StringUtils.isNotBlank(jobId),"job_id", jobId).orderByDesc("create_time"))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.sqx.modules.job.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
@@ -37,12 +40,11 @@ public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, Schedule
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String beanName = (String)params.get("beanName");
|
||||
|
||||
IPage<ScheduleJobEntity> page = this.page(
|
||||
new Query<ScheduleJobEntity>().getPage(params),
|
||||
new QueryWrapper <ScheduleJobEntity>().like(StringUtils.isNotBlank(beanName),"bean_name", beanName)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper <ScheduleJobEntity>().like(StringUtils.isNotBlank(beanName),"bean_name", beanName))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.sqx.modules.message.entity.ActivityMessageInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
* @date 2020/7/9
|
||||
@@ -14,11 +16,11 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface ActivityMessageInfoDao extends BaseMapper<ActivityMessageInfo> {
|
||||
|
||||
IPage<ActivityMessageInfo> find(Page<ActivityMessageInfo> page,@Param("state") String state);
|
||||
List<ActivityMessageInfo> find(@Param("state") String state);
|
||||
|
||||
IPage<ActivityMessageInfo> findType(Page<ActivityMessageInfo> page,@Param("type") Integer type);
|
||||
List<ActivityMessageInfo> findType(@Param("type") Integer type);
|
||||
|
||||
IPage<ActivityMessageInfo> findTypeByUserId(Page<ActivityMessageInfo> page,@Param("type")String type,@Param("userId") String userId);
|
||||
List<ActivityMessageInfo> findTypeByUserId(@Param("type")String type,@Param("userId") String userId);
|
||||
|
||||
Integer updateState(@Param("state") String state, @Param("id") Long id);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.sqx.modules.message.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.modules.message.dao.ActivityMessageInfoDao;
|
||||
import com.sqx.modules.message.entity.ActivityMessageInfo;
|
||||
@@ -54,8 +56,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils find(String state, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.find(pages,state));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.find(state)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,8 +69,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils findType(Integer type, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.findType(pages,type));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.findType(type)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,8 +87,8 @@ public class ActivityMessageServiceImpl extends ServiceImpl<ActivityMessageInfoD
|
||||
|
||||
@Override
|
||||
public PageUtils findTypeByUserId( String type,String userId, int page,int limit) {
|
||||
Page<ActivityMessageInfo> pages = new Page<>(page, limit);
|
||||
return new PageUtils(activityMessageInfoDao.findTypeByUserId(pages,type,userId));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(activityMessageInfoDao.findTypeByUserId(type,userId)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package com.sqx.modules.message.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.app.service.UserService;
|
||||
import com.sqx.modules.job.entity.ScheduleJobLogEntity;
|
||||
import com.sqx.modules.message.dao.MessageInfoDao;
|
||||
import com.sqx.modules.message.entity.MessageInfo;
|
||||
import com.sqx.modules.message.service.MessageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -38,20 +44,22 @@ public class MessageServiceImpl extends ServiceImpl<MessageInfoDao, MessageInfo>
|
||||
Long userId = (Long)params.get("userId");
|
||||
Integer state = (Integer)params.get("state");
|
||||
Integer type = (Integer)params.get("type");
|
||||
IPage<MessageInfo> page = this.page(
|
||||
new Query<MessageInfo>().getPage(params),
|
||||
new QueryWrapper<MessageInfo>()
|
||||
.eq(userId!=null,"user_id", userId)
|
||||
.eq(state!=null,"state", state)
|
||||
.eq(type!=null,"type", type).orderByDesc("create_at")
|
||||
);
|
||||
List<MessageInfo> records = page.getRecords();
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
PageUtils page = PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<MessageInfo>()
|
||||
.eq(userId != null, "user_id", userId)
|
||||
.eq(state != null, "state", state)
|
||||
.eq(type != null, "type", type).orderByDesc("create_at"))));
|
||||
|
||||
List<MessageInfo> records = (List<MessageInfo>) page.getList();
|
||||
for (MessageInfo messageInfo:records){
|
||||
if(messageInfo.getUserId()!=null){
|
||||
messageInfo.setUserEntity(userService.selectUserById(Long.parseLong(messageInfo.getUserId())));
|
||||
}
|
||||
}
|
||||
return new PageUtils(page);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.sqx.modules.oss.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.message.entity.MessageInfo;
|
||||
import com.sqx.modules.oss.dao.SysOssDao;
|
||||
import com.sqx.modules.oss.entity.SysOssEntity;
|
||||
import com.sqx.modules.oss.service.SysOssService;
|
||||
@@ -17,11 +23,11 @@ public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOssEntity> impl
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<SysOssEntity> page = this.page(
|
||||
new Query<SysOssEntity>().getPage(params)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface CashOutDao extends BaseMapper<CashOut> {
|
||||
|
||||
Double selectMayMoney(@Param("userId") Long userId);
|
||||
|
||||
IPage<CashOut> selectCashOutPage(Page<CashOut> page, CashOut cashOut);
|
||||
List<CashOut> selectCashOutPage(CashOut cashOut);
|
||||
|
||||
List<CashOut> selectCashOutList(@Param("cashOut") CashOut cashOut);
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
@@ -105,7 +107,8 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
|
||||
@Override
|
||||
public PageUtils selectCashOutList(Integer page, Integer limit, CashOut cashOut) {
|
||||
return new PageUtils(baseMapper.selectCashOutPage(new Page<>(page, limit), cashOut));
|
||||
PageHelper.startPage(page, limit);
|
||||
return PageUtils.page(new PageInfo<>(baseMapper.selectCashOutPage(cashOut)));
|
||||
}
|
||||
|
||||
|
||||
@@ -539,8 +542,8 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
|
||||
//cashOut.setState(3);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
IPage<CashOut> page = baseMapper.selectCashOutPage(new Page<>(pageNum, pageSize), cashOut);
|
||||
return new PageUtils(page);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(baseMapper.selectCashOutPage(cashOut)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.gson.Gson;
|
||||
import com.sqx.common.exception.SqxException;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysConfigDao;
|
||||
@@ -28,14 +32,13 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigDao, SysConfigEnt
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String paramKey = (String)params.get("paramKey");
|
||||
|
||||
IPage<SysConfigEntity> page = this.page(
|
||||
new Query<SysConfigEntity>().getPage(params),
|
||||
new QueryWrapper<SysConfigEntity>()
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<SysConfigEntity>()
|
||||
.like(StringUtils.isNotBlank(paramKey),"param_key", paramKey)
|
||||
.eq("status", 1)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
.eq("status", 1))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysDictDao;
|
||||
@@ -21,13 +25,14 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictDao, SysDictEntity> i
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String name = (String)params.get("name");
|
||||
|
||||
IPage<SysDictEntity> page = this.page(
|
||||
new Query<SysDictEntity>().getPage(params),
|
||||
new QueryWrapper<SysDictEntity>()
|
||||
.like(StringUtils.isNotBlank(name),"name", name)
|
||||
);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<SysDictEntity>()
|
||||
.like(StringUtils.isNotBlank(name),"name", name))));
|
||||
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysLogDao;
|
||||
@@ -21,11 +25,10 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLogEntity> impl
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String key = (String)params.get("key");
|
||||
|
||||
IPage<SysLogEntity> page = this.page(
|
||||
new Query<SysLogEntity>().getPage(params),
|
||||
new QueryWrapper<SysLogEntity>().like(StringUtils.isNotBlank(key),"username", key)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<SysLogEntity>().like(StringUtils.isNotBlank(key),"username", key))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysRoleDao;
|
||||
@@ -38,15 +42,13 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
String roleName = (String)params.get("roleName");
|
||||
Long createUserId = (Long)params.get("createUserId");
|
||||
|
||||
IPage<SysRoleEntity> page = this.page(
|
||||
new Query<SysRoleEntity>().getPage(params),
|
||||
new QueryWrapper<SysRoleEntity>()
|
||||
.like(StringUtils.isNotBlank(roleName),"role_name", roleName)
|
||||
.eq(createUserId != null,"create_user_id", createUserId)
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<SysRoleEntity>()
|
||||
.like(StringUtils.isNotBlank(roleName),"role_name", roleName)
|
||||
.eq(createUserId != null,"create_user_id", createUserId))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapProxy;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.sqx.common.utils.Constant;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Query;
|
||||
import com.sqx.modules.sys.dao.SysUserDao;
|
||||
@@ -41,18 +45,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
|
||||
Long createUserId = (Long) params.get("createUserId");
|
||||
Object isChannel = params.get("isChannel");
|
||||
Object sysUserId = params.get("sysUserId");
|
||||
IPage<SysUserEntity> page = this.page(
|
||||
new Query<SysUserEntity>().getPage(params),
|
||||
new QueryWrapper<SysUserEntity>()
|
||||
.like(StringUtils.isNotBlank(username), "username", username)
|
||||
.eq(createUserId != null, "create_user_id", createUserId)
|
||||
.eq(isChannel != null, "is_channel", isChannel)
|
||||
.eq(sysUserId != null, "sys_user_id", sysUserId)
|
||||
.isNull(sysUserId == null, "sys_user_id")
|
||||
.isNull(isChannel == null, "is_channel")
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
MapProxy proxy = MapProxy.create(params);
|
||||
long pageNum = proxy.getLong(Constant.PAGE, 1L);
|
||||
long pageSize = proxy.getLong(Constant.LIMIT, 10L);
|
||||
PageHelper.startPage((int) pageNum, (int) pageSize);
|
||||
return PageUtils.page(new PageInfo<>(this.list(new QueryWrapper<SysUserEntity>()
|
||||
.like(StringUtils.isNotBlank(username), "username", username)
|
||||
.eq(createUserId != null, "create_user_id", createUserId)
|
||||
.eq(isChannel != null, "is_channel", isChannel)
|
||||
.eq(sysUserId != null, "sys_user_id", sysUserId)
|
||||
.isNull(sysUserId == null, "sys_user_id")
|
||||
.isNull(isChannel == null, "is_channel"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBannerPage" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
<select id="selectBanner" resultType="com.sqx.modules.banner.entity.Banner">
|
||||
select * from banner
|
||||
where classify=#{classify}
|
||||
order by `sort` desc
|
||||
|
||||
Reference in New Issue
Block a user