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.LabViolationRecordMapper;
import com.zd.laboratory.domain.LabViolationRecord;
import com.zd.laboratory.service.ILabViolationRecordService;

/**
 * 违规记录Service业务层处理
 * 
 * @author zd
 * @date 2021-12-14
 */
@Service
public class LabViolationRecordServiceImpl implements ILabViolationRecordService 
{
    @Autowired
    private LabViolationRecordMapper labViolationRecordMapper;

    /**
     * 查询违规记录
     * 
     * @param id 违规记录主键
     * @return 违规记录
     */
    @Override
    public LabViolationRecord selectLabViolationRecordById(Long id)
    {
        return labViolationRecordMapper.selectLabViolationRecordById(id);
    }

    /**
     * 查询违规记录列表
     * 
     * @param labViolationRecord 违规记录
     * @return 违规记录
     */
    @Override
    public List<LabViolationRecord> selectLabViolationRecordList(LabViolationRecord labViolationRecord)
    {
        return labViolationRecordMapper.selectLabViolationRecordList(labViolationRecord);
    }

    /**
     * 新增违规记录
     * 
     * @param labViolationRecord 违规记录
     * @return 结果
     */
    @Override
    public int insertLabViolationRecord(LabViolationRecord labViolationRecord)
    {
        //设置其他公共字段
        SaveUtil.setCommonAttr(labViolationRecord);
        return labViolationRecordMapper.insertLabViolationRecord(labViolationRecord);
    }

    /**
     * 修改违规记录
     * 
     * @param labViolationRecord 违规记录
     * @return 结果
     */
    @Override
    public int updateLabViolationRecord(LabViolationRecord labViolationRecord)
    {
        return labViolationRecordMapper.updateLabViolationRecord(labViolationRecord);
    }

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

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