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

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

/**
 * Generated by JFinal.
 */
@SuppressWarnings("serial")
public class ActReModel extends BaseActReModel<ActReModel> {
	public static final ActReModel dao = new ActReModel();
	
	
	/***
	 * 自定义流程查询分页
	 * @param curr
	 * @param pagesize
	 * @return
	 */
	public Page<ActReModel> getCustomModelPage(Integer curr , Integer pagesize){
		String sql = " from (SELECT MAX(VERSION_) maxversion,KEY_ FROM act_re_model WHERE 1=1 ";
		sql = sql + " group by KEY_ ) a ,act_re_model m where m.KEY_=a.KEY_ and m.VERSION_=a.maxversion order by m.KEY_ ASC";
		return ActReModel.dao.paginate(curr, pagesize, "select * ", sql);
	}
}
