package com.mosty.hczx.service.Impl;

import com.mosty.base.model.query.hczx.TbHcBpcRCCountQuery;
import com.mosty.base.model.vo.hczx.TbHcBpcRCCountVO;
import com.mosty.hczx.service.TbHcBpcclService;
import com.mosty.hczx.service.TbHcBpcryService;
import com.mosty.hczx.service.TbHcCountService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 核查中心核查统计Service实现类
 */
@Service
@AllArgsConstructor
public class TbHcCountServiceImpl implements TbHcCountService {

    /**
     * 被盘查车辆Service
     */
    private final TbHcBpcclService tbHcBpcclService;

    /**
     * 被盘查人员Service
     */
    private final TbHcBpcryService tbHcBpcryService;

    @Override
    public TbHcBpcRCCountVO selectRCCount(TbHcBpcRCCountQuery query) {
        Integer clCount = tbHcBpcclService.selectCarCount(query.getSsbmdm(), query.getIsChild());
        Integer ryCount = tbHcBpcryService.selectCrewCount(query.getSsbmdm(), query.getIsChild());
        TbHcBpcRCCountVO vo = new TbHcBpcRCCountVO();
        vo.setBpcclCount(clCount == null ? 0 : clCount);
        vo.setBpcryCount(ryCount == null ? 0 : ryCount);
        return vo;
    }




}
