package com.fs.hisStore.controller.store;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.R;
import com.fs.common.core.page.TableDataInfo;
import com.fs.company.domain.*;
import com.fs.company.param.CompanyParam;
import com.fs.company.service.*;
import com.fs.company.vo.CompanyVO;
import com.fs.his.vo.OptionsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 企业Controller
 *
 * @author fs
 * @date 2021-10-04
 */
@RestController
@RequestMapping("/company/company")
public class CompanyController extends BaseController
{
    @Autowired
    private ICompanyService companyService;
    /**
     * 查询企业列表
     */
    @PreAuthorize("@ss.hasPermi('company:company:list')")
    @GetMapping("/list")
    public TableDataInfo list(CompanyParam param)
    {
        startPage();
        List<CompanyVO> list = companyService.selectCompanyVOList(param);
        return getDataTable(list);
    }





    @GetMapping("/getCompanyList")
    public R getCompanyList()
    {
        Company map=new Company();
        map.setIsDel(0);
        List<Company> list = companyService.selectCompanyList(map);
        return R.ok().put("data",list);
    }






    @GetMapping("/allList")
    public TableDataInfo getHospital()
    {
        List<OptionsVO> list = companyService.selectAllCompanyList(null);
        return getDataTable(list);
    }
}
