package org.springblade.manager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.manager.entity.WbsTree;
import org.springblade.manager.entity.WbsTreeContract;
import org.springblade.manager.entity.WbsTreePrivate;
import org.springblade.manager.vo.WbsTreeContractVO;

import java.util.List;


public interface WbsTreeContractMapper extends BaseMapper<WbsTreeContract> {

    List<WbsTreeContract> queryCurrentContractLogList(@Param("contractId") String contractId);

    List<WbsTreeContractVO> selectAll();

    Integer insertWbsTreeContract1(@Param("snowId") Long snowId,
                                   @Param("wbsType") Integer wbsType,
                                   @Param("contractId") String contractId,
                                   @Param("wbsTree") WbsTreePrivate wbsTree);


    void deleteByCondition(@Param("id") String id,
                           @Param("wbsId") String wbsId,
                           @Param("projectId") String projectId,
                           @Param("contractId") String contractId);

    WbsTreeContract selectByCondition(@Param("id") String id,
                                      @Param("projectId") String projectId,
                                      @Param("contractId") String contractId,
                                      @Param("wbsId") String wbsId);

    List<WbsTreeContract> findAllNodeList2(@Param("projectId") String projectId,
                                           @Param("contractId") String contractId,
                                           @Param("wbsId") String wbsId);

    void updateByCondition(@Param("id") String id,
                           @Param("projectId") String projectId,
                           @Param("contractId") String contractId,
                           @Param("wbsId") String wbsId);

    WbsTreeContract selectByCondition2(@Param("id") String id,
                                       @Param("projectId") String projectId,
                                       @Param("contractId") String contractId,
                                       @Param("wbsId") String wbsId);


    WbsTreePrivate selectParent(String projectId, String wbsId, Long parentId);

    void updateByCondition1(@Param("wbsTP") WbsTreePrivate wbsTP);

    void insertByCondition(@Param("wbsTree") WbsTreePrivate wbsTreePrivate,
                           @Param("contractId") Long contractId,
                           @Param("pKeyId") Long pKeyId,
                           @Param("wbsType") Integer wbsType);

}
