hibernate不定条件查询?怎么写

2024-11-29 22:41:22
推荐回答(1个)
回答1:

StringBuffer sql=new StringBuffer();
sql="select * from biao where 1=1";
if(判断条件){
String sql2="and 条件";
sql.append(sql2)

}else{
......

}