public List<Materials> findAllMaterialsByAppid(Integer appid) {
String hql1 = "select medid from Materials where appid = ? and pid = 0";
List<Materials> list = this.hibernateTemplate.find(hql1, appid);
if (list != null && list.size() > 0) {
if(list.get(0).getMedid() != null){
Integer medid = (Integer)list.get(0).getMedid();
String hql2 = "from Materials where appid = ? and pid = ?";
return this.hibernateTemplate.find(hql2, appid, medid);
}
请教一下大家