package io.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.modules.item.dao.SlidesDao;
import io.modules.item.dto.SlidesDTO;
import io.modules.item.entity.SlidesEntity;
import io.modules.item.service.SlidesService;
import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 轮播图

 */
@Service
public class SlidesServiceImpl extends CrudServiceImpl<SlidesDao, SlidesEntity, SlidesDTO> implements SlidesService {

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

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

        return wrapper;
    }


}
