package com.multictrl.modules.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.multictrl.common.service.impl.CrudServiceImpl;
import com.multictrl.modules.business.dao.AiWarningDao;
import com.multictrl.modules.business.dto.AiWarningDTO;
import com.multictrl.modules.business.entity.AiWarningEntity;
import com.multictrl.modules.business.service.AiWarningService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * AI识别预警
 *
 * @author Sdy
 * @since 1.0.0 2026-06-18
 */
@Service
public class AiWarningServiceImpl extends CrudServiceImpl<AiWarningDao, AiWarningEntity, AiWarningDTO> implements AiWarningService {

    @Override
    public QueryWrapper<AiWarningEntity> getWrapper(Map<String, Object> params) {
        String id = (String) params.get("id");
        String status = (String) params.get("status");

        QueryWrapper<AiWarningEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);
        wrapper.eq(StrUtil.isNotBlank(status), "status", status);
        wrapper.orderByDesc("create_date");

        return wrapper;
    }


}