|
@@ -296,8 +296,8 @@ public class AnalysisQueryDaoImpl implements AnalysisQueryDao {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
List<Object> param = new ArrayList<>();
|
|
|
sb.append(" SELECT ");
|
|
|
- sb.append(" IFNULL((SELECT COUNT(1) FROM(SELECT COUNT(lib_id) from tb_analysis_count a WHERE a.day_time>=? AND a.day_time<=? GROUP BY a.lib_id) as d),0) as count_0, " );
|
|
|
- sb.append(" IFNULL((SELECT COUNT(1) FROM(SELECT COUNT(lib_id) from tb_analysis_count a WHERE a.day_time>=? AND a.day_time<=? GROUP BY a.lib_id) as d),0) as count_1 LIMIT 1");
|
|
|
+ sb.append(" IFNULL((SELECT COUNT(DISTINCT a.lib_id) from tb_analysis_count a WHERE a.day_time>=? AND a.day_time<=? ),0) as count_0, " );
|
|
|
+ sb.append(" IFNULL((SELECT COUNT(DISTINCT a.lib_id) from tb_analysis_count a WHERE a.day_time>=? AND a.day_time<=? ),0) as count_1 LIMIT 1");
|
|
|
param.add(params.get("date"));
|
|
|
param.add(params.get("date2"));
|
|
|
param.add(params.get("date3"));
|
|
@@ -329,7 +329,7 @@ public class AnalysisQueryDaoImpl implements AnalysisQueryDao {
|
|
|
sb.append(" SELECT IFNULL(count(1),0) as count from (SELECT t.vip_id,count(t.day_time) as count from tb_analysis t WHERE t.lib_id=? AND t.type=3 AND DATE_FORMAT(t.day_time,'%Y')=DATE_FORMAT(DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d'),'%Y') AND DATE_FORMAT(t.day_time,'%Y')=DATE_FORMAT(DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d'),'%u') GROUP BY t.vip_id HAVING count>=3) as tmp" );
|
|
|
param.add(params.get("libId"));
|
|
|
List<Map<String, Object>> list=dao.findMap(sb.toString(),param.toArray());
|
|
|
- return list!=null && list.size()>0 ? (int)list.get(0).get("count") : 0;
|
|
|
+ return list!=null && list.size()>0 ? Integer.parseInt(list.get(0).get("count").toString()): 0;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -339,7 +339,7 @@ public class AnalysisQueryDaoImpl implements AnalysisQueryDao {
|
|
|
sb.append(" SELECT COUNT(1) as count from tb_lib_vip t WHERE t.lib_id=? " );
|
|
|
param.add(params.get("libId"));
|
|
|
List<Map<String, Object>> list=dao.findMap(sb.toString(),param.toArray());
|
|
|
- return list!=null && list.size()>0 ? (int)list.get(0).get("count") : 0;
|
|
|
+ return list!=null && list.size()>0 ? Integer.parseInt(list.get(0).get("count").toString()) : 0;
|
|
|
}
|
|
|
|
|
|
@Override
|