def findt={
session.rn=null
def realName=''
def recruitBatch=RecruitBatch.findByIsCurrentBatch(1)
def learningCenter=session.menuUnit
// println 'lcName='+session.menuUnit.lcName
def institution=null
def institutionid=0
def institutionList=Institution.findAll("from Institution i where i.id in (select ltp.teachingPlan.institution.id from LcTeachPlan ltp where ltp.teachingPlan.recruitBatch.isCurrentBatch=1 and ltp.state='0' and ltp.learningCenter.id="+session.menuUnit.id+")")
def city =learningCenter.city
def hql="from EntryStudentTemp est where est.state=0 and est.learningCenter.id="+session.menuUnit.id
if(params.iId!=null&¶ms.iId!='0')
{
institutionid=params.iId.toInteger()
hql=hql+" and est.institution.id="+params.iId
}
if(session.rnl!=null)
{
realName=session.rnl
session.rn=session.rnl
hql=hql+" and est.memberInfo.id in (select mbi.memberInfo.id from MemberBaseInfo mbi where mbi.personBaseInfo.realName like '%"+session.rnl+"%')"
session.rnl=null
}
else if(params.realName!=null&¶ms.realName.trim()!="")
{
realName=params.realName.trim()
session.rn=params.realName.trim()
hql=hql+" and est.memberInfo.id in (select mbi.memberInfo.id from MemberBaseInfo mbi where mbi.personBaseInfo.realName like '%"+params.realName.trim()+"%')"
}
hql=hql+" order by est.entryDate desc"
def result=EntryStudentTemp.findAll(hql)
def elist=[]
if(result.size()>0)
{
for(r in result)
{
def studentData=new StudentData()
studentData.id=r.id
studentData.code=r.entryCode
studentData.school=r.institution.schoolName
studentData.studyKind=r.studyKind.studyKindName
studentData.subject=r.subject.subjectName
def memberInfo=r.memberInfo
// println memberInfo.id
def memberBaseInfo=MemberBaseInfo.findByMemberInfo(memberInfo)
def personBaseInfo=memberBaseInfo.personBaseInfo
studentData.ccode=personBaseInfo.certificateNo
studentData.ctype=personBaseInfo.certificateType
studentData.name=personBaseInfo.realName
SimpleDateFormat sdf=new SimpleDateFormat()
sdf.applyPattern("yyyy年MM月dd日")
studentData.entryDate=sdf.format(r.entryDate).toString()
// println 'r.learningCenter.lcName='+r.learningCenter.lcName
elist<<studentData
}
}
// println 'elist.size='+elist.size()
def total=elist.size()
def pagecount=10
def start
if(params.offset==null||params.offset=='')
{
start=0
}
else
{
start=Integer.parseInt(params.offset)
}
if(start>=total)
{
start=start-10
}
def end=start+9
if(end>=total)
{
end=total-1
}
def elisto=[]
if(total>0)
{
for(j in start..end)
{
elisto<<elist[j]
}
}
// println 'elisto.size='+elisto.size()
render(view:'listt',model:[studentDataList:elisto,institutionList:institutionList,institutionid:institutionid,realName:realName,total:total,recruitBatch:recruitBatch,start:start])
}