关于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; } java的FMJ框架应该如何使用呢? 一个SuperClass的简单问题 SWT Shell 如何获取刚插入的自增id,多线程. Java读取属性文件的问题 怎么将String = "what" 转换成 Unicode 格式如:String = "\u00053......." 关于WinUser键盘鼠标钩子 怎么得到本机的IP地址? 如何在Application中实现类似于Rational Rose的画图功能 Serializable 的作用? '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;
}