package cn.hmsoft.skill.control.std;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.hmsoft.application.web.Ajax;
import cn.hmsoft.frame.control.FrameControl;
import cn.hmsoft.pay.data.dao.PayBillDao;
import cn.hmsoft.skill.data.dao.school.SchoolAspectDao;
import cn.hmsoft.skill.data.dao.std.StdEnrolDao;

@RestController
public class StdEnrolControl extends FrameControl {

	@Autowired
	private StdEnrolDao daoEnrol;
	@Autowired
	private PayBillDao daoPay;
	
	@Autowired
	private SchoolAspectDao daoAspect;
	
	@RequestMapping("std/enrol/map")
	public Ajax mapEnrol(int std_id) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("StdEnrolArray", this.daoEnrol.mapStdEnrol(std_id));
		map.put("PayBillArray", daoPay.listByCustomer(std_id + "", null));
		return new Ajax(map);
	}
	
	
	/**
	 *       统计学生报考缴费数据
	 * @param query
	 * @param limit
	 * @param start
	 * @param order
	 * @param type
	 * @return
	 */
//	@RequestMapping("std/enrol/page")
//	public Ajax list(String school_id) {
//		school_id = "8310";
//		SchoolReg school = this.daoSchool.find(school_id);
//		return new Ajax(this.daoAspect.totalAspect(school.getSchool_id()));
//
//	}
	
	/**
	 *  统计学生报考缴费数据
	 * @param query
	 * @param limit
	 * @param start
	 * @param order
	 * @param type
	 * @return
	 */
	@RequestMapping("std/enrol/page")
	public Ajax page(String query, Integer limit, Integer start, String order, String type) {
		return new Ajax(this.daoAspect.pageEnrol(this.getFrameOptr().getOrg_id(), start, limit, 
				query, getQueryOrder(order, type)));
	}
	

}
