List<DonateStatistic>donateStatistics=jdbcTemplate.query("SELECT givemethod,COUNT(*) as count,reserved, amount FROM gived_vip WHERE givemethod IN (0,1,2,6) AND timestamp > CAST(DATE_FORMAT(NOW() ,?) as DATE) GROUP BY givemethod, amount",
List<DonateStatistic>donateStatistics=jdbcTemplate.query("SELECT givemethod,COUNT(*) as count, amount FROM gived_vip WHERE givemethod IN (0,1,2,6) AND timestamp > date_trunc(?,now())::DATE GROUP BY givemethod, amount",
@ -31,7 +31,7 @@ public class CountriesUpdater extends BaseUpdater{
@Value("${backend.updates.countries}")
privatebooleanupdate;
privatefinalStringcountries_in_current_year="SELECT DISTINCT connect_ip FROM %s.user_connections WHERE connection_type LIKE 'connect' AND timestamp > CAST(DATE_FORMAT(NOW() ,'%%Y-01-01') as DATE) UNION\n";
privatefinalStringcountries_in_current_year="SELECT DISTINCT connect_ip FROM %s.user_connections WHERE connection_type LIKE 'connect' AND timestamp > date_trunc('YEAR',now())::DATE UNION\n";
@ -24,10 +24,10 @@ public class UniqueUpdater extends BaseUpdater{
@Qualifier("jt_ro")
privateJdbcTemplatejdbcTemplate;
privatefinalStringquery_total="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE \"disconnect\" AND connect_duration > 300 UNION\n";
privatefinalStringquery_day="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE \"disconnect\" AND connect_duration > 300 AND timestamp > CAST(DATE_FORMAT(NOW() ,'%%Y-%%m-%%d') as DATE) UNION\n";
privatefinalStringquery_month="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE \"disconnect\" AND connect_duration > 300 AND timestamp > CAST(DATE_FORMAT(NOW() ,'%%Y-%%m-01') as DATE) UNION\n";
privatefinalStringquery_year="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE \"disconnect\" AND connect_duration > 300 AND timestamp > CAST(DATE_FORMAT(NOW() ,'%%Y-01-01') as DATE) UNION\n";
privatefinalStringquery_total="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE 'disconnect' AND connect_duration > 300 UNION\n";
privatefinalStringquery_day="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE 'disconnect' AND connect_duration > 300 AND timestamp > date_trunc('DAY',now())::DATE UNION\n";
privatefinalStringquery_month="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE 'disconnect' AND connect_duration > 300 AND timestamp > date_trunc('MONTH',now())::DATE UNION\n";
privatefinalStringquery_year="SELECT DISTINCT account_id FROM %s.user_connections WHERE connection_type LIKE 'disconnect' AND connect_duration > 300 AND timestamp > date_trunc('YEAR',now())::DATE UNION\n";