mapper层接口
List<AdminStatisticVo>findIntegralStatistics(@Param("CompanyId")List<String>CompanyId);
.xml文件中SQL操作
<select id="findIntegralStatistics" resultMap="CompanyStatisticVoMap">
select company_id
from sc_integral_log t1
where 1=1
//遍历list集合
<if test="CompanyId != null and CompanyId.size > 0">
AND company_id IN
<foreach item="item" index="index" collection="CompanyId" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by company_id;