package com.peanut.modules.book.dao; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.yulichang.base.MPJBaseMapper; import com.peanut.modules.book.entity.BookEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; /** * 图书表 * * @author yl * @email yl328572838@163.com * @date 2022-08-04 15:36:59 */ @Mapper public interface BookDao extends MPJBaseMapper { List 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 queryUserListenBooksNobuy(@Param("ew") QueryWrapper 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 wrapper); }