Procházet zdrojové kódy

医嘱信息中药品类型搜索

chengyao před 4 roky
rodič
revize
73554b247b
1 změnil soubory, kde provedl 12 přidání a 3 odebrání
  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>