package thyyxxk.webserver.dao.his.reports;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.reports.infantfee.GetInfantFeeParam;
import thyyxxk.webserver.entity.reports.infantfee.InfantFee;

import java.util.List;

@Mapper
public interface InfantFeeReportDao {
    @Select("select a.inpatient_no as inpatient_no, " +
            "c.name as name,a.admiss_times as admiss_times, " +
            "sum(a.charge_fee) as charge " +
            "from zy_detail_charge a,zy_ledger_file b,a_patient_mi c " +
            "where a.infant_flag='1' " +
            "and b.inpatient_no=a.inpatient_no " +
            "and b.admiss_times=a.admiss_times " +
            "and b.account_date>=#{start} " +
            "and b.account_date<#{end} " +
            "and a.inpatient_no=c.inpatient_no " +
            "group by a.inpatient_no,c.name,a.admiss_times")
    List<InfantFee> getInfantCharge(GetInfantFeeParam param);
}
