package io.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import io.modules.item.dao.CategoriesDao;
import io.modules.item.dto.CategoriesDTO;
import io.modules.item.entity.CategoriesEntity;
import io.modules.item.service.CategoriesService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 商品分类表
 *
 * @author Mark #
 * @since 1.0.0 2025-02-13
 */
@Service
public class CategoriesServiceImpl extends CrudServiceImpl<CategoriesDao, CategoriesEntity, CategoriesDTO> implements CategoriesService {

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

        QueryWrapper<CategoriesEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


}
