package io.renren.service.impl;

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

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

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

import io.renren.common.constant.Constant;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.dao.CallBackDao;
import io.renren.dto.CallBackDTO;
import io.renren.entity.CallBackEntity;
import io.renren.service.CallBackService;

/**
 * 反馈表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2022-05-29
 */
@Service
public class CallBackServiceImpl extends CrudServiceImpl<CallBackDao, CallBackEntity, CallBackDTO> implements CallBackService {

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

        QueryWrapper<CallBackEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }

    @Override
    public List<CallBackEntity> taskQueryDate() {
    	QueryWrapper<CallBackEntity> qw = new QueryWrapper<>();
    	qw.eq("is_push", Constant.PushStatus.UN_PUSH.getValue());
    	qw.eq("status", Constant.Status.ENABLE.getValue());
		List<CallBackEntity> selectList = baseDao.selectList(qw);
		return selectList;
    }
}