num,err:=DB.Where("ident in (select res_ident from classpath_resource where classpath_id in ("+str.IdsString(classpathIds)+")) and (ident like ? or alias like ?)",q,q).Count(new(Resource))
num,err:=DB.Where("ident in (select res_ident from classpath_resource where classpath_id in ("+str.IdsString(classpathIds)+")) and (ident like ? or alias like ? or tags like ? or note like ?)",q,q,q,q).Count(new(Resource))
iferr!=nil{
logger.Errorf("mysql.error count resource in classpath(id=%v) query=%s fail: %v",classpathIds,query,err)
err:=DB.Where("ident in (select res_ident from classpath_resource where classpath_id in ("+str.IdsString(classpathIds)+")) and (ident like ? or alias like ?)",q,q).OrderBy("ident").Limit(limit,offset).Find(&objs)
err:=DB.Where("ident in (select res_ident from classpath_resource where classpath_id in ("+str.IdsString(classpathIds)+")) and (ident like ? or alias like ? or tags like ? or note like ?)",q,q,q,q).OrderBy("ident").Limit(limit,offset).Find(&objs)
iferr!=nil{
logger.Errorf("mysql.error query resource in classpath(id=%d) query=%s fail: %v",classpathIds,query,err)