package com.ygtx.worklog.service.impl;

import java.util.List;
import com.ygtx.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ygtx.worklog.mapper.WorkProjectMapper;
import com.ygtx.worklog.domain.WorkProject;
import com.ygtx.worklog.service.IWorkProjectService;

/**
 * 项目管理Service业务层处理
 * 
 * @author ouyj
 * @date 2025-10-27
 */
@Service
public class WorkProjectServiceImpl implements IWorkProjectService 
{
    @Autowired
    private WorkProjectMapper workProjectMapper;

    /**
     * 查询项目管理
     * 
     * @param projectId 项目管理主键
     * @return 项目管理
     */
    @Override
    public WorkProject selectWorkProjectByProjectId(Long projectId)
    {
        return workProjectMapper.selectWorkProjectByProjectId(projectId);
    }

    /**
     * 查询项目管理列表
     * 
     * @param workProject 项目管理
     * @return 项目管理
     */
    @Override
    public List<WorkProject> selectWorkProjectList(WorkProject workProject)
    {
        return workProjectMapper.selectWorkProjectList(workProject);
    }

    /**
     * 新增项目管理
     * 
     * @param workProject 项目管理
     * @return 结果
     */
    @Override
    public int insertWorkProject(WorkProject workProject)
    {
        workProject.setCreateTime(DateUtils.getNowDate());
        return workProjectMapper.insertWorkProject(workProject);
    }

    /**
     * 修改项目管理
     * 
     * @param workProject 项目管理
     * @return 结果
     */
    @Override
    public int updateWorkProject(WorkProject workProject)
    {
        workProject.setUpdateTime(DateUtils.getNowDate());
        return workProjectMapper.updateWorkProject(workProject);
    }

    /**
     * 批量删除项目管理
     * 
     * @param projectIds 需要删除的项目管理主键
     * @return 结果
     */
    @Override
    public int deleteWorkProjectByProjectIds(Long[] projectIds)
    {
        return workProjectMapper.deleteWorkProjectByProjectIds(projectIds);
    }

    /**
     * 删除项目管理信息
     * 
     * @param projectId 项目管理主键
     * @return 结果
     */
    @Override
    public int deleteWorkProjectByProjectId(Long projectId)
    {
        return workProjectMapper.deleteWorkProjectByProjectId(projectId);
    }
}
