package com.ruoyi.project.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.sql.Time; import java.util.Collection; import java.util.List; import com.ruoyi.project.domain.ServiceDonateorgan; import com.ruoyi.project.domain.ServiceDonationwitness; import com.ruoyi.project.domain.vo.DonationWitnessVO; import com.ruoyi.project.domain.vo.TimeVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * 捐献见证Mapper接口 * * @author ruoyi * @date 2021-11-17 */ @Mapper public interface ServiceDonationwitnessMapper extends BaseMapper { /** * 查询捐献见证列表 * * @param serviceDonationwitness 捐献见证 * @return 捐献见证集合 */ public List selectServiceDonationwitnessList(ServiceDonationwitness serviceDonationwitness); /** * 一次性查出全部「捐献基础ID -> 死亡时间」对应关系。 * * 用于列表页计算年龄:原实现在记录循环里按 InfoID 逐条查询见证表(N+1), * 首页/列表有多少条记录就会发多少次 SQL。改为一次查询后在内存中匹配。 * 只取 InfoID 与 DeathTime 两列,避免拉取整行宽表数据。 * * @param infoIds 需要查询的捐献基础ID集合;为空时查全部 * @return 仅含 infoid 与 deathtime 的列表 */ List selectDeathTimeByInfoIds(@Param("infoIds") Collection infoIds); List getWitnessList(); List selectVOList(DonationWitnessVO donationWitnessVO); int getDBDDonaterNumberThisYear(TimeVO timeVO); int getDCDDonaterNumberThisYear(TimeVO timeVO); int getDBCDDonaterNumberThisYear(TimeVO timeVO); String getDonationCategoryByInfoId(Long infoId); Integer countNumber(TimeVO timeVO); ServiceDonationwitness selectByInfoId(Long infoid); List getAllDonatePeople(); int countThisYearByTime(TimeVO timeVO); List getAllDonatePeopleByTime(TimeVO timeVO); List selectByTime(TimeVO timeVO); }