package cn.axzo.msg.center.dal;

import cn.axzo.msg.center.dal.mapper.MessageTemplateV3Mapper;
import cn.axzo.msg.center.domain.entity.MessageTemplateV3;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @author yanglin
 */
@Slf4j
@Component
public class MessageTemplateV3Dao extends ServiceImpl<MessageTemplateV3Mapper, MessageTemplateV3> {

    public Optional<MessageTemplateV3> findByCode(String code) {
        return Optional.ofNullable(lambdaQuery().eq(MessageTemplateV3::getCode, code).one());
    }

}
