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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.demo.dao.CustomersDao;
import io.renren.modules.demo.dto.CustomersDTO;
import io.renren.modules.demo.entity.CustomersEntity;
import io.renren.modules.demo.service.CustomersService;
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 CustomersServiceImpl extends CrudServiceImpl<CustomersDao, CustomersEntity, CustomersDTO> implements CustomersService {

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

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

        return wrapper;
    }


}