package com.goafanti.common.dao;

import com.goafanti.common.bo.OrderOperator;
import com.goafanti.common.bo.UserOrderTask;
import com.goafanti.common.model.TChangeTask;
import com.goafanti.common.model.TOrderTask;
import com.goafanti.order.bo.*;
import com.goafanti.organization.bo.ProjectTypePuls;

import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface TOrderTaskMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(TOrderTask record);

    int insertSelective(TOrderTask record);

    TOrderTask selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TOrderTask record);

    int updateByPrimaryKey(TOrderTask record);

    List<TOrderTaskBo> selectOrderTask(@Param("orderNo") String orderNo,@Param("type") Integer type);

    TOrderTaskDetailBo getOrderTaskDetail(Integer id);

    TOrderTask selectBySuperId(String superId);

    List<TOrderTaskBo> getReceiverByOid(String oid);

    void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId, @Param("type")Integer type);

    String selectEstimateCost(String orderNo);

    List<String> listNameByDepAndName(@Param("orderNo")String orderNo, @Param("type")Integer type);

    List<TOrderTaskListBo> splitProjectList( @Param("tid")Integer tid, @Param("type")Integer type);



    /**
     *
     * @param orderNo 订单编号
     * @param splitStatus null 所有 1主项目 2子项目 3所有项目
     * @return
     */
    List<TOrderTaskBo> selectOrderTaskAll(@Param("orderNo") String orderNo,@Param("splitStatus")Integer splitStatus);



    String selectByidGetCname(String pid);

    void updateByOutsourceToOrderNo(@Param("orderNo")String orderNo, @Param("type")Integer type);


    List<String> getLockId(@Param("orderNo")String orderNo, @Param("aid")String aid, @Param("uid")String uid);

    List<UserOrderTask> selectUidByproject(String uid);

    void resstPayment(Integer id);

    void updateAddCostAmount(@Param("tid")Integer tid, @Param("cost")BigDecimal cost);

    OrderOperator selectAidByParam(@Param("tid")Integer tid);

    ProjectTypePuls selectByTidGetDtails(Integer tid);

    List<OutHighNewRetrialStatistics> highNewRetrialStatistics(@Param("depId") String depId, @Param("startDate") String startDate, @Param("endDate") String endDate);

    int getHighNewRetrial(String orderNo);

    List<OutHighNewRetrialList> highNewRetrialList(@Param("province") String province, @Param("depId") String depId, @Param("aid") String aid,
                                                   @Param("sort") Integer sort, @Param("startDate") String startDate, @Param("endDate") String endDate);


    List<TChangeTask> selectByAid(String aid);

    Integer getSplitCount(Integer tid);


    void updateBySuperId(TOrderTask t);

    void deleteBySplitId(Integer id);

    void updateDimissionTransferManager(@Param("aid")String aid, @Param("transferId")String transferId);
}
