package com.platform.modules.sensitiveword.service.impl;

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

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.platform.common.utils.PageUtils;
import com.platform.common.utils.Query;
import com.platform.modules.sensitiveword.dao.SensitiveStopWordDao;
import com.platform.modules.sensitiveword.entity.SensitiveStopWordEntity;
import com.platform.modules.sensitiveword.service.SensitiveStopWordService;

@Service("sensitiveStopWordService")
public class SensitiveStopWordServiceImpl extends ServiceImpl<SensitiveStopWordDao, SensitiveStopWordEntity>
		implements
			SensitiveStopWordService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		EntityWrapper<SensitiveStopWordEntity> wrapper = new EntityWrapper<>();
		wrapper.eq("is_delete", 0);
		Page<SensitiveStopWordEntity> page = this.selectPage(new Query<SensitiveStopWordEntity>(params).getPage(),
				wrapper);

		return new PageUtils(page);
	}

	@Override
	public List<SensitiveStopWordEntity> queryAll() {
		EntityWrapper<SensitiveStopWordEntity> wrapper = new EntityWrapper<>();
		wrapper.eq("is_delete", 0);
		return selectList(wrapper);
	}

}
