package com.pointlion.sys.mvc.common.model;

import com.jfinal.plugin.activerecord.Page;
import com.pointlion.sys.mvc.common.base.BaseActReProcdef;

/**
 * Generated by JFinal.
 */
@SuppressWarnings("serial")
public class ActReProcdef extends BaseActReProcdef<ActReProcdef> {
	public static final ActReProcdef dao = new ActReProcdef();
	
	/***
	 * 查询分页
	 * @param curr
	 * @param pagesize
	 * @return
	 */
	public Page<ActReProcdef> getDefPage(Integer curr , Integer pagesize){
		return ActReProcdef.dao.paginate(curr, pagesize, "select def.*,a.DEPLOY_TIME_ DEPLOY_TIME_  ", " from (SELECT KEY_,MAX(VERSION_) maxversion,dep.DEPLOY_TIME_ DEPLOY_TIME_ FROM act_re_procdef def, act_re_deployment dep WHERE def.DEPLOYMENT_ID_ = dep.ID_ GROUP BY KEY_) a,act_re_procdef def where def.VERSION_=a.maxversion and def.KEY_=a.KEY_ ORDER BY a.KEY_ ASC");
	}
}
