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

import cn.novalon.gym.manage.db.entity.SysDictDataEntity;
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 SysDictDataDao extends R2dbcRepository<SysDictDataEntity, Long> {

    Flux<SysDictDataEntity> findByDictTypeAndStatusAndDeletedAtIsNull(String dictType, String status);

    Flux<SysDictDataEntity> findByDictTypeAndDeletedAtIsNull(String dictType);

    Flux<SysDictDataEntity> findByDictTypeAndDeletedAtIsNull(String dictType, Sort sort);

    Flux<SysDictDataEntity> findByDeletedAtIsNull();

    Flux<SysDictDataEntity> findByDeletedAtIsNull(Sort sort);

    Mono<Long> countByDeletedAtIsNull();

    Mono<Void> deleteByIdAndDeletedAtIsNull(Long id);
}
