package com.hotent.project.manager.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hotent.project.model.CostProjectSurvey;
import com.hotent.project.dao.CostProjectSurveyDao;
import com.hotent.project.manager.CostProjectSurveyManager;
import com.hotent.base.manager.impl.BaseManagerImpl;
import com.hotent.project.req.CostProjectBasePageReq;
import com.hotent.req.PageReq;
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;


/**
 * 立项任务成本调查表 服务实现类
 *
 * @company 山西清众科技股份有限公司
 * @author 超级管理员
 * @since 2025-09-26
 */
@Service
public class CostProjectSurveyManagerImpl extends BaseManagerImpl<CostProjectSurveyDao, CostProjectSurvey> implements CostProjectSurveyManager {

	@Override
	public CostProjectSurvey getDetail(String id) {
    	CostProjectSurvey costProjectSurvey = this.get(id);
    	

		return costProjectSurvey;
	}
	@Override
	@Transactional
	public void createOrUpdate(CostProjectSurvey costProjectSurvey) {
		//新建或更新
		this.saveOrUpdate(costProjectSurvey);
	}

	//分页查询
	@Override
	public IPage<CostProjectSurvey> pageList(CostProjectBasePageReq req) {
		LambdaQueryWrapper<CostProjectSurvey> queryWrapper=new LambdaQueryWrapper<>();
 		IPage<CostProjectSurvey> page=new Page<>(req.getPageNum(), req.getPageSize());
		queryWrapper.eq(CostProjectSurvey::getProjectId, req.getProjectId());
		return this.page(page,new LambdaQueryWrapper<>());

	}

	@Override
	public List<CostProjectSurvey> getList() {
		return this.list();
	}
}
