package com.xueyi.system.resource.manager.impl;

import com.xueyi.common.web.entity.manager.impl.BaseManagerImpl;
import com.xueyi.system.resource.domain.dto.DmScreenOffDto;
import com.xueyi.system.resource.domain.model.DmResourcesConverter;
import com.xueyi.system.resource.domain.model.DmScreenOffConverter;
import com.xueyi.system.resource.domain.po.DmScreenOffPo;
import com.xueyi.system.resource.domain.query.DmScreenOffQuery;
import com.xueyi.system.resource.manager.IDmScreenOffManager;
import com.xueyi.system.resource.mapper.DmResourcesMapper;
import com.xueyi.system.resource.mapper.DmScreenOffMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 人员人脸特征值管理 数据封装层处理
 *
 * @author xueyi
 */
@Component
public class DmScreenOffManager extends BaseManagerImpl<DmScreenOffQuery, DmScreenOffDto, DmScreenOffPo, DmScreenOffMapper, DmScreenOffConverter> implements IDmScreenOffManager {

    @Autowired
    DmScreenOffMapper screenOffMapper;

    @Autowired
    DmResourcesMapper resourcesMapper;

    @Autowired
    DmResourcesConverter resourcesConverter;

    @Override
    public List<DmScreenOffDto> selectList(DmScreenOffQuery query) {
        List<DmScreenOffDto> screenOffDtos = super.selectList(query);
        screenOffDtos.forEach(item->item.setResourcesDto(resourcesConverter.mapperDto(resourcesMapper.selectById(item.getResourceId()))));

        return screenOffDtos;
    }


}