|
@@ -86,9 +86,9 @@ public class LibUserHistoryQueryDaoImpl implements LibUserHistoryQueryDao{
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
selSQL.append(" SELECT t.ryke_time,t.leave_time,v.child_name, t.lib_id ,i.league_name ");
|
|
selSQL.append(" SELECT t.ryke_time,t.leave_time,v.child_name, t.lib_id ,i.league_name ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
- selSQL.append(" inner JOIN tb_lib_read_vip v ON t.vip_id = v.id ");
|
|
|
|
|
|
+ selSQL.append(" inner JOIN tb_lib_vip v ON t.vip_id = v.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
- selSQL.append(" WHERE t.ryke_time is not null ");
|
|
|
|
|
|
+ selSQL.append(" WHERE t.ryke_time is not null and v.user_id is not null ");
|
|
|
|
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
selSQL.append(" and i.org_code in ( ");
|
|
selSQL.append(" and i.org_code in ( ");
|
|
@@ -119,9 +119,9 @@ public class LibUserHistoryQueryDaoImpl implements LibUserHistoryQueryDao{
|
|
selSQL.append(" select a.frequency,a.child_name,a.school,a.grade,a.img_url,a.league_name,concat(ROUND( a.frequency/ daycount * 100,2),'%') as qdl from (\n");
|
|
selSQL.append(" select a.frequency,a.child_name,a.school,a.grade,a.img_url,a.league_name,concat(ROUND( a.frequency/ daycount * 100,2),'%') as qdl from (\n");
|
|
selSQL.append("select COUNT(1) AS frequency, v.child_name, v.school,v.grade,v.img_url, i.league_name ,DAYOFMONTH(last_day(t.ryke_time)) as daycount \n");
|
|
selSQL.append("select COUNT(1) AS frequency, v.child_name, v.school,v.grade,v.img_url, i.league_name ,DAYOFMONTH(last_day(t.ryke_time)) as daycount \n");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
- selSQL.append(" LEFT JOIN tb_lib_read_vip v ON t.vip_id = v.id ");
|
|
|
|
|
|
+ selSQL.append(" LEFT JOIN tb_lib_vip v ON t.vip_id = v.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
- selSQL.append(" WHERE t.ryke_time is not null ");
|
|
|
|
|
|
+ selSQL.append(" WHERE t.ryke_time is not null and v.user_id is not null ");
|
|
|
|
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
selSQL.append(" and i.org_code in ( ");
|
|
selSQL.append(" and i.org_code in ( ");
|
|
@@ -148,11 +148,11 @@ public class LibUserHistoryQueryDaoImpl implements LibUserHistoryQueryDao{
|
|
Map<String, Object> searchParams) {
|
|
Map<String, Object> searchParams) {
|
|
StringBuilder selSQL = new StringBuilder();
|
|
StringBuilder selSQL = new StringBuilder();
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
List<Object> queryParams = new ArrayList<Object>();
|
|
- selSQL.append(" SELECT DATE_FORMAT(t.ryke_time,'%Y-%m-%T')as sb ,DATE_FORMAT(t.leave_time,'%Y-%m-%T')as sx,v.child_name,i.league_name ");
|
|
|
|
|
|
+ selSQL.append(" SELECT DATE_FORMAT(t.ryke_time,'%Y-%m-%d %T')as sb ,DATE_FORMAT(t.leave_time,'%Y-%m-%d %T')as sx,v.child_name,i.league_name ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
- selSQL.append(" LEFT JOIN tb_lib_read_vip v ON t.vip_id = v.id ");
|
|
|
|
|
|
+ selSQL.append(" JOIN tb_lib_vip v ON t.vip_id = v.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
- selSQL.append(" WHERE t.ryke_time is not null ");
|
|
|
|
|
|
+ selSQL.append(" WHERE t.ryke_time is not null and v.user_id is not null ");
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
if (searchParams.get("orgCode") != null && !searchParams.get("orgCode").equals("")) {
|
|
selSQL.append(" and i.org_code in ( ");
|
|
selSQL.append(" and i.org_code in ( ");
|
|
selSQL.append(searchParams.get("orgCode"));
|
|
selSQL.append(searchParams.get("orgCode"));
|
|
@@ -193,10 +193,10 @@ public class LibUserHistoryQueryDaoImpl implements LibUserHistoryQueryDao{
|
|
selSQL.append(" select a.user_id,a.frequency,a.child_name, a.league_name ,concat(ROUND( a.frequency/ daycount * 100,2),'%') as qdl from (\n");
|
|
selSQL.append(" select a.user_id,a.frequency,a.child_name, a.league_name ,concat(ROUND( a.frequency/ daycount * 100,2),'%') as qdl from (\n");
|
|
selSQL.append(" SELECT t.user_id, COUNT(1) AS frequency, v.child_name,DAYOFMONTH(last_day(t.ryke_time)) as daycount , i.league_name \n");
|
|
selSQL.append(" SELECT t.user_id, COUNT(1) AS frequency, v.child_name,DAYOFMONTH(last_day(t.ryke_time)) as daycount , i.league_name \n");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
selSQL.append(" FROM tb_lib_subscribe t ");
|
|
- selSQL.append(" LEFT JOIN tb_lib_read_vip v ON t.vip_id = v.id ");
|
|
|
|
|
|
+ selSQL.append(" JOIN tb_lib_vip v ON t.vip_id = v.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
selSQL.append(" LEFT JOIN tb_lib_join i on t.lib_id = i.id ");
|
|
|
|
|
|
- selSQL.append(" WHERE t.ryke_time is not null and ");
|
|
|
|
|
|
+ selSQL.append(" WHERE t.ryke_time is not null and v.user_id is not null and ");
|
|
selSQL.append(" date_format(t.ryke_time,'%Y-%m') =? ");
|
|
selSQL.append(" date_format(t.ryke_time,'%Y-%m') =? ");
|
|
queryParams.add(searchParams.get("monthDate"));
|
|
queryParams.add(searchParams.get("monthDate"));
|
|
|
|
|