prescript
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user