package com.fs.company.controller.store;

import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.his.domain.FsIcd;
import com.fs.his.service.IFsIcdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * icd编码库Controller
 *
 * @author fs
 * @date 2024-04-22
 */
@RestController
@RequestMapping("/store/icd")
public class FsIcdController extends BaseController
{
    @Autowired
    private IFsIcdService fsIcdService;

    /**
     * 查询icd编码库列表
     */
    @GetMapping("/list")
    public TableDataInfo list(FsIcd fsIcd)
    {
        startPage();
        List<FsIcd> list = fsIcdService.selectFsIcdList(fsIcd);
        return getDataTable(list);
    }



    /**
     * 获取icd编码库详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(fsIcdService.selectFsIcdById(id));
    }


    @GetMapping(value = "/allIcd/{name}")
    public AjaxResult allIcd(@PathVariable("name") String name)
    {
        return AjaxResult.success(fsIcdService.selectFsIcdByName(name));
    }

}
