关于SSH2的访问数据库问题。 本帖最后由 xuchunlin2011 于 2013-09-26 10:05:53 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我的动态评价方法,没有问题 :public String createHql(Map<String,String> map){ String hql=""; if(!"".equals(map.get("year")) && map.get("year") != null){ hql += " and reportyear ="+map.get("year"); } if(!"".equals(map.get("month")) && map.get("month") != null){ hql += " and to_number(reportmonth) ="+map.get("month"); } if(!"".equals(map.get("leimonth")) && map.get("leimonth") != null){ hql += " and to_number(reportmonth) >="+map.get("leimonth"); } if(!"".equals(map.get("reporttype")) && map.get("reporttype") != null){ hql += " and reporttype ="+map.get("reporttype"); } if(!"".equals(map.get("isreport")) && map.get("isreport") != null){ hql += " and isreport ="+map.get("isreport"); } if(!"".equals(map.get("reportstatus")) && map.get("reportstatus") != null){ hql += " and reportstatus ="+map.get("reportstatus");//是否存盘或者上报 } if(!"".equals(map.get("checkisreport")) && map.get("checkisreport") != null){ hql += " and reportstatus >=0 ";//是否存盘或者上报 } if(!"".equals(map.get("userid")) && map.get("userid") != null){ hql += " and UUsrUser36.userid ="+map.get("userid"); } if(!"".equals(map.get("departmentid")) && map.get("departmentid") != null){ hql += " and QCmnDepartment23.departmentid ="+map.get("departmentid"); } if(!"".equals(map.get("operpointid")) && map.get("operpointid") != null){ hql += " and QCmnOperatepoint20.operatepointid ="+map.get("operpointid"); } if(!"".equals(map.get("notJuoperpointid")) && map.get("notJuoperpointid") != null){ hql += " and QCmnOperatepoint20.operatepointid != 153 "; } if(!"".equals(map.get("isaggregateblock")) && map.get("isaggregateblock") != null){ hql += " and isaggregateblock="+map.get("isaggregateblock"); } if(!"".equals(map.get("reportDateStart")) && map.get("reportDateStart") != null){ hql += " and reportdate>=to_date('"+map.get("reportDateStart")+"','yyyy-mm-dd')"; } if(!"".equals(map.get("reportDateStop")) && map.get("reportDateStop") != null){ hql += " and reportdate<=to_date('"+map.get("reportDateStop")+"','yyyy-mm-dd')"; } if(!"".equals(map.get("order")) && map.get("order") != null){ hql+=" order by reportdate desc"; } if(!"".equals(map.get("monthOrder")) && map.get("monthOrder") != null){ hql+=" order by to_number(reportmonth) desc"; } return hql; } 服务器程序启动与停止 First Aid!!!!关于过滤XML非法字符串的问题!!!0Xffff 随便声明个数 算出下一位 Java按钮事件 看看这段程序的结果?? 谁有java swing 方面的电子书,能提供一下吗。?? javacomm20-win32之浮夸? 不调用repaint(),如何画图? Help, 200分相送! 用javamail如何写pop3呀,急呀,分一定给 'Launching Base64'错误如何解决 发现一个Java陷进,有兴趣的进来瞧瞧
public String createHql(Map<String,String> map){
String hql="";
if(!"".equals(map.get("year")) && map.get("year") != null){
hql += " and reportyear ="+map.get("year");
}
if(!"".equals(map.get("month")) && map.get("month") != null){
hql += " and to_number(reportmonth) ="+map.get("month");
}
if(!"".equals(map.get("leimonth")) && map.get("leimonth") != null){
hql += " and to_number(reportmonth) >="+map.get("leimonth");
}
if(!"".equals(map.get("reporttype")) && map.get("reporttype") != null){
hql += " and reporttype ="+map.get("reporttype");
}
if(!"".equals(map.get("isreport")) && map.get("isreport") != null){
hql += " and isreport ="+map.get("isreport");
}
if(!"".equals(map.get("reportstatus")) && map.get("reportstatus") != null){
hql += " and reportstatus ="+map.get("reportstatus");//是否存盘或者上报
}
if(!"".equals(map.get("checkisreport")) && map.get("checkisreport") != null){
hql += " and reportstatus >=0 ";//是否存盘或者上报
}
if(!"".equals(map.get("userid")) && map.get("userid") != null){
hql += " and UUsrUser36.userid ="+map.get("userid");
}
if(!"".equals(map.get("departmentid")) && map.get("departmentid") != null){
hql += " and QCmnDepartment23.departmentid ="+map.get("departmentid");
}
if(!"".equals(map.get("operpointid")) && map.get("operpointid") != null){
hql += " and QCmnOperatepoint20.operatepointid ="+map.get("operpointid");
}
if(!"".equals(map.get("notJuoperpointid")) && map.get("notJuoperpointid") != null){
hql += " and QCmnOperatepoint20.operatepointid != 153 ";
}
if(!"".equals(map.get("isaggregateblock")) && map.get("isaggregateblock") != null){
hql += " and isaggregateblock="+map.get("isaggregateblock");
}
if(!"".equals(map.get("reportDateStart")) && map.get("reportDateStart") != null){
hql += " and reportdate>=to_date('"+map.get("reportDateStart")+"','yyyy-mm-dd')";
}
if(!"".equals(map.get("reportDateStop")) && map.get("reportDateStop") != null){
hql += " and reportdate<=to_date('"+map.get("reportDateStop")+"','yyyy-mm-dd')";
}
if(!"".equals(map.get("order")) && map.get("order") != null){
hql+=" order by reportdate desc";
}
if(!"".equals(map.get("monthOrder")) && map.get("monthOrder") != null){
hql+=" order by to_number(reportmonth) desc";
}
return hql;
}