package com.sw.mes.fb.aio.service.impl;

import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.fb.aio.dao.AioCheckSectionStateDao;
import com.sw.mes.fb.aio.entity.AioCheckSectionState;
import com.sw.mes.fb.aio.service.AioCheckSectionStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Service
@Transactional
public class AioCheckSectionStateServiceImpl extends BaseServiceImpl<AioCheckSectionState> implements AioCheckSectionStateService {

    AioCheckSectionStateDao dao;

    @Autowired
    public void setDao(AioCheckSectionStateDao dao) {
        super.setBaseDao(dao);
        this.dao = dao;
    }

    @Override
    public AioCheckSectionState findBySectionNoGroup(String sectionNo) {
        List<AioCheckSectionState> states = dao.findBySectionNoGroup(sectionNo);
        if (states != null && states.size() > 0) {
            return states.get(0);
        }
        return null;
    }

    @Override
    public AioCheckSectionState findBySectionNo(String sectionNo) {
        List<AioCheckSectionState> sectionStates = dao.findBySectionNo(sectionNo);
        if (sectionStates != null && sectionStates.size() > 0) {
            return sectionStates.get(0);
        }
        return null;
    }



}
