# user_sql = f"select FROM_UNIXTIME(create_time, '%y%m%d') as create_time,type,SUM(cast(amount as decimal(20,6)))/1000 as money,reference_type from {date} WHERE {' and '.join(condition)} GROUP BY FROM_UNIXTIME(create_time, '%y%m%d'),type ORDER BY FROM_UNIXTIME(create_time, '%y%m%d') DESC"
user_sql=f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} WHERE {' and '.join(condition)} ORDER BY create_time DESC"
else:
user_sql=f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} ORDER BY create_time DESC"
u_sql=f"select uuid,type,SUM(cast(amount as decimal(20,6)))/1000 as amount,FROM_UNIXTIME(create_time, '%y%m%d') as create_time,amount_type from {date} WHERE {' and '.join(condition)} GROUP BY uuid,type ORDER BY FROM_UNIXTIME(create_time, '%y%m%d') DESC"
else:
ifcondition:
u_sql=f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} WHERE {' and '.join(condition)} ORDER BY create_time DESC"
else:
u_sql=f"select id,uuid,order_number,type,reference_type,amount/1000 as amount,create_time from {date} ORDER BY create_time DESC"