package cc.smtweb.system.bpm.web.engine.model.common;

import cc.smtweb.framework.core.db.EntityHelper;
import cc.smtweb.framework.core.mvc.service.SqlNamedPara;
import cc.smtweb.framework.core.mvc.service.SqlPara;
import cc.smtweb.system.bpm.web.design.form.define.PageDataset;
import cc.smtweb.system.bpm.web.engine.dynPage.DynPageHelper;
import cc.smtweb.system.bpm.web.engine.dynPage.IBuildSqlListener;
import cc.smtweb.system.bpm.web.engine.flow.entity.ProcInst;

/**
 * Created by Akmm at 2022-08-29 11:41
 * 流程列表handler
 */
public class FlowModelListHandler extends ModelListHandler {
    static IBuildSqlListener sqlListener = new IBuildSqlListener() {
        @Override
        public void buildSelect(PageDataset dataSet, StringBuilder sql) {
            sql.append("\ninner join " + EntityHelper.getSchemaTableName(ProcInst.ENTITY_NAME) + " on pri_id=" + dataSet._getModelTable().getIdField());
        }
    };
    @Override
    protected SqlPara buildSqlPara() {
        return DynPageHelper.buildSelectSqlEx(pageDataSet, filter,us, sqlListener);
    }

}
