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} )
</foreach>
</insert>
...
...
@@ -41,6 +41,22 @@
</foreach>
</update>
<insertid="insertListByClockId">
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.clockId}, #{item.type}, #{item.photoUrl}, #{item.photoFiledId} FROM dual
WHERE NOT EXISTS( SELECT 1 FROM temporary_activity_photo WHERE clock_id = #{item.clockId} AND type = #{item.type} AND photo_filed_id = #{item.photoFiledId} )
</foreach>
</insert>
<updateid="updateListByClockId">
update temporary_activity_photo set is_delete = 0 where clock_id = #{clockId} and type = #{photoType} and photo_filed_id not in