package cn.novalon.gym.manage.db.dao;

import cn.novalon.gym.manage.db.entity.SysDictTypeEntity;
import org.springframework.data.domain.Sort;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Repository
public interface SysDictTypeDao extends R2dbcRepository<SysDictTypeEntity, Long> {

    Mono<SysDictTypeEntity> findByDictTypeAndDeletedAtIsNull(String dictType);

    Flux<SysDictTypeEntity> findByDeletedAtIsNull();

    Flux<SysDictTypeEntity> findByDeletedAtIsNull(Sort sort);

    Mono<Long> countByDeletedAtIsNull();

    Mono<Void> deleteByIdAndDeletedAtIsNull(Long id);
}
