package com.ruoyi.web.controller.system;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.system.domain.HospData;
|
import com.ruoyi.system.mapper.HospDataMapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* 医院数据Controller
|
*
|
* @author ruoyi
|
* @date 2024-01-16
|
*/
|
@RestController
|
@RequestMapping("/system/hospital")
|
public class HospDataController extends BaseController {
|
|
@Autowired
|
private HospDataMapper hospDataMapper;
|
|
/**
|
* 搜索医院
|
* 支持根据医院名称、地址、地域进行模糊搜索
|
* @param keyword 搜索关键词(医院名称、地址、简称、省市区)
|
* @param region 地域关键词(用于过滤省市区)
|
*/
|
@GetMapping("/search")
|
public AjaxResult searchHospitals(
|
@RequestParam(value = "keyword", required = false) String keyword,
|
@RequestParam(value = "region", required = false) String region) {
|
List<HospData> list = hospDataMapper.searchHospitals(keyword, region);
|
return success(list);
|
}
|
|
/**
|
* 根据ID获取医院详情
|
*/
|
@GetMapping("/detail")
|
public AjaxResult getHospitalDetail(@RequestParam("hospId") Integer hospId) {
|
HospData hospital = hospDataMapper.selectHospDataById(hospId);
|
return success(hospital);
|
}
|
}
|