package io.renren.service.impl;

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.service.impl.CrudServiceImpl;
import io.renren.dao.CompaniesDao;
import io.renren.dto.CompaniesDTO;
import io.renren.entity.CompaniesEntity;
import io.renren.service.CompaniesService;

/**
 * 公司表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2022-05-29
 */
@Service
public class CompaniesServiceImpl extends CrudServiceImpl<CompaniesDao, CompaniesEntity, CompaniesDTO> implements CompaniesService {

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

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

        return wrapper;
    }


}