function initData (installSql, url, locate){
    var queryParams = "";
    if(installSql != null) {
    	queryParams = installSql(queryParams);
    }
    $.ajax({
        type: "POST",
        dataType: "text",
        url: url,
        data:{'queryParams':queryParams},
        async: false,
        success : function(data){
            loadPaginator(eval("("+data+")").total, url, queryParams, locate);
        }
    });
}

function loadPaginator(totalInvest, url, queryParams, locate){
    if(totalInvest > 0){
    $.jqPaginator('#pagination', {
        totalCounts:totalInvest,
        pageSize: 10,
        currentPage: 1,
        prev: '<li class="prev"><a href="javascript:;">上一页</a></li>',
        next: '<li class="next"><a href="javascript:;">下一页</a></li>',
        page: '<li class="page"><a href="javascript:;">{{page}}</a></li>',
        onPageChange: function (num, type ) {
            $.ajax({
                type: "POST",
                dataType: "text",
                url: url,
                data: {"pageSize":10, "page":num, 'queryParams':queryParams},
                success: function (data) {
                    $("#investCase").empty(); //清除div内容
                    if (data != null) {
                        data = eval("("+data+")").rows;;
                        $.each(data, function (index, investCase) {
                        		var name = investCase.noticeTitle==undefined ? investCase.title: investCase.noticeTitle;
                             $("#investCase").append('<tr><td width="87%"><a href="'+locate+'/'+investCase.id+'">'+name +'</a></td><td>'+investCase.createTime.substring(0,10)+'</td></tr>')
                        });
                    }
                }
            });
        }
    });
 }else{
		      $("#investCase").empty();
	}
}