标签:stat template nat ring temp 模糊 turn 模糊查询 length
第一种:
@Override
public List<Apply> findByState(String apstate) {
StringBuffer hql= new StringBuffer();
hql.append("from Apply app where 1=1");
if (apstate.length() != 0 && apstate!=null){
hql.append(" and app.appState like ‘%"+apstate+"%‘");
}
List<Apply> applies=(List<Apply>)this.getHibernateTemplate().find(hql.toString());
return applies;
}
第二种:
@Override
public List<Apply> findByState2(String apstate) {
String hql= "from Apply app where 1=1";
if (apstate.length() != 0 && apstate!=null){
hql=hql+" and app.appState like ‘%"+apstate+"%‘";
}
List<Apply> applies=(List<Apply>)this.getHibernateTemplate().find(hql);
return applies;
}
标签:stat template nat ring temp 模糊 turn 模糊查询 length
原文地址:https://www.cnblogs.com/annuush/p/10967083.html