sinake
2 天以前 a19fd2396876e21fdc2ba2f4d5e60755f116132d
ruoyi-project/src/main/resources/mapper/project/ServiceDonationwitnessMapper.xml
@@ -111,6 +111,23 @@
        </where>
    </select>
    <!--
      批量查询「捐献基础ID -> 死亡时间」,供列表页计算年龄使用。
      代替原先在记录循环中按 InfoID 逐条查询的 N+1 写法(首页有 N 条记录就发 N 次 SQL)。
      只返回 InfoID 与 DeathTime 两列;Infoid 与 DeathTime 均为空的行无意义,直接过滤,
      同时避免与 selectServiceDonationwitnessList 返回的行数不一致。
    -->
    <select id="selectDeathTimeByInfoIds" resultMap="ServiceDonationwitnessResult">
        select InfoID, DeathTime from service_donationwitness
        where InfoID is not null and DeathTime is not null
        <if test="infoIds != null and infoIds.size() > 0">
            and InfoID in
            <foreach collection="infoIds" item="infoId" open="(" separator="," close=")">
                #{infoId}
            </foreach>
        </if>
    </select>
    <select id="selectVOList" resultType="com.ruoyi.project.domain.vo.DonationWitnessVO">
        SELECT
        `service_donatebaseinfo`.`ID` AS `ID`,