公司下有多少未删除,已审核的的公司网点
UPDATE
energy_company t,
(SELECT
company_id,
COUNT(1) total
FROM
energy_company_site
WHERE delete_flag = 0 AND audit_flag=1
GROUP BY company_id) u
SET
t.site_count = u.total
WHERE t.id = u.company_id