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

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-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;
    }


}