prescript

This commit is contained in:
wangjinlei
2023-12-14 13:23:18 +08:00
parent 508a260a5a
commit 6a42c41ec2
3 changed files with 52 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
package com.peanut.modules.book.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -27,6 +29,9 @@ public class PrescriptServiceImpl extends ServiceImpl<PrescriptDao, PrescriptEn
wrapper.eq(prescriptCategoryId>0,PrescriptEntity::getPrescriptCategoryId,prescriptCategoryId);
wrapper.orderByDesc(PrescriptEntity::getSort);
Page<PrescriptEntity> prescriptEntityPage = getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (PrescriptEntity p : prescriptEntityPage.getRecords()){
p.setImageList(JSON.parseArray(p.getImages(),String.class));
}
return prescriptEntityPage;
}
}