package jnpf.limsMapper; import jnpf.base.mapper.SuperMapper; import jnpf.limsEntity.LimsMessageEventEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @Mapper public interface LimsMessageEventMapper extends SuperMapper { @Insert("INSERT INTO lims_message_event (id, tenant_id, event_code, biz_id, remind_stage, occurrence_key, " + "recipient_snapshot, parameter_snapshot, status, recipient_count, sent_count, failed_count, " + "retry_count, created_time, last_modify_time) VALUES (#{id}, #{tenantId}, #{eventCode}, #{bizId}, " + "#{remindStage}, #{occurrenceKey}, #{recipientSnapshot}, #{parameterSnapshot}, #{status}, " + "#{recipientCount}, #{sentCount}, #{failedCount}, #{retryCount}, #{createdTime}, #{lastModifyTime}) " + "ON CONFLICT (tenant_id, occurrence_key) DO NOTHING") int insertIfAbsent(LimsMessageEventEntity entity); @Select("SELECT * FROM lims_message_event WHERE tenant_id = #{tenantId} AND occurrence_key = #{occurrenceKey} LIMIT 1") LimsMessageEventEntity selectByOccurrenceKey(@Param("tenantId") String tenantId, @Param("occurrenceKey") String occurrenceKey); @Select("SELECT * FROM lims_message_event WHERE id = #{id}") LimsMessageEventEntity selectEvent(@Param("id") String id); }