hibernate list和pojo
/**
* 用户登录
*/
public Userinfo login(String schoolid,String username,String password) {
String sql="from Userinfo where schoolid='"+schoolid+"'";
if(!username.equals("")){
sql = sql+"and username='"+username+"'";
}
if(!password.equals("")){
sql = sql+"and password='"+password+"'";
}
List<Userinfo> list = this.baseDao.query(sql);
if (list != null && list.size() > 0) {
return list.get(0);
} else {
return null;
}
}
?
?
/**
* 我的课程
*/
public List<Course> Mycourse(String Schoolid,int pag, int pagesize,String cataid) {
?
String sql = "from Course where schoolid='"+Schoolid+"' and cataid='"+cataid+"'";
return baseDao.query(sql, pag, pagesize);
}