diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java index c30c9bd9..2c484030 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java @@ -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; // 连表查询患者信息 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java index 4ff8c830..09674301 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java @@ -25,9 +25,9 @@ public class OutpatientRecordSearchParam { private String doctorName; /** 筛选开始时间 */ - private Date beginTime; + private String beginTime; /** 筛选结束时间 */ - private Date endTime; + private String endTime; } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml index 59f9b2d5..852b13d1 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml @@ -139,13 +139,14 @@ - AND pt.phone LIKE CONCAT('%',#{phone}, '%') + AND pt.phone LIKE CONCAT('%',#{OutpatientRecordSearchParam.phone}, '%') - - AND e.start_time BETWEEN #{OutpatientRecordSearchParam.startTime} AND - #{OutpatientRecordSearchParam.endTime} + + 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') @@ -184,13 +185,14 @@ - AND pt.phone LIKE CONCAT('%',#{phone}, '%') + AND pt.phone LIKE CONCAT('%',#{OutpatientRecordSearchParam.phone}, '%') - - AND e.start_time BETWEEN #{OutpatientRecordSearchParam.startTime} AND - #{OutpatientRecordSearchParam.endTime} + + 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')