package com.mosty.base.manager.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.manager.service.VwSyrkJzgjGxService;
import com.mosty.base.model.entity.afjcsj.VwSydwCyryGx;
import com.mosty.base.model.entity.afjcsj.VwSyrkJzgjGx;
import com.mosty.base.model.query.afjcsj.VwSydwJbxxGxQuery;
import com.mosty.base.model.entity.afjcsj.VwSydwJbxxGx;
import com.mosty.base.model.query.afjcsj.VwSyrkJzgjGxListQuery;
import com.mosty.base.model.query.afjcsj.VwSyrkJzgjGxQuery;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @author dw
 * @since 2022-10-27
 */
@RestController
@RequestMapping("/vwSyrkJzgjGx")
@AllArgsConstructor
@Api(tags = {"实有人口-居住轨迹接口信息表"})
public class VwSyrkJzgjGxController {

    private VwSyrkJzgjGxService vwSyrkJzgjGxService;

    @GetMapping(value = "selectPageList")
    @JwtSysUser
    @ApiOperation(value = "查询实有人口列表")
    public ResponseResult<IPage<VwSyrkJzgjGx>> selectPageList(VwSyrkJzgjGxQuery dto) {
        return ResponseResult.success(this.vwSyrkJzgjGxService.selectPageList(dto));
    }

    @GetMapping(value = "selectGjList")
    @JwtSysUser
    @ApiOperation(value = "查询实有人口居住轨迹")
    public ResponseResult<IPage<VwSyrkJzgjGx>> selectGjList(VwSyrkJzgjGxListQuery dto) {
        return ResponseResult.success(this.vwSyrkJzgjGxService.selectGjList(dto));
    }

    @GetMapping(value = "getStatistics")
    @JwtSysUser
    @ApiOperation(value = "统计实有人口数据")
    public ResponseResult<List<Map<String, Object>>> getStatistics() {
        return ResponseResult.success(this.vwSyrkJzgjGxService.getStatistics());
    }

    @GetMapping(value = "getSyrkCygj/{zjhm}")
    @JwtSysUser
    @ApiOperation(value = "查询实有人口从业轨迹")
    public ResponseResult<List<VwSydwCyryGx>> getSyrkCygj(@PathVariable("zjhm") String zjhm) {
        return ResponseResult.success(this.vwSyrkJzgjGxService.getSyrkCygj(zjhm));
    }

    @GetMapping(value = "getSyrkInfo/{id}")
    @JwtSysUser
    @ApiOperation(value = "查询实有人口详情")
    public ResponseResult<VwSydwCyryGx> getSyrkInfo(@PathVariable("id") String id) {
        return ResponseResult.success(this.vwSyrkJzgjGxService.getSyrkInfo(id));
    }
}

