<select id="findCommonTokenIds" parameterType="map" resultType="string"> SELECT DISTINCT c1.token_id FROM catogry c1 JOIN ( SELECT token_id FROM catogry WHERE group = '语言分类' AND catogry_id IN <foreach item="id" index="index" collection="languageCategoryIds" open="(" separator="," close=")"> #{id} </foreach> ) AS lc ON c1.token_id = lc.token_id JOIN ( SELECT token_id FROM catogry WHERE group = '生态分类' AND catogry_id IN <foreach item="id" index="index" collection="ecologyCategoryIds" open="(" separator="," close=")"> #{id} </foreach> ) AS ec ON c1.token_id = ec.token_id </select>