SELECT
count(*) cnt
FROM
db_ysb_dictionary.ts_drugstore_branch b
INNER JOIN ti_ysb_dictionary.ts_provider_drugstore a ON a.storetitle = b.full_name
INNER JOIN db_ysb_dictionary.ts_drugstore_provider c ON b.id = c.drugstore_branch_id
AND c.provider_id = a.provider_id
AND c.first_order_time > UNIX_TIMESTAMP() - 86400 * 3