INSERT INTO issue_vote_statistical_daily ( id, issue_id, statistical_date, support_count, opposition_count, total_count, today_increment, support_increment, opposition_increment, votable_count, created_by, created_time, updated_by, updated_time ) values ( (SELECT REPLACE(UUID(), '-', '') AS id), #{item.issueId}, #{item.statisticalDate}, #{item.supportCount}, #{item.oppositionCount}, #{item.totalCount}, #{item.todayIncrement}, #{item.supportIncrement}, #{item.oppositionIncrement}, #{item.votableCount}, #{item.createdBy}, now(), #{item.createdBy}, now() ) UPDATE issue_vote_statistical_daily when id = #{item.id} then #{item.supportCount} when id = #{item.id} then #{item.oppositionCount} when id = #{item.id} then #{item.totalCount} when id = #{item.id} then #{item.todayIncrement} when id = #{item.id} then #{item.supportIncrement} when id = #{item.id} then #{item.oppositionIncrement} when id = #{item.id} then #{item.votableCount} when id = #{item.id} then #{item.delFlag} when id = #{item.id} then #{item.updatedBy} updated_time = now() WHERE DEL_FLAG = '0' id = #{item.id} DELETE FROM issue_vote_statistical_daily WHERE CUSTOMER_ID = #{customerId} AND STATISTICAL_DATE = #{dateId} LIMIT 1000