prescript
This commit is contained in:
@@ -79,9 +79,7 @@ public class MyUserController {
|
||||
@RequestMapping("/getUserList")
|
||||
public R getUserList(@RequestBody PageIdDto p){
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if(!p.getKey().equals(null)&&p.getKey()!=""){
|
||||
wrapper.eq(MyUserEntity::getTel,p.getKey()).or().eq(MyUserEntity::getName,p.getKey());
|
||||
}
|
||||
wrapper.and(p.getKey()!="",k->k.like(MyUserEntity::getName,p.getKey()).or().like(MyUserEntity::getTel,p.getKey()));
|
||||
wrapper.orderByDesc(MyUserEntity::getCreateTime);
|
||||
Page<MyUserEntity> myUserEntityPage = userService.getBaseMapper().selectPage(new Page<MyUserEntity>(p.getPage(), p.getLimit()), wrapper);
|
||||
|
||||
@@ -130,7 +128,6 @@ public class MyUserController {
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
System.out.println(user.toString());
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -75,6 +75,19 @@ public class PrescriptController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找方药文章
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/searchPrescript")
|
||||
public R searchPrescript(@RequestBody Map<String,Object> map){
|
||||
Integer type = Integer.valueOf(map.get("type").toString());
|
||||
String keywords = map.get("keywords").toString();
|
||||
List<PrescriptEntity> prescriptEntities = prescriptService.searchPrescripts(type, keywords);
|
||||
return R.ok().put("list",prescriptEntities);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方剂文章
|
||||
* @param p
|
||||
|
||||
@@ -97,6 +97,16 @@ public class MyUserEntity implements Serializable {
|
||||
*/
|
||||
private Integer wylqPower;
|
||||
|
||||
/**
|
||||
* 吴门验方权限
|
||||
*/
|
||||
private Integer prescriptAPower;
|
||||
|
||||
/**
|
||||
* 肿瘤古方权限
|
||||
*/
|
||||
private Integer prescriptBPower;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@@ -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