count_sql=f"select create_time from v3_guild_account_statistics_copy where {' and '.join(finance_condition)} GROUP BY create_time"
count_sql=f"select create_time from v3_guild_account_statistics_copy where {' and '.join(finance_condition)} GROUP BY create_time"
data_sql=f"select id,initial_money as balance,income,outcome,create_time from v3_guild_account_statistics_copy where {' and '.join(finance_condition)} GROUP BY create_time order by create_time DESC limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,outcome,create_time from v3_guild_account_statistics_copy where {' and '.join(finance_condition)} GROUP BY create_time order by create_time DESC limit {(int(page) - 1) * size},{size}"
else:
other_sql=f"select initial_money as balance,income,outcome,create_time,amount_type from v3_guild_account_statistics_copy where amount_type != 1"
count_sql=f"select create_time from v3_guild_account_statistics_copy GROUP BY create_time"
data_sql=f"select id,initial_money as balance,income,outcome,create_time from v3_guild_account_statistics_copy GROUP BY create_time order by create_time DESC limit {(int(page) - 1) * size},{size}"
count_sql=f"select date as create_time from v3_user_account_statistics where {' and '.join(conditions)} GROUP BY date"
count_sql=f"select date as create_time from v3_user_account_statistics where {' and '.join(conditions)} GROUP BY date"
data_sql=f"select id,initial_money as balance,income,pay as outcome,date as create_time from v3_user_account_statistics where {' and '.join(conditions)} GROUP BY date order by date limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,pay as outcome,date as create_time,balance as consumable,pearl as can_withdraw from v3_user_account_statistics where {' and '.join(conditions)} GROUP BY date order by date limit {(int(page) - 1) * size},{size}"
else:
else:
count_sql=f"select date as create_time from v3_user_account_statistics GROUP BY date"
count_sql=f"select date as create_time from v3_user_account_statistics GROUP BY date"
data_sql=f"select id,initial_money as balance,income,pay as outcome,date as create_time from v3_user_account_statistics GROUP BY date order by date limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,pay as outcome,date as create_time,balance as consumable,pearl as can_withdraw from v3_user_account_statistics GROUP BY date order by date limit {(int(page) - 1) * size},{size}"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=1 and {' and '.join(condition)} GROUP BY calculation_time"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=1 and {' and '.join(condition)} GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=1 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=1 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
else:
other_sql="select initial_money as balance,income,outcome,calculation_time as create_time,amount_type from finance_data_calculation_sum_copy where amount_type != 1"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=1 GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=1 GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=4 and {' and '.join(condition)} GROUP BY calculation_time"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=4 and {' and '.join(condition)} GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=4 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=4 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
else:
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=4 GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=4 GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=5 and {' and '.join(condition)} GROUP BY calculation_time"
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=5 and {' and '.join(condition)} GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=5 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=5 and {' and '.join(condition)} GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
else:
count_sql=f"select calculation_time from finance_data_calculation_sum_copy where type=5 GROUP BY calculation_time"
data_sql=f"select id,initial_money as balance,income,outcome,calculation_time as create_time from finance_data_calculation_sum_copy where type=5 GROUP BY calculation_time order by calculation_time DESC limit {(int(page) - 1) * size},{size}"
sys_sql=f"select initial_money as balance,income,outcome,create_time from v2_system_account_statistics_copy where fi_account_id={id} and {' and '.join(finance_condition)} ORDER BY create_time DESC"
sys_sql=f"select initial_money as balance,income,outcome,create_time from v2_system_account_statistics_copy where fi_account_id={id} and {' and '.join(finance_condition)} ORDER BY create_time DESC"
else:
sys_sql=f"select initial_money as balance,income,outcome,create_time from v2_system_account_statistics_copy where fi_account_id={id} ORDER BY create_time DESC"
data_sql=f"SELECT dst_uuid as uuid,amount,FROM_UNIXTIME(create_time) as create_time,reference_type,reference_number,reference_info FROM order_log_{time_list[0]} where {' and '.join(conditions)} ORDER BY create_time desc limit {(int(self.page) - 1) * self.size},{self.size}"
money_sql=f"SELECT sum(amount) as m_sum FROM order_log_{time_list[0]} where {' and '.join(conditions)}"
count_sql=f"SELECT count(id) as c_sum FROM order_log_{time_list[0]} where {' and '.join(conditions)}"
else:
data_sql=f"SELECT dst_uuid as uuid,amount,FROM_UNIXTIME(create_time) as create_time,reference_type,reference_number,reference_info FROM order_log_{time_list[0]} where {' and '.join(conditions)} UNION ALL SELECT dst_uuid as uuid,amount,FROM_UNIXTIME(create_time) as create_time,reference_type,reference_number,reference_info FROM order_log_{time_list[1]} where {' and '.join(conditions)} ORDER BY create_time desc limit {(self.page - 1) * self.size},{self.size}"
money_sql=f"SELECT sum(a.b) as m_sum FROM ("f"SELECT sum(amount) as b FROM order_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT sum(amount)FROM order_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "
count_sql="SELECT sum(a.b) as c_sum FROM ("f"SELECT count(id) as b FROM order_log_{int(time_list[0])} where {' and '.join(conditions)} UNION ALL SELECT count(id) FROM order_log_{int(time_list[1])} where {' and '.join(conditions)}) AS a "