package com.zcloud.modules.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zcloud.common.utils.PageUtils;
import com.zcloud.modules.mall.dao.BusFeedbackMallDao;
import com.zcloud.modules.mall.entity.BusFeedbackMallEntity;
import com.zcloud.modules.mall.service.BusFeedbackMallService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("feedbackService")
public class BusFeedbackMallServiceImpl extends ServiceImpl<BusFeedbackMallDao, BusFeedbackMallEntity> implements BusFeedbackMallService {

	@Override
	public List<BusFeedbackMallEntity> listByQueryWrapper(QueryWrapper wrapper) {
		return baseMapper.selectList(wrapper);
	}

	@Override
	public BusFeedbackMallEntity findById(String teacherId) {
		return baseMapper.selectById(teacherId);
	}

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		Page<Map<String,Object>> page = new Page<>(Integer.parseInt(params.get("curPage").toString()),Integer.parseInt(params.get("limit").toString()));
		params.put("isDelete",0);
		IPage<BusFeedbackMallEntity> ipage = baseMapper.listPage(page,params);
		return new PageUtils(ipage);
	}
}
