package cn.im.che.action;

 import cn.im.che.service.ClgpssjService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.base.aspect.OperateType;
import cn.base.bean.BaseAction;
import cn.base.excel.ExcelCol;
import cn.base.excel.ExportEngine;
import cn.base.util.CommUtils;
import cn.base.util.Constants;
import cn.base.util.LogConstants;
import cn.base.util.StringUtil;
import cn.base.util.Struts2Utils;

@SuppressWarnings({"all"})
@Component("clgpssjAction")
public class ClgpssjAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private static Logger iLog = Logger.getLogger(ClgpssjAction.class);
	
	@Autowired
	private ClgpssjService service;
	
	/**
	 * ·ÖÒ³
	 */
	@OperateType(value = LogConstants.LOG_QUERY ,info ="listClgpssjByPage")
	public void listClgpssjByPage(){
		Map map = Struts2Utils.getRequestParameterMap();
		try {
			int page = Integer.parseInt(Struts2Utils.getParameter("page"));
			int rows = Integer.parseInt(Struts2Utils.getParameter("rows"));
			int start = ( (page == 0 ?  1 : page ) - 1) * rows ;
			map.put("start",start );
			map.put("limit",rows );
			Struts2Utils.renderJson(this.service.listClgpssjByPage(map));
		} catch (Exception e) {
			e.printStackTrace();
			iLog.error("ClgpssjAction-listClgpssjByPage-error:" +e);
			Struts2Utils.renderJson(null);
		}
	}
	
	/**
	 * ·ÖÒ³
	 */
	@OperateType(value = LogConstants.LOG_QUERY ,info ="query_Clgpssj")
	public void query_Clgpssj(){
		Map map = Struts2Utils.getRequestParameterMap();
		try {
			int page = Integer.parseInt(Struts2Utils.getParameter("page"));
			int rows = Integer.parseInt(Struts2Utils.getParameter("rows"));
			int start = ( (page == 0 ?  1 : page ) - 1) * rows ;
			map.put("start",start );
			map.put("limit",rows );
			Struts2Utils.renderJson(this.service.query_Clgpssj(map));
		} catch (Exception e) {
			e.printStackTrace();
			iLog.error("ClgpssjAction-query_Clgpssj-error:" +e);
			Struts2Utils.renderJson(null);
		}
	}
}
