package com.engine.kq.cmd.upgrade;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.KQFormatJob;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 获取考考勤报表剩余数据
 * @author pzy
 *
 */
public class GetUpgrade12DataCmd extends AbstractCommonCommand<Map<String, Object>>{

	public GetUpgrade12DataCmd(Map<String, Object> params, User user) {
		this.user = user;
		this.params = params;
	}

	@Override
	public BizLogContext getLogContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> execute(CommandContext commandContext) {
    Map<String,Object> retmap = new HashMap<String,Object>();
    String type = Util.null2String((String)params.get("type"));
    String startdate = Util.null2String(params.get("startdate"));
    String enddate = Util.null2String(params.get("enddate"));
    RecordSet rs = new RecordSet();
    try {
      String sql = "select *from kq_format_pool where status in (0) and kqdate between '"+startdate+"' and '"+enddate+"'";
      rs.executeQuery(sql);
      retmap.put("status", "1");
      retmap.put("data", rs.getCounts());

    } catch (Exception e) {
      writeLog(e);
      retmap.put("status", "-1");
      retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
    }
    return retmap;
  }

}
