package cn.hmsoft.skill.data.dao.std;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import cn.hmsoft.jdbc.core.PlatformDaoSupport;
import cn.hmsoft.skill.data.model.std.StdEnrolSubject;

@Repository
public class StdEnrolSubjectDao extends PlatformDaoSupport<StdEnrolSubject> {

	public void clear(int school_id) {
		this.delete("school_id",school_id);
	}
	
	public List<StdEnrolSubject> listSubject(int std_id,int aspect_id) {
		String sql = "select * from std_enrol_subject where std_id=? and aspect_id=? order by subject_order";
		return this.listBySql(StdEnrolSubject.class,sql,std_id,aspect_id);
	}
	
	public List<Map<String, Object>> listStd(String aspect_name){
		String sql = "select std_name,cert_id from student_data where ASPECT_NAME =?";
		return this.listMapBySql(sql.toString(), aspect_name);
	}

}
