/**
 * Copyright 2019 DH
 * All right reserved.
 * 项目名称: 大恒泰山系统
 * 创建日期:2022/8/22
 */
package org.springblade.modules.baseinfo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.baseinfo.project.entity.ProjectInfoEntity;
import org.springblade.modules.baseinfo.project.entity.ProjectWarningSettingEntity;
import org.springblade.modules.baseinfo.project.mapper.ProjectInfoMapper;
import org.springblade.modules.baseinfo.project.service.IProjectBaseInfoService;
import org.springblade.modules.baseinfo.project.vo.ProjectInfoVO;
import org.springframework.stereotype.Service;

import java.util.Date;

/***
 * Date:2022/8/22
 * Title:文件所属模块（必须填写）
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author dylan
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
@Service
public class ProjectBaseInfoServiceImpl extends BaseServiceImpl<ProjectInfoMapper, ProjectInfoEntity> implements IProjectBaseInfoService {
	@Override
	public IPage<ProjectInfoVO> selectPage(ProjectInfoEntity entity, IPage<ProjectInfoVO> page) {
		return page.setRecords(baseMapper.selectPage(entity,page));
	}

	@Override
	public boolean warningSaveOrUpdate(ProjectWarningSettingEntity warningSettingEntity) {

		return false;
	}

	@Override
	public boolean updateImportTime(Long projectId,Date date) {
		LambdaUpdateWrapper<ProjectInfoEntity> wrapper = Wrappers.<ProjectInfoEntity>update().lambda();
		wrapper.set(ProjectInfoEntity::getImportTime,date);
		wrapper.eq(ProjectInfoEntity::getId,projectId);
		return this.update(wrapper);
	}
}
