package org.dromara.mapper;


import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.domain.asset.AssetType;
import org.dromara.domain.asset.vo.AssetTypeVo;

import java.util.List;

/**
 * 资产类型Mapper接口
 *
 * @author boman
 * @date 2025-04-11
 */
public interface AssetTypeMapper extends BaseMapperPlus<AssetType, AssetTypeVo> {

    AssetTypeVo checkAssetNameUnique(@Param("assetName")String assetName, @Param("parentId")Long parentId);

    int selectNormalChildrenAssetById(@Param("assetId")Long assetId);

    int hasChildByAssetId(@Param("assetId")Long assetId);

    AssetTypeVo selectAssetTypeByAssetId(@Param("assetId")Long parentId);

    List<AssetTypeVo> selectChildrenAssetTypeById(@Param("assetId")Long assetId);

    void updateAssetTypeChildren(@Param("assetTypes") List<AssetTypeVo> assetTypes);
}
