Ken小伙(提问者)${
IF(len(year) !=0,
\"SELECT bg,job_title_count,demand_count,entry_count,year,hr_region as classify,achieve_rate FROM dwservice.dws_hr_achieve_area_by_bg_year
WHERE day in(SELECT day from dwservice.dws_hr_achieve_area_by_bg_year GROUP BY day ORDER BY day LIMIT 1) AND bg=\'\"+bg+\"\' AND year=\"+year+\" ORDER BY year\",
IF(len(month) !=0,
\"SELECT bg,job_title_count,demand_count,entry_count,year,hr_region as classify,achieve_rate FROM dwservice.dws_hr_achieve_area_by_bg_month
WHERE day in(SELECT day from dwservice.dws_hr_achieve_area_by_bg_month GROUP BY day ORDER BY day LIMIT 1)
AND bg=\'\"+bg+\"\' AND year=\"+year+\" AND month=\"+month+\" ORDER BY month\",
IF(len(weeks) !=0,
\"SELECT bg,job_title_count,demand_count,entry_count,year,hr_region as classify,achieve_rate FROM dwservice.dws_hr_achieve_area_by_bg_weeks
WHERE day in(SELECT day from dwservice.dws_hr_achieve_area_by_bg_weeks GROUP BY day ORDER BY day LIMIT 1)
AND bg=\'\"+bg+\"\' AND year=\"+year+\" AND month=\"+month+\" AND weeks=\"+weeks+\" ORDER BY weeks\",\"\")
)}