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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.sys.dao.AdvertOauthAccountDao;
import io.renren.modules.sys.dto.AdvertOauthAccountDTO;
import io.renren.modules.sys.entity.AdvertOauthAccountEntity;
import io.renren.modules.sys.service.AdvertOauthAccountService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 授权账号表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2022-06-03
 */
@Service
public class AdvertOauthAccountServiceImpl extends CrudServiceImpl<AdvertOauthAccountDao, AdvertOauthAccountEntity, AdvertOauthAccountDTO> implements AdvertOauthAccountService {

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

        QueryWrapper<AdvertOauthAccountEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id).eq("status",1).orderByDesc("id");

        return wrapper;
    }


}