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.
118 lines
4.3 KiB
118 lines
4.3 KiB
package com.dsideal.FengHuang.Yp.Model;
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
import com.jfinal.kit.Kv;
|
|
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.*;
|
|
|
|
public class YpModel {
|
|
|
|
public boolean login(String zkz, String xm) {
|
|
String sql = "select * from t_yp_student where zkz=? and xm=?";
|
|
List<Record> list = Db.find(sql, zkz, xm);
|
|
if (list.size() > 0) return true;
|
|
return false;
|
|
}
|
|
|
|
public Record find(String zkz) {
|
|
String sql = "select * from t_yp_student where zkz=?";
|
|
return Db.findFirst(sql, zkz);
|
|
}
|
|
|
|
public Record getRecord(String zkz) {
|
|
String sql = "select * from t_yp_record where zkz=?";
|
|
List<Record> list = Db.find(sql, zkz);
|
|
if (list.size() == 0) {
|
|
Record record = new Record();
|
|
record.set("zkz", zkz);
|
|
Record r2 = find(zkz);
|
|
String xm = r2.getStr("xm");
|
|
record.set("xm", xm);
|
|
record.set("zzfs", r2.getStr("score"));
|
|
Db.save("t_yp_record", "zkz", record);
|
|
}
|
|
return Db.findById("t_yp_record", "zkz", zkz);
|
|
}
|
|
|
|
/**
|
|
* 功能:保存申报结果
|
|
*
|
|
* @param zkz 准考证号
|
|
* @param xm 学生姓名
|
|
* @param xb 性别
|
|
* @param mz 民族
|
|
* @param byxx 毕业学校
|
|
* @param bybj 毕业班级
|
|
* @param sg 身高
|
|
* @param zzfs 中招分数
|
|
* @param hjszd 户籍所在地
|
|
* @param jtzz 家庭住址
|
|
* @param xx 血型
|
|
* @param bb_name 爸爸姓名
|
|
* @param bb_bureau 爸爸单位
|
|
* @param bb_tel 爸爸电话
|
|
* @param mm_name 妈妈姓名
|
|
* @param mm_bureau 妈妈单位
|
|
* @param mm_tel 妈妈电话
|
|
* @param fzhm 服装号码
|
|
* @param bw 班委
|
|
* @param db 家庭是否享受低保
|
|
* @param zg 是否因身体原因需特殊照顾
|
|
* @param st 希望加入或创办什么社团
|
|
* @param zyz 是否希望加入志愿者组织
|
|
* @param xly 是否愿意参加暑期夏令营
|
|
* @param jlhd 是否愿意参加暑期省内外游学交流活动
|
|
* @param tc 有何特长
|
|
* @param jwh 家长是否愿意参加家长委员会
|
|
* @param uuid 照片ID
|
|
*/
|
|
public void save(String zkz, String xm, String xb, String mz, String byxx,
|
|
String bybj, String sg, String zzfs, String hjszd, String jtzz, String xx,
|
|
String bb_name, String bb_bureau, String bb_tel, String mm_name, String mm_bureau,
|
|
String mm_tel, String fzhm, String bw, String db, String zg, String st,
|
|
String zyz, String xly, String jlhd, String tc, String jwh, String uuid) {
|
|
|
|
Record record = new Record();
|
|
record.set("zkz", zkz);
|
|
record.set("xm", xm);
|
|
record.set("xb", xb);
|
|
record.set("mz", mz);
|
|
record.set("byxx", byxx);
|
|
record.set("bybj", bybj);
|
|
record.set("sg", sg);
|
|
record.set("zzfs", zzfs);
|
|
record.set("hjszd", hjszd);
|
|
record.set("jtzz", jtzz);
|
|
record.set("xx", xx);
|
|
record.set("bb_name", bb_name);
|
|
record.set("bb_bureau", bb_bureau);
|
|
record.set("bb_tel", bb_tel);
|
|
record.set("mm_name", mm_name);
|
|
record.set("mm_bureau", mm_bureau);
|
|
record.set("mm_tel", mm_tel);
|
|
record.set("fzhm", fzhm);
|
|
record.set("bw", bw);
|
|
record.set("db", db);
|
|
record.set("zg", zg);
|
|
record.set("st", st);
|
|
record.set("zyz", zyz);
|
|
record.set("xly", xly);
|
|
record.set("jlhd", jlhd);
|
|
record.set("tc", tc);
|
|
record.set("jwh", jwh);
|
|
record.set("update_ts", DateTime.now());
|
|
record.set("pic", "/upload/" + uuid + ".jpg");
|
|
record.set("uuid", uuid);
|
|
Db.update("t_yp_record", "zkz", record);
|
|
}
|
|
|
|
public Page<Record> listView(int page, int limit) {
|
|
SqlPara sp = Db.getSqlPara("yp.listView");
|
|
return Db.paginate(page, limit, sp);
|
|
}
|
|
} |