소스 검색

fix:修改Api_pv1Controller中接口的的分页规则

Ciallo 8 달 전
부모
커밋
5104abcf2f

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_Pv1Controller.java

@@ -1,10 +1,9 @@
 package com.ruoyi.web.work.api;
 
 
-
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.web.work.api.config.BaseController;
-import com.ruoyi.web.work.domain.dto.Pv1MedicalRecord;
+import com.ruoyi.web.work.domain.Pv1;
 import com.ruoyi.web.work.service.IPv1Service;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 
+
 @Api(tags = "小程序住院信息管理")
 @RestController
 @RequestMapping("/app/pv1")
@@ -28,7 +28,7 @@ public class Api_Pv1Controller extends BaseController {
                                           @RequestParam("endTime") String endTime,
                                           @RequestParam("patientId") String patientId){
         startPage();
-        List<Pv1MedicalRecord> pv1List=ipv1Service.getMedicalRecord(beginTime,endTime,Long.parseLong(patientId));
+        List<Pv1> pv1List=ipv1Service.getMedicalRecord(beginTime,endTime,Long.parseLong(patientId));
         return getDataTable(pv1List);
     }
 

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/Pv1Mapper.java

@@ -20,5 +20,5 @@ public interface Pv1Mapper extends BaseMapper<Pv1> {
 
     List<PatientCardDto> getAllDepartment();
 
-    List<Pv1MedicalRecord> getMedicalRecord(@Param("beginTime") String beginTime,@Param("endTime")  String endTime,@Param("patientId")  Long patientId);
+    List<Pv1> getMedicalRecord(@Param("beginTime") String beginTime,@Param("endTime")  String endTime,@Param("patientId")  Long patientId);
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPv1Service.java

@@ -19,5 +19,5 @@ public interface IPv1Service extends IService<Pv1>{
 
     List<PatientCardDto> getAllDepartment();
 
-    List<Pv1MedicalRecord> getMedicalRecord(String beginTime, String endTime, Long patientId);
+    List<Pv1> getMedicalRecord(String beginTime, String endTime, Long patientId);
 }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/Pv1ServiceImpl.java

@@ -40,7 +40,7 @@ public class Pv1ServiceImpl extends ServiceImpl<Pv1Mapper, Pv1> implements IPv1S
     }
 
     @Override
-    public List<Pv1MedicalRecord> getMedicalRecord(String beginTime, String endTime, Long patientId) {
+    public List<Pv1> getMedicalRecord(String beginTime, String endTime, Long patientId) {
         return pv1Mapper.getMedicalRecord(beginTime,endTime,patientId);
     }
 

+ 10 - 6
ruoyi-admin/src/main/resources/mapper/work/Pv1Mapper.xml

@@ -63,13 +63,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-    <select id="getMedicalRecord" resultType="com.ruoyi.web.work.domain.dto.Pv1MedicalRecord">
-        SELECT tb_pv1.department,tb_pv1.admission_time,tb_pv1.discharge_time,tb_pv1.card_id
+    <select id="getMedicalRecord" resultType="com.ruoyi.web.work.domain.Pv1">
+        SELECT *
         FROM tb_pv1
-        where tb_pv1.patient_id=#{patientId}
-        <if test="beginTime !=null and beginTime!='' and endTime!=null and endTime!=''">
-                and  tb_pv1.admission_time BETWEEN #{beginTime} and #{endTime}
-        </if>
+        <where>
+            <if test="patientId!='' and patientId!=null"></if>
+                and tb_pv1.patient_id=#{patientId}
+            <if test="beginTime !=null and beginTime != '' and endTime != null and endTime != ''">
+                and  tb_pv1.admission_time BETWEEN #{beginTime} ANd #{endTime}
+            </if>
+        </where>
+
     </select>