package com.xinelu.manage.controller.evaluateresult;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.service.evaluateresult.EvaluateResultService;
import com.xinelu.manage.vo.evaluateresult.EvaluateResultVo;
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 javax.annotation.Resource;
import java.util.List;

/**
 * 筛查结果统计
 */
@RestController
@RequestMapping("/system/evaluateResult")
public class EvaluateResultController extends BaseController {

    @Resource
    private EvaluateResultService evaluateResultService;

    /**
     * 根据年龄端性别统计筛查结果
     * @param age
     * @param sex
     * @return
     */
    @GetMapping("/list/{age}/{sex}")
    public AjaxResult list(@PathVariable("age") String age, @PathVariable("sex")String sex) {
        String[] split = age.split("-");
        String ageA = split[0];
        String ageB = split[1];
        List<EvaluateResultVo> list = evaluateResultService.list(ageA,ageB,sex);
        return AjaxResult.success(list);
    }
}
