| | |
| | | @GetMapping("/getKjTjAdviceKjbqBySex") |
| | | @ApiOperation(value = "根据体检人性别和是否为总检查询体检建议接口") |
| | | public AjaxResult getKjTjAdviceKjbqBySex(@RequestParam String sex, @RequestParam @ApiParam(value = "1常规医生 0总检") String isZj, |
| | | @RequestParam(required = false) @ApiParam(value ="建议内容") String jynr, |
| | | @RequestParam(required = false) @ApiParam(value ="建议标题") String jybt, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryWrapper<TjAdvice> wq = new LambdaQueryWrapper<>(); |
| | | Page<TjAdvice> page1 = new Page<>(page, pageSize); |
| | | wq.eq(TjAdvice::getAdSex, sex).or().isNull(TjAdvice::getAdSex); |
| | | // wq.eq(TjAdvice::getAdSex, sex).or().isNull(TjAdvice::getAdSex); |
| | | wq.eq(TjAdvice::getIsZj, isZj); |
| | | if(StringUtil.isNotBlank(jynr)) wq.like(TjAdvice::getAdvice,jynr); |
| | | if(StringUtil.isNotBlank(jybt)) wq.like(TjAdvice::getTitle,jybt); |
| | | wq.and(i -> i.eq(TjAdvice::getAdSex, sex).or().isNull(TjAdvice::getAdSex)); |
| | | Page<TjAdvice> kjbqPage = tjAdviceService.page(page1, wq); |
| | | return AjaxResult.success(kjbqPage); |
| | | } |
| | |
| | | LambdaQueryWrapper<TjUserAdvice> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjUserAdvice::getUserId, userId); |
| | | List<TjUserAdvice> list = userAdviceService.list(wq0); |
| | | if (null != list && list.size() > 0) { |
| | | if (null != list && !list.isEmpty()) { |
| | | List<Long> longs = list.stream().map(TjUserAdvice::getAdviceId).collect(Collectors.toList()); |
| | | wq.in(TjAdvice::getId,longs); |
| | | wq.last("and (ad_sex=1 OR ad_sex=2)"); |
| | | // wq.last("and (ad_sex=1 OR ad_sex=2)"); |
| | | Page<TjAdvice> kjbqPage = tjAdviceService.page(page1,wq); |
| | | return AjaxResult.success(kjbqPage); |
| | | } |
| | |
| | | @ApiParam(value = "建议") @RequestParam(required = false) String nr, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize, |
| | | @RequestParam(value = "deptId")String deptId) { |
| | | @RequestParam(required = false)String deptId) { |
| | | // LambdaQueryWrapper<SysDept> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(SysDept::getParentId, 0); |
| | | // SysDept sysDept = sysDeptService.getOne(wrapper); |
| | |
| | | // } |
| | | // map.put("list", list); |
| | | // map.put("total", page2.getTotal()); |
| | | List<TjAdvice> tjAdvices = tjAdviceService.selectList(proName, deptId, (page - 1) * pageSize, pageSize); |
| | | Integer count = tjAdviceService.selectListCount(proName, deptId); |
| | | List<TjAdvice> tjAdvices = tjAdviceService.selectList(proName, deptId, (page - 1) * pageSize, pageSize,bt,nr); |
| | | Integer count = tjAdviceService.selectListCount(proName, deptId,bt,nr); |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("list",tjAdvices); |
| | | hashMap.put("total",count); |