return find(f);
}
private Finder createFinder(Integer siteId, Integer ctgId,Integer userId,
Boolean recommend, Boolean checked, boolean desc, boolean cacheable) {
Finder f = Finder.create("from CmsGuestbook bean where 1=1");
if (siteId != null) {
f.append(" and bean.site.id=:siteId");
f.setParam("siteId", siteId);
}
if (ctgId != null) {
f.append(" and bean.ctg.id=:ctgId");
f.setParam("ctgId", ctgId);
}
if (userId != null) {
f.append(" and bean.member.id=:userId");
f.setParam("userId", userId);
}
if (recommend != null) {
f.append(" and bean.recommend=:recommend");
f.setParam("recommend", recommend);
}
if (checked != null) {
f.append(" and bean.checked=:checked");
f.setParam("checked", checked);
}
if (desc) {
f.append(" order by bean.id desc");
} else {
f.append(" order by bean.id asc");
}
f.setCacheable(cacheable);
return f;
}