Browse Source

医嘱信息中药品类型搜索

chengyao 4 năm trước cách đây
mục cha
commit
73554b247b
1 tập tin đã thay đổi với 12 bổ sung3 xóa
  1. 12 3
      src/main/resources/mapper/DoctorAdviceMapper.xml

+ 12 - 3
src/main/resources/mapper/DoctorAdviceMapper.xml

@@ -62,9 +62,18 @@
         <if test="doctorAdviceVO.hospitalId != null">
             and t.hospital_id = #{doctorAdviceVO.hospitalId}
         </if>
-        <if test="doctorAdviceVO.medicineType != null">
-            and t.medicine_type = #{doctorAdviceVO.medicineType}
-        </if>
+        <choose>
+            <when test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType ==0 "  >
+                and (t.medicine_type = "普药" or t.medicine_type = #{doctorAdviceVO.medicineType})
+            </when>
+            <when test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType ==1 "  >
+                and (t.medicine_type = "抗生素" or t.medicine_type = #{doctorAdviceVO.medicineType})
+            </when>
+            <when test="doctorAdviceVO.medicineType != null and doctorAdviceVO.medicineType ==2 "  >
+                and (t.medicine_type = "激素" or t.medicine_type = #{doctorAdviceVO.medicineType})
+            </when>
+        </choose>
+
         <if test="doctorAdviceVO.behospitalCode != null and doctorAdviceVO.behospitalCode != ''">
             and t.behospital_code = #{doctorAdviceVO.behospitalCode}
         </if>