package thyyxxk.webserver.service.zhuyuanyiji;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import thyyxxk.webserver.dao.his.zhuyuanyiji.PatientFee;
import thyyxxk.webserver.entity.yiji.YzZyPatientFeeData;

import java.util.List;
import java.util.Set;

@Service
@RequiredArgsConstructor
public class YzPatientFeeToDetailCharge {
    private final PatientFee dao;

    @Data
    public static class FeePatient {
        private String patNo;
        private String times;
    }

    public void init(Set<FeePatient> patients) {
        if (patients == null || patients.isEmpty()) {
            return;
        }
        for (FeePatient patient : patients) {
            run(patient);
        }
    }

    public void run(FeePatient patient) {
        LambdaQueryWrapper<YzZyPatientFeeData> qw = YzZyPatientFeeData.lambdaQueryWrapper();
        qw.eq(YzZyPatientFeeData::getInpatientNo, patient.getPatNo());
        qw.eq(YzZyPatientFeeData::getAdmissTimes, patient.getTimes());
        qw.eq(YzZyPatientFeeData::getChargeStatus, "1");
        List<YzZyPatientFeeData> yzZyPatientFeeData = dao.selectList(qw);
    }

}
