package com.cmvr.aima.service.impl;

import java.util.List;
import java.util.UUID;
import com.baomidou.mybatisplus.spring.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cmvr.common.utils.DateUtils;
import com.cmvr.common.utils.SecurityUtils;
import com.cmvr.aima.mapper.AimaTestLogMapper;
import com.cmvr.aima.domain.AimaTestLog;
import com.cmvr.aima.service.IAimaTestLogService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 爱玛测试日志Service业务层处理
 * 
 * @author cmvr-iot
 * @since 2026-06-22
 */
@Service
@Transactional
public class AimaTestLogServiceImpl extends ServiceImpl<AimaTestLogMapper, AimaTestLog> implements IAimaTestLogService {
    @Autowired
    private AimaTestLogMapper aimaTestLogMapper;

    @Override
    public AimaTestLog selectAimaTestLogById(String id) {
        return aimaTestLogMapper.selectAimaTestLogById(id);
    }

    @Override
    public List<AimaTestLog> selectAimaTestLogList(AimaTestLog aimaTestLog) {
        return aimaTestLogMapper.selectAimaTestLogList(aimaTestLog);
    }

    @Override
    public int insertAimaTestLog(AimaTestLog aimaTestLog) {
        if (aimaTestLog.getId() == null || aimaTestLog.getId().isEmpty()) {
            aimaTestLog.setId(UUID.randomUUID().toString().replace("-", ""));
        }
        aimaTestLog.setCreateTime(DateUtils.getNowDate());
        return aimaTestLogMapper.insertAimaTestLog(aimaTestLog);
    }

    @Override
    public int updateAimaTestLog(AimaTestLog aimaTestLog) {
        aimaTestLog.setUpdateTime(DateUtils.getNowDate());
        return aimaTestLogMapper.updateAimaTestLog(aimaTestLog);
    }

    @Override
    public int deleteAimaTestLogByIds(String[] ids) {
        return aimaTestLogMapper.deleteAimaTestLogByIds(ids);
    }

    @Override
    public int deleteAimaTestLogById(String id) {
        return aimaTestLogMapper.deleteAimaTestLogById(id);
    }
}
