COUNT(IF(client_status = 1,id,NULL)) AS crmCount1,
COUNT(IF(client_status = 2,id,NULL)) AS crmCount2,
COUNT(IF(client_status = 3,id,NULL)) AS crmCount3,
COUNT(IF(client_status = 4,id,NULL)) AS crmCount4,
COUNT(IF(client_status = 5,id,NULL)) AS crmCount5,
COALESCE( SUM( CASE WHEN DATE( create_time ) = CURDATE( ) THEN 1 ELSE 0 END ), 0 ) AS todayCrmCount,
COALESCE( SUM( CASE WHEN DATE( create_time ) = CURDATE( ) - INTERVAL 1 DAY THEN 1 ELSE 0 END ),0) AS yesterdayCrmCount ,
COALESCE( SUM( CASE WHEN DATE( last_follow_time ) <![CDATA[ >= ]]> CURDATE( ) - INTERVAL 30 DAY AND client_status <![CDATA[ < ]]> 5 THEN 1 ELSE 0 END ),0) AS last30DaysFollowCount,
COALESCE( SUM( CASE WHEN DATE( last_follow_time ) <![CDATA[ >= ]]> CURDATE( ) - INTERVAL 60 DAY AND client_status <![CDATA[ < ]]> 5 THEN 1 ELSE 0 END ),0) AS last60DaysFollowCount,
COALESCE( SUM( CASE WHEN DATE( last_follow_time ) <![CDATA[ >= ]]> CURDATE( ) - INTERVAL 90 DAY AND client_status <![CDATA[ < ]]> 5 THEN 1 ELSE 0 END ),0) AS last90DaysFollowCount,
COALESCE( SUM( CASE WHEN DATE( last_follow_time ) <![CDATA[ >= ]]> CURDATE( ) - INTERVAL 180 DAY AND client_status <![CDATA[ < ]]> 5 THEN 1 ELSE 0 END ),0) AS last180DaysFollowCount,