insert into temporary_activity_photo (temporary_id, reported_id, type, photo_url, photo_filed_id)
insert into temporary_activity_photo (temporary_id, reported_id,clock_id, type, photo_url, photo_filed_id)
<foreachcollection="dos"item="item"index="index"separator=" UNION ALL ">
SELECT #{item.temporaryId}, #{item.reportedId}, #{item.type}, #{item.photoUrl}, #{item.photoFiledId} FROM dual
SELECT #{item.temporaryId}, #{item.reportedId}, #{item.clockId}, #{item.type}, #{item.photoUrl}, #{item.photoFiledId} FROM dual
WHERE NOT EXISTS( SELECT 1 FROM temporary_activity_photo WHERE reported_id = #{item.reportedId} AND type = #{item.type} AND photo_filed_id = #{item.photoFiledId} )