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

import cn.axzo.msg.center.domain.dto.MsgModuleDTO;
import cn.axzo.msg.center.domain.dto.SyncModuleDataDTO;
import cn.axzo.msg.center.domain.entity.MessageModule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * 消息模块(MessageModule)表数据库访问层
 *
 * @author zhangran
 * @since 2022-03-28 14:59:16
 */
/*@Mapper*/
public interface MessageModuleMapper extends BaseMapper<MessageModule>{


  List<MsgModuleDTO> listModuleByRelationIdsOrTypeIds(@Param("oldTypeIds") Set<Integer> oldTypeIds , @Param("relationIds") Set<Long> relationIds);

  @Insert("<script>insert into message_module (id, module_name, icon, remark, owned_type, biz_type) values " +
      "  <foreach collection='adds' item='item' separator=',' > " +
      "  (#{item.id}, #{item.moduleName}, #{item.icon}, #{item.moduleName}, #{item.ownedType}, #{item.bizType})" +
      "  </foreach>" +
      "</script>")
  void navtiveBatchSql(List<SyncModuleDataDTO> adds);
}

