package com.fs.watch.service.impl;

import com.fs.watch.domain.WatchMultiLeadsEcgData;
import com.fs.watch.mapper.WatchMultiLeadsEcgDataMapper;
import com.fs.watch.service.WatchMultiLeadsEcgDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【watch_multi_leads_ecg_data(设备多导联心电图数据)】的数据库操作Service实现
* @createDate 2024-10-15 11:06:51
*/
@Service
@Slf4j
public class WatchMultiLeadsEcgDataServiceImpl implements WatchMultiLeadsEcgDataService {

    @Autowired
    private WatchMultiLeadsEcgDataMapper mapper;

    @Override
    public Boolean insert(WatchMultiLeadsEcgData watchMultiLeadsEcgData) {
        //判断创建时间是否唯一
        Integer num = mapper.queryByCreateTime(watchMultiLeadsEcgData.getCreateTime());
        if (num != null && num > 0) {
            return false;
        }
        try {
            mapper.insert(watchMultiLeadsEcgData);
        } catch (Exception e) {
            log.error("===============watchMultiLeadsEcgData:insert=========================={}", e.getMessage());
            return false;
        }
        return true;
    }
}
