package com.salpa.subject.service.impl;


import com.salpa.subject.domain.MonitorDocumentDescription;
import com.salpa.subject.mapper.DocumentDescriptionMapper;
import com.salpa.subject.service.DocumentDescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DocumentDescriptionServiceImpl implements DocumentDescriptionService {

    @Autowired
    private DocumentDescriptionMapper documentDescriptionMapper;

    /**
     * 更新描述
     * @param monitorDocumentDescription
     * @return
     */
    @Override
    public int updateDescription(MonitorDocumentDescription monitorDocumentDescription) {
        int exists = documentDescriptionMapper.exists(monitorDocumentDescription);
        if (exists > 0) {
            return documentDescriptionMapper.updateDescription(monitorDocumentDescription);
        } else {
            return documentDescriptionMapper.addDescription(monitorDocumentDescription);
        }
    }
}
