package io.renren.modules.generator.service.impl;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.VolumesDao;
import io.renren.modules.generator.entity.VolumesEntity;
import io.renren.modules.generator.service.VolumesService;


@Service("volumesService")
public class VolumesServiceImpl extends ServiceImpl<VolumesDao, VolumesEntity> implements VolumesService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String volumesId=(String) params.get("volumesId");
        String volumesState= (String) params.get("volumesState");
        String volumesMount= (String) params.get("volumesMount");
        System.out.println(volumesMount+"                          -----------------------");
        IPage<VolumesEntity> page = this.page(
                new Query<VolumesEntity>().getPage(params),
                new QueryWrapper<VolumesEntity>()
                        .like(StringUtils.isNotBlank(volumesId),"volumes_id",volumesId)
                .eq(StringUtils.isNotBlank(volumesState),"volumes_state",volumesState)
                .eq(StringUtils.isNotBlank(volumesMount),"volumes_mount",volumesMount)

        );

        return new PageUtils(page);
    }
}