| | |
| | | </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`, |
| | |
| | | `service_donationwitness`.`coordinator_in_operating` AS `coordinatorInOperating`, |
| | | `service_donationwitness`.`coordinator_out_operating` AS `coordinatorOutOperating`, |
| | | `service_donationwitness`.`coordinator_sign` AS `coordinatorSign`, |
| | | `service_donationwitness`.`coordinator_sign_time` AS `coordinatorSignTime` |
| | | `service_donationwitness`.`coordinator_sign_time` AS `coordinatorSignTime`, |
| | | `service_donationwitness`.`donate_hospital` AS `donate_hospital` |
| | | FROM |
| | | `service_donatebaseinfo` |