package com.tofly.watermeter.custom.controller.meterBusiness;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.watermeter.custom.entity.meterBusiness.dto.TableQueryDto;
import com.tofly.watermeter.custom.service.meterBusiness.TableQueryService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@AllArgsConstructor
@RequestMapping("/tableQuery")
@Api(tags = "表务管理-水表使用情况改动")
public class TableQueryController {

    private final TableQueryService tableQueryService;

    /*
        @ApiImplicitParam(name = "code",value = "水表编号，0 入库  1 首检  2 出库  3 退表  4 安装  5 换表  6 移交",required = true,dataType = "string")
        @GetMapping("/lifeCycle")
        @ApiOperation("水表查询")
        public ResultRespone lifeCycle(String code){
            return ResultRespone.success(tableQueryService.lifeCycle(code));
        }
    */
    @GetMapping("/countDay")
    @ApiOperation("水表使用情况统计")
    public ResultRespone countDay(HttpServletResponse response, TableQueryDto dto) {
        return ResultRespone.success(tableQueryService.countDay(response, dto));
    }

    @GetMapping("/queryInfo")
    @ApiOperation("水表使用情况详情")
    public ResultRespone queryInfo(HttpServletResponse response, Page page, Long vendor, Long type, Long cal, Long export) {
        return ResultRespone.success(tableQueryService.queryInfo(response, page, vendor, type, cal, export));
    }

}
