yxh
昨天 fce96ef468291fb9a0e6a4d34ab371315e9485d4
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
@@ -48,7 +48,7 @@
            "  <if test=\"patId != null and patId != ''\"> " +
            "    and pat_id = #{patId} " +
            "  </if> " +
            "  <if test=\"checkType != null and checkType != ''\"> " +
            "  <if test=\"checkType != null \"> " +
            "    and check_type = #{checkType} " +
            "  </if> " +
            "</where> " +
@@ -74,4 +74,23 @@
    @Update("update lihu.dev_rent set paid = #{paid} where id = #{rentId};")
    Integer setPaid(@Param("rentId") Long rentId, @Param("paid") Integer paid);
    /**
     * 【需求1】按 id 批量取「id + apply_no」。
     * <p>
     * 用途:作业记录列表页回填患者信息时需要 `job_record.rentId → dev_rent.applyNo`。
     * 原先用 {@code selectById} 逐条取(N 次查询),本方法改为一次 IN 查询。
     * <p>
     * 刻意**只取两列**而非 `SELECT *`:dev_rent 含 `pat_details` 等 JSON 大字段,
     * 回填只需 applyNo,没必要把整个 DO 拉回来。
     *
     * @param rentIdList 租赁 id 列表(调用方需保证非空,MySQL 的 IN () 会语法错误)
     */
    @Select("<script>" +
            "SELECT id, apply_no FROM lihu.dev_rent WHERE id IN (" +
            " <foreach collection='rentIdList' separator=',' item='rentId'>" +
            "  #{rentId} " +
            " </foreach> )" +
            "</script>")
    List<DevRentDO> getApplyNoByIdList(@Param("rentIdList") List<Long> rentIdList);
}