<select id="getCount" parameterType="java.util.HashMap" resultType="int">
SELECT count(a.obj_id)
FROM (
select * from dwg_gis_mapper map, dwg_gis_object obj
where obj.obj_id = map.obj_id
<if test="ObjectID != null and ObjectID != null">
and map.obj_id = #{ObjectID}
</if>
<if test="objList != null and objList != ''">
and map.obj_id in
<foreach collection="objList" item="obj" separator="," open="(" close=")">
#{obj.objId}
</foreach>
</if>
) a
</select>
로 처리한다.objList는 Map에 key 값이며 obj는 foreach에서 사용할 key값이다.