This commit is contained in:
wangjinlei
2023-09-21 17:07:36 +08:00
parent 1810d6efd7
commit ac80121377
6 changed files with 48 additions and 273 deletions

View File

@@ -1,9 +1,13 @@
package com.peanut.modules.book.dao;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.book.entity.BookEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@@ -20,4 +24,10 @@ public interface BookDao extends MPJBaseMapper<BookEntity> {
List<BookEntity> queryBookInOther(String publisherName,String authorName);
@Select("select t.* from book t left join user_ebook_buy t1 on t.id = t1.book_id ${ew.customSqlSegment} limit #{start},#{limit}")
List<BookEntity> queryUserListenBooksNobuy(@Param("ew") QueryWrapper<BookEntity> wrapper,@Param("start") int start,@Param("limit") int limit);
@Select("select count(*) as sum from book t left join user_ebook_buy t1 on t.id = t1.book_id ${ew.customSqlSegment}")
Integer queryUserListenBooksNobuyCount(@Param("ew") QueryWrapper<BookEntity> wrapper);
}

View File

@@ -1,5 +1,6 @@
package com.peanut.modules.book.dao;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.book.entity.UserEbookBuyEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@@ -12,6 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2022-10-18 16:28:20
*/
@Mapper
public interface UserEbookBuyDao extends BaseMapper<UserEbookBuyEntity> {
public interface UserEbookBuyDao extends MPJBaseMapper<UserEbookBuyEntity> {
}