package com.cnd3b.restcontroller.enterprise.webclient.workers;

import com.cnd3b.common.Controller;
import com.cnd3b.common.data.Rows;
import com.cnd3b.common.data.SQLFactory;
import com.alibaba.fastjson.JSONObject;

public class analysis extends Controller {

    public analysis(JSONObject content) {
        super(content);
    }

    /**
     * 三工排行
     * @return
     */
    public String worker_analysis(){
        SQLFactory queryworker = new SQLFactory(this, "统计_经销商合伙人信息统计",pageSize,pageNumber,"t1.tagentsid desc");
        queryworker.addParameter("siteid", siteid);
        Rows workerrows = dbConnect.runSqlQuery(queryworker.getSQL());
        return getSucReturnObject().setDataByPaging(workerrows).saveToDataPool().preloading(1).toString();
    }

    /**
     * 三工明细查询
     * @return
     */
    public String query_agentworkerlist(){
        String tagentsid=content.getString("tagentsid");
        SQLFactory queryworker = new SQLFactory(this, "合伙人列表查询", pageSize, pageNumber, "t1.ftotalscore desc");
        queryworker.addParameter("siteid", siteid);
        queryworker.addParameter("tagentsid", tagentsid);
        Rows workerrows = dbConnect.runSqlQuery(queryworker.getSQL());
        return getSucReturnObject().setDataByPaging(workerrows).saveToDataPool().preloading(1).toString();
    }
}
