Browse Source

获取病历核查分页接口修改

zhanghang 3 năm trước cách đây
mục cha
commit
d9435d96ca

+ 5 - 2
src/main/java/com/diagbot/vo/GetCheckRecordPageVO.java

@@ -37,8 +37,11 @@ public class GetCheckRecordPageVO extends Page implements Serializable {
     @ApiModelProperty(value = "科室名称")
     private String deptName;
 
-    @ApiModelProperty(value = "住院天数")
-    private String hospitalizationDays;
+    @ApiModelProperty(value = "住院开始天数")
+    private Long hospitalizationDaysStart;
+
+    @ApiModelProperty(value = "住院结束天数")
+    private Long hospitalizationDaysEnd;
 
     @ApiModelProperty(value = "医生姓名")
     private String doctorName;

+ 30 - 28
src/main/resources/mapper/CheckRecordMapper.xml

@@ -44,6 +44,7 @@
         mbi.director_doctor_name directorDoctorName,
         mbi.diagnose,
         mbt.behospital_type behospitalType,
+        mbi.is_placefile,
         mqc.`level`
         FROM
         (
@@ -71,11 +72,11 @@
         SELECT * from
         med_check_record mc
         where
-         mc.is_deleted = 'N'
-        <if test="getCheckRecordPagevo.jobDistributionTimeStart != null and getCheckRecordPagevo.jobDistributionTimeStart != ''">
+        mc.is_deleted = 'N'
+        <if test="getCheckRecordPagevo.jobDistributionTimeStart != null ">
             <![CDATA[ and mc.job_distribution_time >= #{getCheckRecordPagevo.jobDistributionTimeStart}]]>
         </if>
-        <if test="getCheckRecordPagevo.jobDistributionTimeEnd != null and getCheckRecordPagevo.jobDistributionTimeEnd != ''">
+        <if test="getCheckRecordPagevo.jobDistributionTimeEnd != null ">
             <![CDATA[ and mc.job_distribution_time <= #{getCheckRecordPagevo.jobDistributionTimeEnd}]]>
         </if>
         <if test="getCheckRecordPagevo.behospitalCode != null and getCheckRecordPagevo.behospitalCode != ''">
@@ -92,35 +93,19 @@
         AND mcre.is_deleted = 'N'
         ) t1 LEFT JOIN med_behospital_info mbi on t1.behospitalCode=mbi.behospital_code
         and mbi.is_deleted='N'
-        <if test="getCheckRecordPagevo.name != null and getCheckRecordPagevo.name!=''">
-            AND mbi.name like concat('%', #{getCheckRecordPagevo.name}, '%')
-        </if>
-        <if test="getCheckRecordPagevo.isPlacefile != null and getCheckRecordPagevo.isPlacefile!=''">
-            AND mbi.is_placefile = #{getCheckRecordPagevo.isPlacefile}
-        </if>
-        <if test="getCheckRecordPagevo.recordType != null and getCheckRecordPagevo.recordType!=''">
-            AND t1.behospital_type = #{getCheckRecordPagevo.recordType}
-        </if>
-        <if test="getCheckRecordPagevo.status != null and getCheckRecordPagevo.status!=''">
-            AND t1.status = #{getCheckRecordPagevo.status}
-        </if>
-        <if test="getCheckRecordPagevo.level != null and getCheckRecordPagevo.level!=''">
-            AND t1.level = #{getCheckRecordPagevo.level}
-        </if>
-        <if test="getCheckRecordPagevo.deptName != null and getCheckRecordPagevo.deptName != ''">
-            AND t1.beh_dept_name = #{getCheckRecordPagevo.deptName}
-        </if>
         LEFT JOIN med_behospital_type mbt on t1.behospitalCode=mbt.behospital_code
         and mbt.is_deleted='N'
         LEFT JOIN med_qcresult_info mqc on t1.behospitalCode=mqc.behospital_code
         and mqc.is_deleted='N'
-
-        )t2 LEFT JOIN med_home_page mhp on t2.behospitalCode=mhp.behospital_code
-        <if test="getCheckRecordPagevo.hospitalizationDays != null and getCheckRecordPagevo.hospitalizationDays != ''">
-            <![CDATA[ and t2.days <= #{getCheckRecordPagevo.hospitalizationDays}]]>
+        )t2 ,
+        med_home_page mhp
+        where
+        t2.behospitalCode=mhp.behospital_code
+        <if test="getCheckRecordPagevo.hospitalizationDaysEnd != null and getCheckRecordPagevo.hospitalizationDaysEnd != ''">
+            <![CDATA[ and t2.hospitalizationDays <= #{getCheckRecordPagevo.hospitalizationDaysEnd}]]>
         </if>
-        <if test="getCheckRecordPagevo.hospitalizationDays != null and getCheckRecordPagevo.hospitalizationDays != ''">
-            <![CDATA[ and t2.days >= #{getCheckRecordPagevo.hospitalizationDays}]]>
+        <if test="getCheckRecordPagevo.hospitalizationDaysStart != null and getCheckRecordPagevo.hospitalizationDaysStart != ''">
+            <![CDATA[ and t2.hospitalizationDays >= #{getCheckRecordPagevo.hospitalizationDaysStart}]]>
         </if>
         <if test="getCheckRecordPagevo.doctorName != null and getCheckRecordPagevo.doctorName != ''">
             AND t2.directorDoctorName like concat('%', #{getCheckRecordPagevo.doctorName}, '%')
@@ -128,7 +113,24 @@
         <if test="getCheckRecordPagevo.diagnoseName != null and getCheckRecordPagevo.diagnoseName != ''">
             AND t2.diagnose like concat('%', #{getCheckRecordPagevo.diagnoseName}, '%')
         </if>
-
+        <if test="getCheckRecordPagevo.name != null and getCheckRecordPagevo.name!=''">
+            AND t2.name like concat('%', #{getCheckRecordPagevo.name}, '%')
+        </if>
+        <if test="getCheckRecordPagevo.isPlacefile != null and getCheckRecordPagevo.isPlacefile!=''">
+            AND t2.is_placefile = #{getCheckRecordPagevo.isPlacefile}
+        </if>
+        <if test="getCheckRecordPagevo.deptName != null and getCheckRecordPagevo.deptName != ''">
+            AND t2.behDeptName = #{getCheckRecordPagevo.deptName}
+        </if>
+        <if test="getCheckRecordPagevo.level != null and getCheckRecordPagevo.level!=''">
+            AND t2.level = #{getCheckRecordPagevo.level}
+        </if>
+        <if test="getCheckRecordPagevo.recordType != null and getCheckRecordPagevo.recordType!=''">
+            AND t2.behospitalType = #{getCheckRecordPagevo.recordType}
+        </if>
+        <if test="getCheckRecordPagevo.status != null and getCheckRecordPagevo.status!=''">
+            AND t2.status = #{getCheckRecordPagevo.status}
+        </if>
     </select>
 
 </mapper>