package com.hotent.project.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hotent.constant.BaseConstant;
import com.hotent.project.model.CostProjectTaskApproval;
import com.hotent.project.dao.CostProjectTaskApprovalDao;
import com.hotent.project.manager.CostProjectTaskApprovalManager;
import com.hotent.base.manager.impl.BaseManagerImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;
import javax.annotation.Resource;

import com.hotent.base.util.BeanUtils;


/**
 * 任务定制-成本监审立项主表 服务实现类
 *
 * @author 超级管理员
 * @company 山西清众科技股份有限公司
 * @since 2025-10-09
 */
@Service
public class CostProjectTaskApprovalManagerImpl extends BaseManagerImpl<CostProjectTaskApprovalDao, CostProjectTaskApproval> implements CostProjectTaskApprovalManager {

    @Override
    public CostProjectTaskApproval getDetail(String id) {
        CostProjectTaskApproval costProjectTaskApproval = this.get(id);


        return costProjectTaskApproval;
    }

    @Override
    @Transactional
    public void createOrUpdate(CostProjectTaskApproval costProjectTaskApproval) {
        //新建或更新
        this.saveOrUpdate(costProjectTaskApproval);
    }

    @Override
    public List<CostProjectTaskApproval> getListByProjectId(String projectId) {
        LambdaQueryWrapper<CostProjectTaskApproval> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CostProjectTaskApproval::getIsDeleted, BaseConstant.NORMAL_STATUS);
        queryWrapper.eq(CostProjectTaskApproval::getProjectId, projectId);
        return this.list(queryWrapper);
    }
}
