点击第一页,第二页,......都是展示第一页的信息,是什么原因
主查询sql
SELECT a.`REQUEST_TIME`,a.`BRANCH_OFFICE`,a.`OFFICIAL_PARTNER`,
CASE WHEN a.EDITION=0 THEN a.sms_id
WHEN a.EDITION=1 THEN a.buid ELSE '--' END business_id,
a.FUNCTION_ID,a.CHANNEL,a.REQUEST_URL,a.REFERRER,a.TITLE,a.TICK_SECONDS,
a.VISIT_IP,CONCAT(a.PROVINCE, "-",a.CITY) address,
CASE WHEN MOBILE_OR_NOT=1 THEN '是' ELSE '否' END is_mobile,
a.REQUEST_USER_AGENT
FROM t_visit_log a WHERE 1=1
${IF(len(起始日期) == 0,""," and a.request_time>= '" + 起始日期 + "' ")}
${IF(len(截止日期) == 0,""," and a.request_time<= '" + 截止日期 + "' ")}
${IF(len(版本类型)== 0,""," and a.EDITION=" + 版本类型 )}
${IF(len(商家归属地) == 0,""," and a.BRANCH_OFFICE= '" + 商家归属地 + "' ")}
${IF(len(套餐) == 0,""," and a.MONTHLY_RENT= '" + 套餐 + "' ")}
${IF(len(商家) == 0,""," and a.OFFICIAL_PARTNER= '" + 商家 + "' ")}
${IF(len(来源渠道) == 0,""," and a.CHANNEL= '" + 来源渠道 + "' ")}
${IF(len(功能点) == 0,""," and a.FUNCTION_ID= '" + 功能点 + "' ")}
ORDER BY request_time DESC
分页查询sql 如下
SELECT *
FROM (
SELECT *
FROM(
SELECT a.`REQUEST_TIME`,a.`BRANCH_OFFICE`,a.`OFFICIAL_PARTNER`,
CASE WHEN a.EDITION=0 THEN a.sms_id
WHEN a.EDITION=1 THEN a.buid ELSE '--' END business_id,
a.FUNCTION_ID,a.CHANNEL,a.REQUEST_URL,a.REFERRER,a.TITLE,a.TICK_SECONDS,
a.VISIT_IP,CONCAT(a.PROVINCE, "-",a.CITY) address,
CASE WHEN MOBILE_OR_NOT=1 THEN '是' ELSE '否' END is_mobile,
a.REQUEST_USER_AGENT
FROM t_visit_log a WHERE 1=1
${IF(len(起始日期) == 0,""," and a.request_time>= '" + 起始日期 + "' ")}
${IF(len(截止日期) == 0,""," and a.request_time<= '" + 截止日期 + "' ")}
${IF(len(版本类型)== 0,""," and a.EDITION=" + 版本类型 )}
${IF(len(商家归属地) == 0,""," and a.BRANCH_OFFICE= '" + 商家归属地 + "' ")}
${IF(len(套餐) == 0,""," and a.MONTHLY_RENT= '" + 套餐 + "' ")}
${IF(len(商家) == 0,""," and a.OFFICIAL_PARTNER= '" + 商家 + "' ")}
${IF(len(来源渠道) == 0,""," and a.CHANNEL= '" + 来源渠道 + "' ")}
${IF(len(功能点) == 0,""," and a.FUNCTION_ID= '" + 功能点 + "' ")}
ORDER BY request_time DESC
LIMIT ${fr_pagesize*fr_pagenumber}
) AS e1 ORDER BY request_time DESC LIMIT ${
IF(fr_pagenumber == INT((((fr_rowcount-1)/fr_pagesize)+1)),fr_rowcount - (fr_pagesize*(fr_pagenumber-1)),fr_pagesize)
}
) AS e2 ORDER BY request_time DESC