package com.sw.mes.yb.check.service.impl;


import com.sw.mes.core.base.BaseServiceImpl;
import com.sw.mes.yb.check.dao.ZhxxOperatePieceCheckDao;
import com.sw.mes.yb.check.entity.ZhxxOperatePieceCheck;
import com.sw.mes.yb.check.service.ZhxxOperatePieceCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author JS111801
* @description 针对表【zhxx_operate_piece_check(【圆棒生产域—检验数据】样片检验【新】)】的数据库操作Service实现
* @createDate 2023-11-01 09:48:55
*/
@Service
public class ZhxxOperatePieceCheckServiceImpl extends BaseServiceImpl<ZhxxOperatePieceCheck>
    implements ZhxxOperatePieceCheckService{


    ZhxxOperatePieceCheckDao zhxxOperatePieceCheckDao;

    @Autowired
    public void setDao(ZhxxOperatePieceCheckDao zhxxOperatePieceCheckDao){
        this.zhxxOperatePieceCheckDao = zhxxOperatePieceCheckDao;
        super.setBaseDao(zhxxOperatePieceCheckDao);
    }


    @Override
    public List<ZhxxOperatePieceCheck> pullAllNewRecord() {
        return zhxxOperatePieceCheckDao.pullAllNewRecordFromTable();
    }

    @Override
    public List<ZhxxOperatePieceCheck> pullAllNewRecordGroupByPieceNo() {
        return zhxxOperatePieceCheckDao.pullAllNewRecordFromTableGroup();
    }

    @Override
    public ZhxxOperatePieceCheck findByPieceNo(String pieceNo) {
        List<ZhxxOperatePieceCheck> byPieceNo = zhxxOperatePieceCheckDao.findByPieceNo(pieceNo);
        if (null != byPieceNo && byPieceNo.size()>0){
            return byPieceNo.get(0);
        }
        return null;
    }

    @Override
    public void updateStateForPiece(Long id) {
        zhxxOperatePieceCheckDao.updateStateForPiece(id);
    }

    @Override
    public void updateStateForPieceBatch(List<Long> ids) {
        zhxxOperatePieceCheckDao.updateStateForPieceBatch(ids);
    }
}




