package com.cnd3b.restcontroller.enterprise.wechatclient.usercenter.account;

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

public class account extends Controller {
    public account(JSONObject content) {
        super(content);
    }

    /**
     * 账户余额查询
     *
     * @return
     */
    public String query_accountbalance() {
        SQLFactory sqlFactory = new SQLFactory(this, "账户余额查询");
        sqlFactory.addParameter("siteid", siteid);
        sqlFactory.addParameter("tenterprise_userid", userid);
        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
        return getSucReturnObject().setData(rows).toString();
    }

    /**
     * 账户收支明细查询
     *
     * @return
     */
    public String query_accountdetails() {
        SQLFactory sqlFactory = new SQLFactory(this, "账户收支明细查询", pageSize, pageNumber, "t1.createdate desc");
        sqlFactory.addParameter("siteid", siteid);
        sqlFactory.addParameter("tenterprise_userid", userid);
        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
        return getSucReturnObject().setDataByPaging(rows).setFinalDo(DataPool.defaultdatalife,1);
    }

}
