package com.boman.web.core.service.vaccineInfo.impl;

import com.boman.common.core.utils.StringUtils;
import com.boman.web.core.domain.VaccineInfoUser;
import com.boman.web.core.mapper.VaccineInfoUserMapper;
import com.boman.web.core.service.vaccineInfo.IVaccineInfoUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author tjf
 * @Date: 2021/09/07/9:57
 */
@Service
public class VaccineInfoUserServiceImpl implements IVaccineInfoUserService {
    @Resource
    private VaccineInfoUserMapper vaccineInfoUserMapper;

    /**
     * 批量删除用户接种疫苗信息
     *
     * @param ids 需要删除的用户接种疫苗信息ID
     * @return
     */
    @Override
    public int deleteVaccineInfoUserByIds(Long[] ids) {
        return vaccineInfoUserMapper.deleteVaccineInfoUserByIds(ids);
    }

    /**
     * 根据身份证号查询用户疫苗信息集合
     * @param vaccineInfoUser
     * @return
     */
    @Override
    public List<VaccineInfoUser> selectInfoUserByIdCard(VaccineInfoUser vaccineInfoUser) {
        String idCard = vaccineInfoUser.getIdCard();
        List<VaccineInfoUser> list  = new ArrayList();
        if (StringUtils.isNotBlank(idCard)){
            list = vaccineInfoUserMapper.selectVaccineInfoUserByIdCard(idCard.trim());
        }
        return list;
    }
}
