2019-07-09 08:35

@JFinal 好的,谢谢

2019-07-08 14:17

这是SQL代码

2019-07-08 14:17

String select = "select distinct s.ID,s.EXAM_NUM,s.NAME,s.ID_NUM ";
String sql = " from STUDENT s "
+ "left join (select distinct CODE,NAME from COLLEGE) b on s.COLLEGE_CODE = b.CODE "
+ "left join (select distinct CODE,NAME,XZ from MAJOR) c on s.MAJOR_CODE = c.CODE "
+ "left join (select distinct CODE,NAME from CLASSES) d on s.CLASSES_CODE = d.CODE "
+ "where s.EXAM_NUM in (select EXAM_CODE FROM PAYMENT_STUDENT where YEAR = ?) ";
List params = new ArrayList();
params.add(year);
if (StrKit.notBlank(year)) {
sql += " and s.YEAR = ? ";
params.add(year);
}
if (StrKit.notBlank(xyCode)) {
sql += " and s.COLLEGE_CODE = ? ";
params.add(xyCode);
}
if (StrKit.notBlank(zyCode)) {
sql += " and s.MAJOR_CODE = ? ";
params.add(zyCode);
}
if (xzCode != null && xzCode != 0) {
sql += " and c.XZ = ? ";
params.add(xzCode);
}
if (StrKit.notBlank(bjCode)) {
sql += " and s.CLASSES_CODE = ? ";
params.add(bjCode);
}
if (StrKit.notBlank(ksh)) {
sql += " and s.EXAM_NUM like ? ";
params.add("%" + ksh + "%");
}
if (StrKit.notBlank(lqh)) {
sql += " and s.ENROLL_NUM like ? ";
params.add("%" + lqh + "%");
}
if (StrKit.notBlank(sfzh)) {
sql += " and s.ID_NUM like ? ";
params.add("%" + sfzh.trim() + "%");
}
sql += "order by s.EXAM_NUM asc";
List pages =Db.find(select+sql,params.toArray());

2019-07-08 11:52