? ?1) <select id="countMapByModuleIds" resultType="map"> ? ? ? ? SELECT module_id as moduleId,count(0) as cnt ? ? ? ? FROM doc_module_favorite ? ? ? ? WHERE module_id in ? ? ? ? <foreach collection="list" item="item" index="index" open="(" close=")" separator=","> ? ? ? ? ? ? #{item} ? ? ? ? </foreach> ? ? ? ? group by module_id ? ? </select>
? ? @MapKey("moduleId") ? ? Map<Long, Object> countMapByModuleIds(List<Long> moduleIds);
2)<select id="countMapByProject" resultType="com.alibaba.fastjson.JSONObject"> ? ? ? ? SELECT project_id projectId, count(0) as cnt ? ? ? ? FROM project_favorite ? ? ? ? where project_id in ? ? ? ? <foreach collection="ids" item="id" open="(" separator="," close=")"> ? ? ? ? ? ? #{id} ? ? ? ? </foreach> ? ? ? ? group by project_id ? ? </select>
|