package com.prolog.eis.service.inbound.impl;

import com.prolog.eis.dao.inbound.BizInboundTaskDetailMapper;
import com.prolog.eis.model.inbound.BizInboundTaskDetail;
import com.prolog.eis.service.inbound.BizInboundTaskDetailService;
import com.prolog.framework.core.restriction.Criteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class BizInboundTaskDetailServiceImpl implements BizInboundTaskDetailService {

    @Autowired
    private BizInboundTaskDetailMapper inboundTaskDetailMapper;

    @Override
    public List<BizInboundTaskDetail> findInBoundDetailByInboundId(Integer id) {
        Criteria criteria = Criteria.forClass(BizInboundTaskDetail.class);
        criteria.restrictionBuilder()
                .eq(BizInboundTaskDetail::getInboundId, id)
                .build();
        List<BizInboundTaskDetail> list = inboundTaskDetailMapper.findByCriteria(criteria);
        return list;
    }

    @Override
    public List<BizInboundTaskDetail> findByMap(Map<String, Object> inboundId) {
        return inboundTaskDetailMapper.findByMap(inboundId,BizInboundTaskDetail.class);
    }

    @Override
    public void deleteByMap(Map<String, Object> inboundId) {
        inboundTaskDetailMapper.deleteByMap(inboundId,BizInboundTaskDetail.class);
    }
}

