package cn.hnthyy.thmz.service.impl.his;

import cn.hnthyy.thmz.entity.his.MzPatientMi;
import cn.hnthyy.thmz.mapper.his.MzPatientMiMapper;
import cn.hnthyy.thmz.service.his.MzPatientMiService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MzPatientMiServiceImpl implements MzPatientMiService {
    @SuppressWarnings("all")
    @Autowired
    private MzPatientMiMapper mzPatientMiMapper;
    @Override
    public MzPatientMi queryByIcCardNo(String icCardNo) {
        return mzPatientMiMapper.selectByIcCardNo(icCardNo);
    }

    @Override
    public List<MzPatientMi> queryByNameFuzzy(String name,Integer pageIndex,Integer pageSize) {
        if (StringUtils.isNotBlank(name)){
            name="%"+name+"%";
        }
        return mzPatientMiMapper.selectByNameFuzzy(name,pageIndex,pageSize);
    }

    @Override
    public MzPatientMi queryByPatientId(String patientId) {
        return mzPatientMiMapper.selectByPatientId(patientId);
    }
}
