package com.ruoyi.tc.mapper;

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

import java.util.List;

/**
 * 单位其他联系人复制(unit_other_contact_cp)数据层
 *
 * @author ruoyi
 */
public interface UnitOtherConcatCpMapper extends BaseMapper<UnitOtherConcatCpPo> {


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


    /**
     * 根据资产id和任务id删除数据
     *
     * @param assetId 资产id
     * @param taskId  任务id
     */
    @Delete("delete from unit_other_contact_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  unit_other_contact_cp where task_id=#{taskId}")
    List<UnitOtherConcatCpPo> findByTaskId(int taskId);
}
