jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/DevRentController.java
@@ -138,11 +138,10 @@ @GetMapping("/get-latest-rent") @Operation(summary = "è·åæ£è 设å¤çæè¿ç§èµæ åµ") @Parameter(name = "dev-id", description = "设å¤ç¼å·", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") public CommonResult<DevRentRespVO> getLatestRent( @RequestParam("dev-id") String devId ) public CommonResult<DevRentRespVO> getLatestRent( @Valid DevRentSearchReqVO searchReqVO ) { DevRentDO devRent = devRentService.getLatestRent( devId ); DevRentDO devRent = devRentService.getLatestRent( searchReqVO ); return CommonResult.success(BeanUtils.toBean(devRent, DevRentRespVO.class)); } } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/devrent/vo/DevRentSearchReqVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,31 @@ package cn.lihu.jh.module.ecg.controller.admin.devrent.vo; import cn.lihu.jh.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDateTime; import static cn.lihu.jh.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @Schema(description = "管çåå° - è£ æºææºæ¥è¯¢ Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class DevRentSearchReqVO extends PageParam { @Schema(description = "设å¤ç¼å·", example = "3986") private String devId; @Schema(description = "æ£è ç¼å·", example = "4973") private String patId; @Schema(description = "æ£è åç§°", example = "èè¿") private String patName; @Schema(description = "åæ¶å®è£ ") private Integer cancelled; } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devrent/DevRentMapper.java
@@ -34,7 +34,6 @@ .orderByDesc(DevRentDO::getId)); } @Select("select * from lihu.dev_rent where dev_id=#{devId} order by rent_time desc limit 1") DevRentDO getLatestRent( @Param("devId") String devId ); DevRentDO getLatestRent(DevRentSearchReqVO reqVO ); } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentService.java
@@ -79,5 +79,5 @@ */ PageResult<DevRentDO> getDevRentPage(DevRentPageReqVO pageReqVO); DevRentDO getLatestRent(String devId); DevRentDO getLatestRent(DevRentSearchReqVO searchReqVO); } jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/devrent/DevRentServiceImpl.java
@@ -220,8 +220,8 @@ } @Override public DevRentDO getLatestRent(String devId) { return devRentMapper.getLatestRent(devId); public DevRentDO getLatestRent(DevRentSearchReqVO searchReqVO) { return devRentMapper.getLatestRent(searchReqVO); } } jh-module-ecg/jh-module-ecg-biz/src/main/resources/mapper/devrent/DevRentMapper.xml
@@ -9,4 +9,17 @@ ææ¡£å¯è§ï¼https://www.iocoder.cn/MyBatis/x-plugins/ --> <select id="getLatestRent" resultType="cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO"> select * from lihu.dev_rent <where> <if test="devId != null and devId != ''"> and dev_id = #{devId} </if> <if test="patId != null and patId != ''"> and pat_id = #{patId} </if> </where> order by rent_time desc limit 1 </select> </mapper>