prescript

This commit is contained in:
wangjinlei
2023-12-19 16:23:18 +08:00
parent 42cbc1155e
commit d12949549d
5 changed files with 41 additions and 5 deletions

View File

@@ -12,4 +12,6 @@ public interface PrescriptService extends IService<PrescriptEntity> {
Page<PrescriptEntity> getPrescriptList(int prescriptCategoryId,int limit,int page);
List<PrescriptEntity> getPrescriptListForJF();
List<PrescriptEntity> searchPrescripts(int type,String keywords);
}

View File

@@ -48,7 +48,21 @@ public class PrescriptServiceImpl extends ServiceImpl<PrescriptDao, PrescriptEn
wrapper.eq("prescript_category_id",3);
wrapper.orderByAsc("CONVERT(title USING gbk) COLLATE gbk_chinese_ci");
List<PrescriptEntity> list = list(wrapper);
// Page<PrescriptEntity> page1 = page(new Page<PrescriptEntity>(page, limit), wrapper);
return list;
}
@Override
public List<PrescriptEntity> searchPrescripts(int type, String keywords) {
LambdaQueryWrapper<PrescriptEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.like(PrescriptEntity::getTitle,keywords);
if(type == 3){
wrapper.eq(PrescriptEntity::getPrescriptCategoryId,3);
}else{
List<Integer> l = new ArrayList<>();
getCategoryIds(type,l);
wrapper.in(PrescriptEntity::getPrescriptCategoryId,l);
}
List<PrescriptEntity> list = list(wrapper);
return list;
}