| | |
| | | HospData hospital = hospDataMapper.selectHospDataById(hospId); |
| | | return success(hospital); |
| | | } |
| | | |
| | | /** |
| | | * 获取常用转出医院列表 |
| | | * @param serviceOrdClass 分公司编码(service_order_class) |
| | | * @param region 地域关键词(可选) |
| | | */ |
| | | @GetMapping("/frequent/out") |
| | | public AjaxResult getFrequentOutHospitals( |
| | | @RequestParam("serviceOrdClass") String serviceOrdClass, |
| | | @RequestParam(value = "region", required = false) String region) { |
| | | // 查询常用转出医院ID列表 |
| | | List<Integer> hospIds = hospDataMapper.selectFrequentOutHospitalIds(serviceOrdClass); |
| | | if (hospIds == null || hospIds.isEmpty()) { |
| | | return success(); |
| | | } |
| | | Integer homeHospId=hospDataMapper.getHomeHospId(); |
| | | if (!hospIds.contains(homeHospId)) { |
| | | hospIds.add(0,homeHospId); |
| | | } |
| | | // 根据ID列表查询医院详情 |
| | | List<HospData> hospitals = hospDataMapper.selectHospDataByIds(hospIds, region); |
| | | return success(hospitals); |
| | | } |
| | | |
| | | /** |
| | | * 获取常用转入医院列表 |
| | | * @param serviceOrdClass 分公司编码(service_order_class) |
| | | * @param region 地域关键词(可选) |
| | | */ |
| | | @GetMapping("/frequent/in") |
| | | public AjaxResult getFrequentInHospitals( |
| | | @RequestParam("serviceOrdClass") String serviceOrdClass, |
| | | @RequestParam(value = "region", required = false) String region) { |
| | | // 查询常用转入医院ID列表 |
| | | List<Integer> hospIds = hospDataMapper.selectFrequentInHospitalIds(serviceOrdClass); |
| | | if (hospIds == null || hospIds.isEmpty()) { |
| | | return success(); |
| | | } |
| | | Integer homeHospId=hospDataMapper.getHomeHospId(); |
| | | if (!hospIds.contains(homeHospId)) { |
| | | hospIds.add(0,homeHospId); |
| | | } |
| | | // 根据ID列表查询医院详情 |
| | | List<HospData> hospitals = hospDataMapper.selectHospDataByIds(hospIds, region); |
| | | return success(hospitals); |
| | | } |
| | | } |