shixun_tags=TagRepertoire.find_by_sql("SELECT tr.`name`, COUNT(str.shixun_id) as shixun_count FROM tag_repertoires tr, shixun_tag_repertoires str WHERE tr.id = str.tag_repertoire_id AND str.shixun_id IN (#{shixun_ids.join(',').strip==""?-1:shixun_ids.join(',')}) GROUP BY tr.id order by shixun_count desc")
shixun_tags=TagRepertoire.find_by_sql("SELECT tr.`name`, COUNT(str.shixun_id) as shixun_count FROM tag_repertoires tr,
"FROM (#{from_sql}) reports ORDER BY percentage #{sort_direction} LIMIT #{PAGE_SIZE} OFFSET #{offset}"
"(@total:=SUM(IF(date BETWEEN '#{format_date(params[:begin_date])}' AND '#{format_date(params[:end_date])}', #{contrast_column}, 0))) total,"\
"(@other_total:=SUM(IF(date BETWEEN '#{format_date(params[:other_begin_date])}' AND '#{format_date(params[:other_end_date])}', #{contrast_column}, 0))) other_total,"\