}
private Finder byChannelPaths(String[] paths, Integer[] siteIds,
Integer[] typeIds, Boolean titleImg, Boolean recommend,
String title, int orderBy) {
Finder f = Finder.create();
f.append("select bean from Content bean join bean.channel channel");
f.append(" join bean.contentExt as ext");
int len = paths.length;
if (len == 1) {
f.append(" where channel.path=:path").setParam("path", paths[0]);
} else {
f.append(" where channel.path in (:paths)");
f.setParamList("paths", paths);
}
if (siteIds != null) {
len = siteIds.length;
if (len == 1) {
f.append(" and channel.site.id=:siteId");
f.setParam("siteId", siteIds[0]);
} else if (len > 1) {
f.append(" and channel.site.id in (:siteIds)");
f.setParamList("siteIds", siteIds);
}
}
if (titleImg != null) {
f.append(" and bean.hasTitleImg=:titleImg");
f.setParam("titleImg", titleImg);
}
if (recommend != null) {
f.append(" and bean.recommend=:recommend");
f.setParam("recommend", recommend);
}
appendReleaseDate(f);
appendTypeIds(f, typeIds);
f.append(" and bean.status=" + ContentCheck.CHECKED);
if (!StringUtils.isBlank(title)) {
f.append(" and bean.contentExt.title like :title");
f.setParam("title", "%" + title + "%");
}
appendOrder(f, orderBy);
return f;
}