FROM Order o where o.orderTime between time1 and time2 Order是你的entity bean
能说的更详细点么 我用的是mysql
private String cong;//搜索开始的时间 private String dao;//搜索结束的时间 //按时间查的HQL,setSql_count是分页用的你可以不写 public LXPage(){ this.setSql("from LX s where s.time >= ? and s.time <=? "); this.setSql_count("select count(*) from LX s where s.time >= ? and s.time <=?"); }
public void 往list里面添加参数() {
this.getList().clear();
Param p = new Param(); p.setType(Types.VARCHAR); if (cong==null||"".equals(cong)) { cong = "1900-01-01" ; } p.setValue( cong ); this.getList().add( p );
Param q = new Param(); q.setType(Types.VARCHAR ); if (dao==null||"".equals(dao)) { dao="2099-11-11"; } q.setValue(dao); this.getList().add( q );下班了就先写这些
Order是你的entity bean
private String dao;//搜索结束的时间
//按时间查的HQL,setSql_count是分页用的你可以不写
public LXPage(){
this.setSql("from LX s where s.time >= ? and s.time <=? ");
this.setSql_count("select count(*) from LX s where s.time >= ? and s.time <=?");
}
public void 往list里面添加参数() {
this.getList().clear();
Param p = new Param();
p.setType(Types.VARCHAR);
if (cong==null||"".equals(cong))
{
cong = "1900-01-01" ;
}
p.setValue( cong );
this.getList().add( p );
Param q = new Param();
q.setType(Types.VARCHAR );
if (dao==null||"".equals(dao))
{
dao="2099-11-11";
}
q.setValue(dao);
this.getList().add( q );下班了就先写这些