SELECT SUM
	( CASE WHEN application_chat_record.vote_status = '0' THEN 1 ELSE 0 END ) AS "star_num",
	SUM ( CASE WHEN application_chat_record.vote_status = '1' THEN 1 ELSE 0 END ) AS "trample_num",
	SUM ( application_chat_record.message_tokens + application_chat_record.answer_tokens ) as "tokens_sum",
	"count"(application_chat_record."id") as chat_record_count
FROM
	application_chat_record application_chat_record
	LEFT JOIN application_chat application_chat ON application_chat."id" = application_chat_record.chat_id