package nccloud.web.hrwa.pubinfo.wadataexplain.action;

import nc.vo.pubapp.pattern.pub.PubAppTool;
import nccloud.framework.web.processor.IRefSqlBuilder;
import nccloud.framework.web.processor.refgrid.RefQueryInfo;
import nccloud.framework.web.ui.meta.RefMeta;
import nccloud.framework.web.container.SessionContext;
import nccloud.pubitf.platform.db.SqlParameterCollection;

public class HrwaClassitemdevFilter implements IRefSqlBuilder {

	@Override
	public String getExtraSql(RefQueryInfo para, RefMeta meta) {
		// TODO Auto-generated method stub
	
		String pk_wa_class = null==para.getQueryCondition().get("pk_wa_class")?null:para.getQueryCondition().get("pk_wa_class").toString();
		String cuser =  SessionContext.getInstance().getClientInfo().getUserid();
		return "  wa_classitem.pk_wa_item in( " 
				+ "   SELECT pk_wa_item FROM  wa_itempower where "
				//+ "editflag = 'Y' and " //modify by longht 20211208 根据要求修改标识去掉
				+ " pk_wa_class = '" + pk_wa_class + "' "		
						+ "and ( pk_subject = '" + cuser + "'"
			    +" or pk_subject in ( SELECT sur.pk_role FROM sm_user_role sur where sur.cuserid = '"
				+ cuser + "')))";

	}

	@Override
	public SqlParameterCollection getExtraSqlParameter(RefQueryInfo para, RefMeta meta) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getOrderSql(RefQueryInfo para, RefMeta meta) {
		// TODO Auto-generated method stub
		return null;
	}

}
