This commit is contained in:
liuhongrui
2025-03-05 16:45:45 +08:00
parent b5a460b951
commit 4c1f703fb4
3 changed files with 20 additions and 15 deletions

View File

@@ -1,12 +1,11 @@
package com.openhis.web.patientmanage.controller;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
@@ -52,10 +51,14 @@ public class OutpatientRecordController {
* @param pageSize 每页大小默认为10
*/
@GetMapping("/outpatient-record-page")
public R<?> getPatient(@RequestParam(required = false) OutpatientRecordSearchParam outpatientRecordSearchParam,
public R<?> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
System.out.println("doctorName"+outpatientRecordSearchParam.getDoctorName());
System.out.println("phone"+outpatientRecordSearchParam.getPhone());
System.out.println("searchKey"+outpatientRecordSearchParam.getSearchKey());
// 跳过的记录数
Integer offset = (pageNo - 1) * pageSize;
// 连表查询患者信息

View File

@@ -25,9 +25,9 @@ public class OutpatientRecordSearchParam {
private String doctorName;
/** 筛选开始时间 */
private Date beginTime;
private String beginTime;
/** 筛选结束时间 */
private Date endTime;
private String endTime;
}

View File

@@ -139,13 +139,14 @@
<!-- 如果传入phone参数且不为空 -->
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.phone != null and OutpatientRecordSearchParam.phone != ''">
AND pt.phone LIKE CONCAT('%',#{phone}, '%')
AND pt.phone LIKE CONCAT('%',#{OutpatientRecordSearchParam.phone}, '%')
</if>
<!-- 时间筛选 -->
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.startTime != null and OutpatientRecordSearchParam.endTime != null">
AND e.start_time BETWEEN #{OutpatientRecordSearchParam.startTime} AND
#{OutpatientRecordSearchParam.endTime}
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.beginTime != null and OutpatientRecordSearchParam.endTime != null">
AND e.start_time BETWEEN
TO_TIMESTAMP(#{OutpatientRecordSearchParam.beginTime} || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS') AND
TO_TIMESTAMP(#{OutpatientRecordSearchParam.endTime} || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<!-- 如果传入doctorName参数且不为空 -->
@@ -184,13 +185,14 @@
<!-- 如果传入phone参数且不为空 -->
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.phone != null and OutpatientRecordSearchParam.phone != ''">
AND pt.phone LIKE CONCAT('%',#{phone}, '%')
AND pt.phone LIKE CONCAT('%',#{OutpatientRecordSearchParam.phone}, '%')
</if>
<!-- 时间筛选 -->
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.startTime != null and OutpatientRecordSearchParam.endTime != null">
AND e.start_time BETWEEN #{OutpatientRecordSearchParam.startTime} AND
#{OutpatientRecordSearchParam.endTime}
<if test="OutpatientRecordSearchParam != null and OutpatientRecordSearchParam.beginTime != null and OutpatientRecordSearchParam.endTime != null">
AND e.start_time BETWEEN
TO_TIMESTAMP(#{OutpatientRecordSearchParam.beginTime} || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS') AND
TO_TIMESTAMP(#{OutpatientRecordSearchParam.endTime} || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<!-- 如果传入doctorName参数且不为空 -->