package com.zd.laboratory.service.impl;

import java.util.List;
import com.zd.common.core.utils.DateUtils;
import com.zd.common.security.utils.SaveUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zd.laboratory.mapper.LabViolationHistoryRecordMapper;
import com.zd.laboratory.domain.LabViolationHistoryRecord;
import com.zd.laboratory.service.ILabViolationHistoryRecordService;

/**
 * 违规历史记录Service业务层处理
 * 
 * @author zd
 * @date 2021-12-14
 */
@Service
public class LabViolationHistoryRecordServiceImpl implements ILabViolationHistoryRecordService 
{
    @Autowired
    private LabViolationHistoryRecordMapper labViolationHistoryRecordMapper;

    /**
     * 查询违规历史记录
     * 
     * @param id 违规历史记录主键
     * @return 违规历史记录
     */
    @Override
    public LabViolationHistoryRecord selectLabViolationHistoryRecordById(Long id)
    {
        return labViolationHistoryRecordMapper.selectLabViolationHistoryRecordById(id);
    }

    /**
     * 查询违规历史记录列表
     * 
     * @param labViolationHistoryRecord 违规历史记录
     * @return 违规历史记录
     */
    @Override
    public List<LabViolationHistoryRecord> selectLabViolationHistoryRecordList(LabViolationHistoryRecord labViolationHistoryRecord)
    {
        return labViolationHistoryRecordMapper.selectLabViolationHistoryRecordList(labViolationHistoryRecord);
    }

    /**
     * 新增违规历史记录
     * 
     * @param labViolationHistoryRecord 违规历史记录
     * @return 结果
     */
    @Override
    public int insertLabViolationHistoryRecord(LabViolationHistoryRecord labViolationHistoryRecord)
    {
        //设置其他公共字段
        SaveUtil.setCommonAttr(labViolationHistoryRecord);
        return labViolationHistoryRecordMapper.insertLabViolationHistoryRecord(labViolationHistoryRecord);
    }

    /**
     * 修改违规历史记录
     * 
     * @param labViolationHistoryRecord 违规历史记录
     * @return 结果
     */
    @Override
    public int updateLabViolationHistoryRecord(LabViolationHistoryRecord labViolationHistoryRecord)
    {
        return labViolationHistoryRecordMapper.updateLabViolationHistoryRecord(labViolationHistoryRecord);
    }

    /**
     * 批量删除违规历史记录
     * 
     * @param ids 需要删除的违规历史记录主键
     * @return 结果
     */
    @Override
    public int deleteLabViolationHistoryRecordByIds(Long[] ids)
    {
        return labViolationHistoryRecordMapper.deleteLabViolationHistoryRecordByIds(ids);
    }

    /**
     * 删除违规历史记录信息
     * 
     * @param id 违规历史记录主键
     * @return 结果
     */
    @Override
    public int deleteLabViolationHistoryRecordById(Long id)
    {
        return labViolationHistoryRecordMapper.deleteLabViolationHistoryRecordById(id);
    }
}
