clock打卡前端
This commit is contained in:
@@ -2,8 +2,10 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -37,5 +39,12 @@ public interface BookService extends IService<BookEntity> {
|
||||
|
||||
|
||||
PageUtils queryPagebooks(Map<String, Object> params);
|
||||
|
||||
|
||||
Page<BookEntity> getUserClockBooks(Integer userId, Integer limit, Integer page);
|
||||
|
||||
|
||||
|
||||
Page<BookEntity> getUserClockBestBooks(Integer userId, Integer limit, Integer page);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.OSSException;
|
||||
import com.aliyun.oss.model.OSSObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.google.common.base.Joiner;
|
||||
import com.peanut.common.utils.ConstantPropertiesUtils;
|
||||
@@ -14,6 +16,7 @@ import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
||||
import com.peanut.modules.book.service.BookChapterService;
|
||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
@@ -705,7 +708,28 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<BookEntity> getUserClockBooks(Integer userId, Integer limit, Integer page) {
|
||||
String exist_sql = "select 1 from user_ebook_buy where book_id = book.id and user_id = "+userId;
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getClockIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
wrapper.exists(exist_sql);
|
||||
Page<BookEntity> bookEntityPage = this.getBaseMapper().selectPage(new Page<BookEntity>(page, limit), wrapper);
|
||||
return bookEntityPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<BookEntity> getUserClockBestBooks(Integer userId, Integer limit, Integer page) {
|
||||
String exist_sql = "select 1 from user_ebook_buy where book_id = book.id and user_id = "+userId;
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getClockIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
wrapper.notExists(exist_sql);
|
||||
Page<BookEntity> bookEntityPage = this.getBaseMapper().selectPage(new Page<BookEntity>(page, limit), wrapper);
|
||||
return bookEntityPage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user