点赞、收藏分页查询添加是否点赞、收藏

This commit is contained in:
cjw 2024-07-16 14:57:41 +08:00
parent 0a61a6e8cf
commit 69cdc27527
2 changed files with 9 additions and 4 deletions

View File

@ -65,5 +65,8 @@ public class SysTextbookRecordVo implements Serializable {
private Date createTime;
private Boolean isLike;
private Boolean isCollect;
}

View File

@ -7,10 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPageList" resultType="org.dromara.system.domain.vo.SysTextbookRecordVo">
select tr.create_time,
tr.record_type,
ifnull(ot.file_name, '已失效') as fileName,
ot.id as ossTextbookId,
u.nick_name as createBy,
d.dept_name as createDept
ifnull(ot.file_name, '已失效') as fileName,
ot.id as ossTextbookId,
u.nick_name as createBy,
d.dept_name as createDept,
if(tr.record_type = 1, true, false) as isLike,
if(tr.record_type = 2, true, false) as isCollect
from sys_textbook_record tr
left join sys_oss_textbook ot on ot.id = tr.oss_textbook_id and ot.del_flag = 0
left join sys_user u on u.user_id = ot.create_by