package cn.axzo.msg.center.dal.impl;

import cn.axzo.msg.center.dal.MNSMessageChannelLogDao;
import cn.axzo.msg.center.dal.mapper.MNSMessageChannelLogMapper;
import cn.axzo.msg.center.domain.entity.MNSMessageChannelLog;
import cn.axzo.msg.center.notices.common.enums.IsDeletedEnum;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 请求消息渠道日志表 Dao实现类
 * </p>
 *
 * @author zhaoyong
 * @since 2021-05-19
 */
@Repository("mnsMessageChannelLogDao")
public class MNSMessageChannelLogDaoImpl extends ServiceImpl<MNSMessageChannelLogMapper, MNSMessageChannelLog> implements MNSMessageChannelLogDao {

  @Override
  public boolean updateCallbackDate(String callbackDate, String messageOrderNo) {
    return this.lambdaUpdate()
        .set(MNSMessageChannelLog::getCallbackData, callbackDate)
        .eq(MNSMessageChannelLog::getMessageOrderNo, messageOrderNo)
        .eq(MNSMessageChannelLog::getIsDelete, IsDeletedEnum.NO.getCode())
        .update();
  }

}
