package com.ruoyi.tc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tc.entity.po.AssetBasicNetworkCpPo;
import com.ruoyi.tc.entity.po.AssetSupplyChainCpPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 资产供应链信息复制(asset_supply_chain_cp)表数据库访问层
 *
 * @author makejava
 * @since 2024-11-15 10:03:56
 */
public interface AssetSupplyChainCpMapper extends BaseMapper<AssetSupplyChainCpPo> {


    /**
     * 根据资产id资产供应链原有id
     *
     * @param assetId 资产id
     * @return
     */
    @Select("select * from asset_supply_chain where asset_id=#{assetId}")
    List<AssetSupplyChainCpPo> findByassetId(Long assetId);


    /**
     * 根据资产id和任务id删除数据
     *
     * @param assetId 资产id
     * @param taskId  任务id
     */
    @Delete("delete from asset_supply_chain_cp where asset_id=#{assetId} and task_id =#{taskId}   ")
    void deletByAssetIdandTaskId(@Param("assetId") Long assetId, @Param("taskId")int taskId);




    /**
     * 根据taskid查询查询数据
     *
     * @param taskId 任务id
     * @return
     */
    @Select("select * from  asset_supply_chain_cp where task_id=#{taskId}")
    List<AssetSupplyChainCpPo> findByTaskId(int taskId);
}

