wlzboy
2025-10-18 b46065a201c09ce69f111806f2bda4a5f476bc4e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    
    /**
     * 搜索医院
     * 支持根据医院名称或地址进行模糊搜索
     */
    @GetMapping("/search")
    public AjaxResult searchHospitals(@RequestParam(value = "keyword", required = false) String keyword) {
        List<HospData> list = hospDataMapper.searchHospitals(keyword);
        return success(list);
    }
    
    /**
     * 根据ID获取医院详情
     */
    @GetMapping("/detail")
    public AjaxResult getHospitalDetail(@RequestParam("hospId") Integer hospId) {
        HospData hospital = hospDataMapper.selectHospDataById(hospId);
        return success(hospital);
    }
}