package com.mosty.base.manager.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.manager.service.VwSydwJbxxGxService;
import com.mosty.base.model.entity.afjcsj.VwSydwCyryGx;
import com.mosty.base.model.entity.afjcsj.VwSyrkJzgjGx;
import com.mosty.base.model.query.afjcsj.VwSydwCyryPageQuery;
import com.mosty.base.model.query.afjcsj.VwSydwJbxxGxQuery;
import com.mosty.base.model.entity.afjcsj.VwSydwJbxxGx;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author dw
 * @since 2022-10-27
 */
@RestController
@RequestMapping("/vwSydwJbxxGx")
@AllArgsConstructor
@Api(tags = {"实有单位基本信息"})
public class VwSydwJbxxGxController {

    private VwSydwJbxxGxService vwSydwJbxxGxService;

    @GetMapping(value = "selectSydwList")
    @JwtSysUser
    @ApiOperation(value = "查询实有单位列表")
    public ResponseResult<IPage<VwSydwJbxxGx>> selectList(VwSydwJbxxGxQuery dto) {
        return ResponseResult.success(vwSydwJbxxGxService.selectList(dto));
    }

    @GetMapping(value = "getStatistics")
    @JwtSysUser
    @ApiOperation(value = "统计实有单位")
    public ResponseResult<List<Map<String,Object>>> getStatistics() {
        return ResponseResult.success(vwSydwJbxxGxService.getStatistics());
    }

    @GetMapping(value = "getSydwInfo/{id}")
    @JwtSysUser
    @ApiOperation(value = "查询实有单位详情")
    public ResponseResult<VwSydwJbxxGx> getSydwInfo(@PathVariable("id") String id) {
        return ResponseResult.success(vwSydwJbxxGxService.getSydwInfo(id));
    }

    @GetMapping(value = "getSydwCyryPage")
    @JwtSysUser
    @ApiOperation(value = "查询实有单位从业人员列表")
    public ResponseResult<IPage<VwSydwCyryGx>> getSydwCyryPage(VwSydwCyryPageQuery dto) {
        return ResponseResult.success(vwSydwJbxxGxService.getSydwCyryPage(dto));
    }
}

