package cn.com.victorysoft.business.cyyzs.controller;

import cn.com.victorysoft.business.cyyzs.entity.FailureReason;
import cn.com.victorysoft.business.cyyzs.entity.FailureReasonDetails;
import cn.com.victorysoft.business.cyyzs.entity.TubularStructure;
import cn.com.victorysoft.business.cyyzs.entity.TubularStructureHome;
import cn.com.victorysoft.business.cyyzs.service.FailureReasonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @Author TY
 * @Date: 2022/10/11 15:19
 */
@Api(tags = "现场作业跟踪失效原因")
@RestController
@RequestMapping("cyyzs/failure-reason")
public class FailureReasonController {

    @Autowired
    private FailureReasonService failureReasonService;

    @GetMapping()
    public List<FailureReason> selectList(String yclx, String dwdm, String dydm, String gylx, String type) {
        return failureReasonService.selectList(yclx, dwdm, dydm, gylx, type);
    }

    @GetMapping("details")
    public List<FailureReasonDetails> selectDetails(String yclx, String dwdm, String dydm, String jh, String gylx) {
        return failureReasonService.selectDetails(yclx, dwdm, dydm, jh, gylx);
    }

    @GetMapping("bar-data")
    public Map<String, Object> getBarData(String yclx, String dwdm, String dydm, String gylx) {
        return failureReasonService.getBarData(yclx, dwdm, dydm, gylx);
    }

    @GetMapping("pie-data")
    public List<Map<String, Object>> getPieData(String yclx, String dwdm, String dydm, String gylx) {
        return failureReasonService.getPieData(yclx, dwdm, dydm, gylx);
    }


}
