package com.heyu.api.data.dao.vv;
/**
 * <p>
 * 资源库 服务类
 * </p>
 *
 * @author quyixiao
 * @since 2025-08-25
 */

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heyu.api.data.dto.vv.VVResourceDTO;
import com.heyu.api.data.entity.vv.VvResourceEntity;
import com.lz.mybatis.plugin.annotations.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface VvResourceDao extends BaseMapper<VvResourceEntity> {


    VvResourceEntity selectVvResourceById(@Param("id") Long id);


    Long insertVvResource(VvResourceEntity vvResource);


    Long insertOrUpdateVvResource(VvResourceEntity vvResource);


    int updateVvResourceById(VvResourceEntity vvResource);


    int updateCoverVvResourceById(VvResourceEntity vvResource);


    @Realy
    int deleteVvResourceById(@Param("id") Long id);


    @OrderBy(value={VvResourceEntity.default_sort},type={OrderType.ASC})
    List<VvResourceEntity> selectByCondition(IPage page,
                                             @IF @LIKE String fileName,
                                             @IF String type,
                                             @IF Long parentId,
                                             @IF @GE @Column(VvResourceEntity.create_timestamp) Long minCreateTimestamp,
                                             @IF @LE @Column(VvResourceEntity.create_timestamp) Long maxCreateTimestamp,
                                             @IF @LE  @Column(VvResourceEntity.modify_timestamp)Long minModifyTimestamp,
                                             @IF @GE  @Column(VvResourceEntity.modify_timestamp) Long maxModifyTimestamp,
                                             @IF @OrderBy(VvResourceEntity.create_timestamp) String createTimestampSort,
                                             @IF @OrderBy(VvResourceEntity.modify_timestamp) String modifyTimestampSort



    );

    List<VvResourceEntity> selectByParentId(Long parentId);


    List<VvResourceEntity> selectVvResourceByIds(@IN List<Long> id);


    List<VVResourceDTO> selectDtoByParentId(Long parentId);



    VVResourceDTO selectDTOById(Long id);
}