Jelajahi Sumber

查询评分接口优化2

wangfeng 5 tahun lalu
induk
melakukan
dca8b40e4a

+ 2 - 0
src/main/java/com/diagbot/vo/BehospitalPageVO.java

@@ -78,4 +78,6 @@ public class BehospitalPageVO extends Page implements Serializable {
 
     @ApiModelProperty(hidden = true)
     private Long userId;
+
+    private Long doctorCode;
 }

+ 13 - 3
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -54,6 +54,11 @@
         <if test="name != null and name != ''">
             and t.name like CONCAT('%',#{name},'%')
         </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and t.doctor_id = #{doctorCode}
+            or t.beh_doctor_id = #{doctorCode}
+            or t.director_doctor_id = #{doctorCode}
+        </if>
         <if test="fileCode != null and fileCode != ''">
             and t.file_code like CONCAT('%',#{fileCode},'%')
         </if>
@@ -78,7 +83,7 @@
         <if test="level != null and level != ''">
             and t.level = #{level}
         </if>
-        order by t.behospital_date desc
+
     </select>
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
@@ -356,6 +361,11 @@
         <if test="doctorName != null and doctorName != ''">
             and CONCAT( IFNULL(t.doctor_name,''),IFNULL(t.beh_doctor_name,''),IFNULL(t.director_doctor_name,'')) like CONCAT('%',#{doctorName},'%')
         </if>
+        <if test="doctorCode != null and doctorCode != ''">
+            and t.doctor_id = #{doctorCode}
+            or t.beh_doctor_id = #{doctorCode}
+            or t.director_doctor_id = #{doctorCode}
+        </if>
         <if test="name != null and name != ''">
             and t.name like CONCAT('%',#{name},'%')
         </if>
@@ -383,7 +393,7 @@
         <if test="level != null and level != ''">
             and t.level = #{level}
         </if>
-        order by t.behospital_date desc
+
     </select>
     <select id="getPageByPerson" resultType="com.diagbot.dto.BehospitalInfoDTO">
         select * from (SELECT
@@ -448,7 +458,7 @@
         <if test="level != null and level != ''">
             and t.level = #{level}
         </if>
-        order by t.behospital_date desc
+
     </select>
 
 </mapper>