package org.diagbot.nlp.service.impl;

import org.diagbot.nlp.dao.mapper.InfoMapper;
import org.diagbot.nlp.dao.model.Info;
import org.diagbot.nlp.dao.model.wrapper.InfoWrapper;
import org.diagbot.nlp.service.InfoService;
import org.diagbot.pub.service.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InfoServiceImpl extends BaseServiceImpl<Info, InfoWrapper, Long> implements InfoService {
    @Autowired
    InfoMapper infoMapper;

    @Autowired
    private void setEntityMapper() {
        super.setEntityMapper(infoMapper);
    }

    public void updateInfos(List<Info> infos) {
        for (Info info : infos) {
            infoMapper.updateByPrimaryKeySelective(info);
        }
    }
}
