having :
<trim prefix="having" suffixOverrides="and"> <if test="min != null"> ratio >= #{min} and </if> <if test="max != null"> ratio <= #{max} and </if> </trim>
for:
<foreach item="companyCode" index="index" collection="companyCodes" open="(" separator="," close=")"> #{companyCode} </foreach>
for+or+like:
<if test="industryTrees!=null and industryTrees.size()>0"> and <foreach item="industryTree" index="index" collection="industryTrees" open="(" separator="or" close=")" > industry_code like CONCAT('%',#{industryTree},'%') </foreach> </if>
if+count+roud;
ROUND(count( IF ( state = #{state} and a.`year`=#{year}, state, NULL ) )/count(distinct b.company_code),3) ratio