From fa15c0bd1e2e8e94a1d30c8a46c78a18f1d0338d Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 23 Feb 2017 17:53:22 +0800 Subject: [PATCH] update code --- .../com/lyms/hospitalapi/qhdfy/QhdfyFmService.java | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java index d7e6ea3..5c66ee7 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java @@ -118,7 +118,7 @@ public class QhdfyFmService { if (StringUtils.isNotEmpty(syxh)) { - sql+= " SYXH='"+syxh+"'"; + sql+= " and SYXH='"+syxh+"'"; } List list = queryRunner.query(conn, sql, new BeanListHandler(FmItem.class)); @@ -251,9 +251,22 @@ public class QhdfyFmService { } } - List duoTaiList = queryRunner.query(conn, "select * from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null " + + String sql1="select * from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null " + " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and " + - " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)", new BeanListHandler(FmItem.class)); + " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)"; + + if (StringUtils.isNotEmpty(syxh)) + { + sql1+= " and SYXH='"+syxh+"'"; + } + + + List duoTaiList = queryRunner.query(conn,sql1 + , new BeanListHandler(FmItem.class)); + + + ExceptionUtils.catchException("duo tai size====" + duoTaiList.size()); + if (CollectionUtils.isNotEmpty(duoTaiList)) { Map> maps = new HashMap<>(); for(FmItem item : duoTaiList) @@ -581,7 +594,7 @@ public class QhdfyFmService { { List list1 = queryRunner.query(conn, "SELECT SYXH as syxh, BRXM as name,'' as cardNo,BRXB as sex,'' as birth,LXDH as phone FROM JHMK_BASY WHERE len(LXDH) = 11 and SYXH = '"+syxh+"'", new BeanListHandler(FmPatInfo.class)); if (CollectionUtils.isNotEmpty(list1)) { - return list.get(0); + return list1.get(0); } } DbUtils.closeQuietly(conn); -- 1.8.3.1