소스 검색

精准查询改为模糊查询

lighter 3 달 전
부모
커밋
8ddfbbe835

+ 2 - 2
src/main/java/thyyxxk/webserver/dao/his/inpatient/charge/ForceInAndOutDao.java

@@ -18,14 +18,14 @@ public interface ForceInAndOutDao {
     @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,rtrim(name) as name," +
             "admiss_date as admDate,med_type,dis_date,rtrim(bed_status) as bedStatus," +
             "rtrim(ward) as ward,rtrim(zk_ward) as dept,rtrim(bed_no) as bedNo " +
-            "from zy_inactpatient where inpatient_no=#{input} or name=#{input} " +
+            "from zy_inactpatient where inpatient_no like #{input} or name like #{input} " +
             "order by inpatient_no,dis_date desc")
     List<SimplePatient> getZyInactpatient(String input);
 
     @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,rtrim(name) as name," +
             "admiss_date as admDate,med_type,dis_date,rtrim(bed_status) as bedStatus," +
             "rtrim(ward) as ward,rtrim(zk_ward) as dept,rtrim(bed_no) as bedNo " +
-            "from zy_actpatient where inpatient_no=#{input} or name=#{input} ")
+            "from zy_actpatient where inpatient_no like #{input} or name like #{input} ")
     List<SimplePatient> getZyActpatient(String input);
 
     @Insert("insert into zy_work_log(inpatient_no,admiss_times,ledger_sn," +

+ 2 - 0
src/main/java/thyyxxk/webserver/service/inpatient/charge/ForceInAndOutService.java

@@ -47,6 +47,8 @@ public class ForceInAndOutService {
 
     public List<SimplePatient> getActpatient(PatInquiry inquiry) {
         List<SimplePatient> list;
+        String input = inquiry.getUserInput() + "%";
+        inquiry.setUserInput(input);
         if (inquiry.getPatStatus() == PatInquiry.PatStatus.IN_HOSPITAL) {
             list = dao.getZyActpatient(inquiry.getUserInput());
         } else {