package cn.axzo.msg.center.dal;


import cn.axzo.msg.center.dal.mapper.MessageRelationMapper;
import cn.axzo.msg.center.domain.dto.SyncRelationDataDTO;
import cn.axzo.msg.center.domain.entity.MessageRelation;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 模块与模板的关系表(MessageRelation)表数据库访问层
 *
 * @author zhangran
 * @since 2022-03-28 14:59:16
 */
@Service
@Slf4j
public class MessageRelationDao extends
    ServiceImpl<MessageRelationMapper, MessageRelation>{

  public void insertSql(SyncRelationDataDTO relation) {
    this.baseMapper.nativeSql(relation.getId(), relation.getModuleId(), relation.getTemplateId());
  }

  public MessageRelation getTemplateByCode(Long moduleId,String templateCode){
       return this.baseMapper.getTemplateByCode(moduleId,templateCode);
  }
}

