3,491
社区成员
发帖
与我相关
我的任务
分享
select bank.idbank,bank.cname as cname,case ch.totalcount when null then 0 else ch.totalcount end as totalcount,case ch.unsigntotal when null then 0 else ch.unsigntotal end as unsigntotal ,case ch.signtotal when null then 0 else ch.signtotal end as signtotal from (select idcenter as idbank, count(distinct case when sts =0 then accno end) as totalcount, count(distinct case when signflag ='0' and sts='0' then accno end ) as unsigntotal, count(distinct case when signflag ='1' and sts='0' then accno end ) as signtotal from actctrlinfo where 1=1 and idcenter in('9999','9903','9904','9188','9288','9588','9988','9998','9900','9901','9902','0700','9990','9905','9499','9199','9299','9399','9599','9699','9999','9199','9299','9903','9399','9599','9904','9699','9188','9288','9588','9988','9499','9998','9900','9901','9902','0700','9990','9905','9188','9288','9588','9988') group by idcenter) ch left join (select distinct idbank,cname from param_bank ) bank on bank.idbank = ch.idbank order by ch.idbank
Connection con = getHibernateTemplate().getSessionFactory().openSession().connection();
try {
ResultSet rs = con.prepareStatement(sql).executeQuery();
if (rs == null || rs.wasNull()) {
.......;
} else {
.......;
}
}finally{
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}