You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package com.dsideal.FengHuang.Yp.Model;
|
|
|
|
|
|
|
|
|
|
import com.dsideal.FengHuang.LoginPerson.Model.LoginPersonModel;
|
|
|
|
|
import com.dsideal.FengHuang.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.FengHuang.Util.IpUtil;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import com.jfinal.plugin.activerecord.SqlPara;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class YpModel {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取当前任务名称
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Record getCurrentTaskInfo() {
|
|
|
|
|
String sql = "select task_id,task_name,is_run from t_yp_task where b_use=1";
|
|
|
|
|
return Db.findFirst(sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取指定任务的开启班型及人数限制
|
|
|
|
|
*/
|
|
|
|
|
public List<Record> getTaskLimit(int task_id) {
|
|
|
|
|
String sql = "select * from t_yp_task_bx_limit where task_id=?";
|
|
|
|
|
return Db.find(sql, task_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Record> getTaskApplyCount(int task_id) {
|
|
|
|
|
String sql = "select bx_id from t_yp_task_bx_limit as t1 where t1.task_id=?";
|
|
|
|
|
List<Record> list = Db.find(sql, task_id);
|
|
|
|
|
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
int bx_id = record.getInt("bx_id");
|
|
|
|
|
sql = "select count(*) as count from t_yp_record as t2 where t2.task_id=? and t2.bx_id=?";
|
|
|
|
|
Record r1 = Db.findFirst(sql, task_id, bx_id);
|
|
|
|
|
record.set("apply_count", r1.getInt("count"));
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|