|
|
|
|
@@ -64,6 +64,7 @@ public class MedicaldesController {
|
|
|
|
|
if (map.containsKey("bookName")&&StringUtils.isNotEmpty(map.get("bookName").toString())){
|
|
|
|
|
wrapper.like(BookEntity::getName,map.get("bookName"));
|
|
|
|
|
}
|
|
|
|
|
wrapper.orderByAsc(MedicaldesBook::getSort);
|
|
|
|
|
Page<MedicaldesBook> res = medicaldesBookService.page(new Page<MedicaldesBook>(
|
|
|
|
|
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())), wrapper);
|
|
|
|
|
List<MedicaldesBook> list = res.getRecords();
|
|
|
|
|
@@ -85,12 +86,19 @@ public class MedicaldesController {
|
|
|
|
|
wrapper.selectAll(BookEntity.class);
|
|
|
|
|
wrapper.leftJoin(MedicaldesBook.class,MedicaldesBook::getBookId,BookEntity::getId);
|
|
|
|
|
wrapper.eq(MedicaldesBook::getTypeId,type);
|
|
|
|
|
wrapper.orderByAsc(MedicaldesBook::getSort);
|
|
|
|
|
List<BookEntity> list = bookService.list(wrapper);
|
|
|
|
|
return R.ok().put("result", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(path = "/saveOrUpdateBookRelation")
|
|
|
|
|
public R saveOrUpdateBookRelation(@RequestBody MedicaldesBook medicaldesBook) {
|
|
|
|
|
MPJLambdaWrapper<MedicaldesBook> wrapper = new MPJLambdaWrapper();
|
|
|
|
|
wrapper.eq(MedicaldesBook::getBookId,medicaldesBook.getBookId());
|
|
|
|
|
wrapper.eq(MedicaldesBook::getTypeId,medicaldesBook.getTypeId());
|
|
|
|
|
if (medicaldesBookService.getOne(wrapper)!=null){
|
|
|
|
|
medicaldesBookService.remove(wrapper);
|
|
|
|
|
}
|
|
|
|
|
medicaldesBookService.saveOrUpdate(medicaldesBook);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
@@ -118,6 +126,8 @@ public class MedicaldesController {
|
|
|
|
|
wrapper.like(MedicaldesInherit::getName,map.get("name"));
|
|
|
|
|
}
|
|
|
|
|
wrapper.selectAs(MedicaldesInheritRelation::getTypeId,"type");
|
|
|
|
|
wrapper.selectAs(MedicaldesInheritRelation::getSort,"sort");
|
|
|
|
|
wrapper.orderByAsc(MedicaldesInheritRelation::getSort);
|
|
|
|
|
Page<MedicaldesInherit> page = inheritService.page(new Page<>(
|
|
|
|
|
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
|
|
|
|
return R.ok().put("result", page);
|
|
|
|
|
@@ -135,13 +145,20 @@ public class MedicaldesController {
|
|
|
|
|
wrapper.leftJoin(Province.class,Province::getProvId,City::getProvId);
|
|
|
|
|
wrapper.selectAll(MedicaldesInherit.class);
|
|
|
|
|
wrapper.eq(Province::getProvId,provId);
|
|
|
|
|
wrapper.selectAs(MedicaldesInheritRelation::getSort,"sort");
|
|
|
|
|
wrapper.orderByAsc(MedicaldesInheritRelation::getSort);
|
|
|
|
|
List<MedicaldesInherit> list = inheritService.list(wrapper);
|
|
|
|
|
return R.ok().put("result", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(path = "/getInheritById")
|
|
|
|
|
public R getInheritById(String id) {
|
|
|
|
|
return R.ok().put("result",inheritService.getById(id));
|
|
|
|
|
LambdaQueryWrapper<MedicaldesInheritRelation> wrapper = new LambdaQueryWrapper();
|
|
|
|
|
wrapper.eq(MedicaldesInheritRelation::getInheritId,id);
|
|
|
|
|
MedicaldesInheritRelation relation = relationService.getOne(wrapper);
|
|
|
|
|
MedicaldesInherit inherit = inheritService.getById(id);
|
|
|
|
|
inherit.setSort(relation.getSort());
|
|
|
|
|
return R.ok().put("result",inherit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(path = "/saveOrUpdateInherit")
|
|
|
|
|
@@ -157,6 +174,7 @@ public class MedicaldesController {
|
|
|
|
|
inheritService.saveOrUpdate(inherit);
|
|
|
|
|
relation.setTypeId(inherit.getType());
|
|
|
|
|
relation.setInheritId(inherit.getId());
|
|
|
|
|
relation.setSort(inherit.getSort());
|
|
|
|
|
relationService.saveOrUpdate(relation);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
@@ -181,6 +199,7 @@ public class MedicaldesController {
|
|
|
|
|
wrapper.selectAs(Province::getProvId,"provinceId");
|
|
|
|
|
wrapper.select("count(*) as count");
|
|
|
|
|
wrapper.groupBy("provinceName");
|
|
|
|
|
wrapper.orderByAsc(MedicaldesInheritRelation::getSort);
|
|
|
|
|
List<Map<String,Object>> list = inheritService.listMaps(wrapper);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
@@ -194,6 +213,7 @@ public class MedicaldesController {
|
|
|
|
|
if (StringUtils.isNotEmpty(type)){
|
|
|
|
|
wrapper.eq(MedicaldesLight::getType,type);
|
|
|
|
|
}
|
|
|
|
|
wrapper.orderByAsc(MedicaldesLight::getSort);
|
|
|
|
|
List<MedicaldesLight> list = lightService.list(wrapper);
|
|
|
|
|
return R.ok().put("result", list);
|
|
|
|
|
}
|
|
|
|
|
@@ -210,6 +230,7 @@ public class MedicaldesController {
|
|
|
|
|
if (map.containsKey("name")&&StringUtils.isNotEmpty(map.get("name").toString())){
|
|
|
|
|
wrapper.like(MedicaldesLight::getName,map.get("name"));
|
|
|
|
|
}
|
|
|
|
|
wrapper.orderByAsc(MedicaldesLight::getSort);
|
|
|
|
|
Page<MedicaldesLight> page = lightService.page(new Page<>(
|
|
|
|
|
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
|
|
|
|
return R.ok().put("result", page);
|
|
|
|
|
|