package cn.ey.biz.module.system.dal.mapper.wiki;

import cn.ey.biz.framework.mybatis.core.mapper.BaseMapperX;
import cn.ey.biz.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ey.biz.module.system.dal.dataobject.wiki.WikiFileDO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface WikiFileMapper extends BaseMapperX<WikiFileDO> {

    default void deleteByRefIdAndType(Long refId, String type) {
        delete(new LambdaQueryWrapperX<WikiFileDO>()
                .eq(WikiFileDO::getRefId, refId)
                .in(WikiFileDO::getRefType, type));
    }
}
