Browse Source

sql问题

lighter 2 năm trước cách đây
mục cha
commit
433e0725dd

+ 4 - 4
src/main/java/thyyxxk/webserver/dao/his/api/forpowersi/drgdip/DrgDipDao.java

@@ -58,7 +58,7 @@ public interface DrgDipDao {
             "icdCode=b.dise_code, " +
             "isSpecial=case when a.med_type='14' then 'Y' else 'N' end " +
             "from t_si_setlinfo a with(nolock), t_si_pat_info b with(nolock) " +
-            "where a.setl_type=11 and a.mdtrt_id=b.mdtrt_id) t where " +
+            "where a.setl_type=11 and a.revoked=0 and a.mdtrt_id=b.mdtrt_id) t where " +
             "t.idx>#{page}*#{size} and t.idx<=(#{page}+1)*#{size}")
     List<HisOutpSettlData> selectHisOutpSettlData(int page, int size);
 
@@ -438,12 +438,12 @@ public interface DrgDipDao {
     List<YibaoN041SurgeryItem> selectYibaoN041Surgeries(String patNo, int times);
 
 
-    @Select("select setl_id from t_si_setlinfo where " +
-            "pat_no = #{patNo}   and times = #{times}   and ledger_sn = #{ledgerSn} ")
+    @Select("select setl_id from t_si_setlinfo where pat_no=#{patNo} and times=#{times} " +
+            "and ledger_sn=#{ledgerSn} and revoked=0 ")
     String getSetId(String patNo, String times, String ledgerSn);
 
     @Select("select visit_id = (select pat_no + '_' + cast(times as varchar) + '_' + cast(ledger_sn as varchar) " +
-            "from t_si_setlinfo b where b.setl_type=21 and b.revoked=0 and a.setl_id = b.setl_id) from t_settlement_setlinfo a " +
+            "from t_si_setlinfo b where b.setl_type=21 and b.revoked=0 and a.setl_id=b.setl_id) from t_settlement_setlinfo a " +
             "where dcla_time >= #{startTime} and dcla_time <= #{endTime} ")
     List<VisitId> getSettlementDocumentVisitID(String startTime, String endTime);