package com.mcwl.communityCenter.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.communityCenter.domain.Publish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import javax.validation.constraints.NotNull;

@Mapper
public interface PublishMapper extends BaseMapper<Publish> {

    @InterceptorIgnore(tenantLine = "true")
    Page<Publish> selectByTenantIdAndCommunityIdPage(Page<Publish> page, @Param("tenantId") Long tenantId, @Param("communityId") Long communityId);

    @InterceptorIgnore(tenantLine = "true")
    Publish selectByIdAndTenantIdAndCommunityId(@Param("id")
                                                Long id,
                                                @Param("tenantId")
                                                Long tenantId,
                                                @Param("communityId")
                                                Long communityId);

    @InterceptorIgnore(tenantLine = "true")
    Page<Publish> selectByTenantIdAndCommunityIdAndNotNullImagePage(Page<Publish> page,
                                                           @Param("tenantId")
                                                           Long tenantId,
                                                           @Param("communityId")
                                                           Long communityId);

    @InterceptorIgnore(tenantLine = "true")
    Page<Publish> selectByTenantIdAndCommunityIdAndNotNullFilePage(Page<Publish> page,
                                                                    @Param("tenantId")
                                                                    Long tenantId,
                                                                    @Param("communityId")
                                                                    Long communityId);

}
