package com.srs.diagnostic.service.impl;

import java.util.List;
import com.srs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.diagnostic.mapper.DiaReportsMapper;
import com.srs.diagnostic.domain.DiaReports;
import com.srs.diagnostic.service.IDiaReportsService;

/**
 * 诊断报告基础信息Service业务层处理
 *
 * @author srs
 * @date 2025-03-21
 */
@Service
public class DiaReportsServiceImpl extends ServiceImpl<DiaReportsMapper,DiaReports> implements IDiaReportsService {
    @Autowired
    private DiaReportsMapper diaReportsMapper;

    /**
     * 查询诊断报告基础信息
     *
     * @param reportId 诊断报告基础信息主键
     * @return 诊断报告基础信息
     */
    @Override
    public DiaReports selectDiaReportsByReportId(int reportId) {
        return diaReportsMapper.selectDiaReportsByReportId(reportId);
    }

    /**
     * 查询诊断报告基础信息列表
     *
     * @param diaReports 诊断报告基础信息
     * @return 诊断报告基础信息
     */
    @Override
    public List<DiaReports> selectDiaReportsList(DiaReports diaReports) {
        return diaReportsMapper.selectDiaReportsList(diaReports);
    }
   public List<DiaReports> getNameList(DiaReports diaReports){
        return  diaReportsMapper.getNameList(diaReports);
    }
    /**
     * 新增诊断报告基础信息
     *
     * @param diaReports 诊断报告基础信息
     * @return 结果
     */
    @Override
    public int insertDiaReports(DiaReports diaReports) {
                diaReports.setCreateTime(DateUtils.getNowDate());
            return diaReportsMapper.insertDiaReports(diaReports);
    }

    /**
     * 修改诊断报告基础信息
     *
     * @param diaReports 诊断报告基础信息
     * @return 结果
     */
    @Override
    public int updateDiaReports(DiaReports diaReports) {
                diaReports.setUpdateTime(DateUtils.getNowDate());
        return diaReportsMapper.updateDiaReports(diaReports);
    }

    /**
     * 批量删除诊断报告基础信息
     *
     * @param reportIds 需要删除的诊断报告基础信息主键
     * @return 结果
     */
    @Override
    public int deleteDiaReportsByReportIds(int[] reportIds) {
        return diaReportsMapper.deleteDiaReportsByReportIds(reportIds);
    }

    /**
     * 删除诊断报告基础信息信息
     *
     * @param reportId 诊断报告基础信息主键
     * @return 结果
     */
    @Override
    public int deleteDiaReportsByReportId(int reportId) {
        return diaReportsMapper.deleteDiaReportsByReportId(reportId);
    }

    @Override
    public List<DiaReports> xlkList() {
        return diaReportsMapper.xlkList();
    }
}
