src/com/sys/plugin/file/JfileDAOImpl.java
(完整代码) 1KBpackage com.sys.plugin.file;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.hibernate.SessionFactory;
import org.hibernate.Query;
import java.util.List;
import com.sys.common.BaseDAO;
import com.sys.common.util.CommonUtil;
import com.sys.web.fenye.util.DefaultQueryCondition;
import com.sys.web.fenye.util.Page;
import com.sys.web.fenye.util.QueryConditionSQL;
@Service
@Transactional
public class JfileDAOImpl extends BaseDAO<Jfile, Integer> {
@Resource private SessionFactory sessionFactory;
protected Class<Jfile> getReferenceClass() {
return Jfile.class;
}
protected SessionFactory getSessionFactory() {
return this.sessionFactory;
}
public List search(DefaultQueryCondition condition) {
return null;
}
public Page<Jfile> getRecord(DefaultQueryCondition condition) {
StringBuffer sb = new StringBuffer();
QueryConditionSQL qcSQL = new QueryConditionSQL(sb);
StringBuffer where = new StringBuffer();
sb.append("select pro from Jfile pro where 1=1 ");
where.append("1=1 ");
boolean temp = false;
Jfile pro = (Jfile)condition.getCondition();
//String name = pro.getName();
//if(CommonUtil.isNotEmpty(name)) {
//sb.append(" and pro.name like :name ");
//qcSQL.setLikeParameter("name", name);
//where.append(" and name like '%").append(name).append("%'");
//temp = true;
//}
Query query = this.sessionFactory.getCurrentSession().createQuery(qcSQL.getSQL().toString());
query.setFirstResult(condition.getFirstResult());
query.setMaxResults(condition.getPageSize());
qcSQL.parameterToQuery(query);
List<Jfile> list = query.list();
int curPage = condition.getPageIndex();
Page<Jfile> page = null;
if(temp) {
page = new Page(list,this.getRevoedsNum(where.toString()),curPage,condition.getPageSize());
}else {
page = new Page(list,this.getRecordsNum(),curPage,condition.getPageSize());
}
return page;
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。