jfianl分页


各位大神,请问这样的sql 和语句

`key``name`contentcat_nametypeanswerspromptaveragecreate_timeccp_study_daily to_days`create_time`= to_daysnow`key` daily_key ccp_study_record user_key=`key``name`contentcat_nametypeanswerspromptaveragecreate_timeccp_study_daily to_days`create_time`= to_daysnow`key` daily_key ccp_study_record user_key=

还要这样的sql语句

startTimeendtTimesqlstartTimeendtTimecatCodesqlcatCodenamesqlname

怎样通过jfinal的page分页

评论区

gantao

2019-03-26 12:03

if(!StrUtil.isEmptyOrUndefined(startTime) && StrUtil.isEmptyOrUndefined(endtTime)){
sql+="and a.create_time between '"+startTime+"'and '" + endtTime+"'";
}
if(!StrUtil.isEmptyOrUndefined(catCode)){
sql+=" and a.cat_code in ("+catCode+")";
}
if(!StrUtil.isEmptyOrUndefined(name)){
sql+=" and b.user_name = '"+name+"'";
}

gantao

2019-03-26 12:04

select a.`key`,a.`name`,a.content,a.cat_name,a.type,a.answers,a.prompt,a.average,a.create_time,'0' as `star` from ccp_study_daily a where to_days(a.`create_time`) = to_days(now()) and a.`key` not in (select daily_key from ccp_study_record where user_key=?)
union all
select a.`key`,a.`name`,a.content,a.cat_name,a.type,a.answers,a.prompt,a.average,a.create_time,'1' as `star` from ccp_study_daily a where to_days(a.`create_time`) = to_days(now()) and a.`key` in (select daily_key from ccp_study_record where user_key=?)

JFinal

2019-03-26 13:45

分页的问题,文档中已经十分详细:
https://www.jfinal.com/doc/5-6

热门反馈

扫码入社