select count(*) from eco_inspect_info
<where>
<if test="sqlParam!=null and sqlParam!=''">and stcd in
<foreach item="stcd" index="index" collection="sqlParam" open="(" separator="," close=")">
#{stcd}
</foreach>
</if>
</where>
红色部分为数据集合,其中sqlParam为数组 或者map,item为循环遍历的值,与#{}里面一致
dao里的请求方法为
List<EcoInspectInfo> findByEcoInspect(@Param("sqlParam") String[] sqlParam);