package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsInspectInstanceDetailProjectMapper;
import com.hw.dms.domain.DmsInspectInstanceDetailProject;
import com.hw.dms.service.IDmsInspectInstanceDetailProjectService;

/**
 * 点巡检工单明细项目信息;质检检查每个项目的质检结果详情Service业务层处理
 *
 * @author xins
 * @date 2024-04-10
 */
@Service
public class DmsInspectInstanceDetailProjectServiceImpl implements IDmsInspectInstanceDetailProjectService
{
    @Autowired
    private DmsInspectInstanceDetailProjectMapper dmsInspectInstanceDetailProjectMapper;

    /**
     * 查询点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     *
     * @param instanceDetailProjectId 点巡检工单明细项目信息;质检检查每个项目的质检结果详情主键
     * @return 点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     */
    @Override
    public DmsInspectInstanceDetailProject selectDmsInspectInstanceDetailProjectByInstanceDetailProjectId(Long instanceDetailProjectId)
    {
        return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInstanceDetailProjectId(instanceDetailProjectId);
    }

    /**
     * 查询点巡检工单明细项目信息;质检检查每个项目的质检结果详情列表
     *
     * @param dmsInspectInstanceDetailProject 点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     * @return 点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     */
    @Override
    public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectList(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject)
    {
        return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProject);
    }

    /**
     * 新增点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     *
     * @param dmsInspectInstanceDetailProject 点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     * @return 结果
     */
    @Override
    public int insertDmsInspectInstanceDetailProject(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject)
    {
        dmsInspectInstanceDetailProject.setCreateTime(DateUtils.getNowDate());
        return dmsInspectInstanceDetailProjectMapper.insertDmsInspectInstanceDetailProject(dmsInspectInstanceDetailProject);
    }

    /**
     * 修改点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     *
     * @param dmsInspectInstanceDetailProject 点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     * @return 结果
     */
    @Override
    public int updateDmsInspectInstanceDetailProject(DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject)
    {
        dmsInspectInstanceDetailProject.setUpdateTime(DateUtils.getNowDate());
        return dmsInspectInstanceDetailProjectMapper.updateDmsInspectInstanceDetailProject(dmsInspectInstanceDetailProject);
    }

    /**
     * 批量删除点巡检工单明细项目信息;质检检查每个项目的质检结果详情
     *
     * @param instanceDetailProjectIds 需要删除的点巡检工单明细项目信息;质检检查每个项目的质检结果详情主键
     * @return 结果
     */
    @Override
    public int deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectIds(Long[] instanceDetailProjectIds)
    {
        return dmsInspectInstanceDetailProjectMapper.deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectIds(instanceDetailProjectIds);
    }

    /**
     * 删除点巡检工单明细项目信息;质检检查每个项目的质检结果详情信息
     *
     * @param instanceDetailProjectId 点巡检工单明细项目信息;质检检查每个项目的质检结果详情主键
     * @return 结果
     */
    @Override
    public int deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectId(Long instanceDetailProjectId)
    {
        return dmsInspectInstanceDetailProjectMapper.deleteDmsInspectInstanceDetailProjectByInstanceDetailProjectId(instanceDetailProjectId);
    }

    @Override
    public List<DmsInspectInstanceDetailProject> selectDmsInspectInstanceDetailProjectByInspectInstanceId(Long inspectInstanceId, Long lineStep) {
        return dmsInspectInstanceDetailProjectMapper.selectDmsInspectInstanceDetailProjectByInspectInstanceId(inspectInstanceId,lineStep);
    }
}
