package io.hmit.modules.serviceOrder.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionServiceTypeDao;
import io.hmit.modules.serviceOrder.dto.PensionServiceTypeDTO;
import io.hmit.modules.serviceOrder.entity.PensionServiceTypeEntity;
import io.hmit.modules.serviceOrder.service.PensionServiceTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 服务种类表
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2021-01-26
 */
@Service
public class PensionServiceTypeServiceImpl extends CrudServiceImpl<PensionServiceTypeDao, PensionServiceTypeEntity, PensionServiceTypeDTO> implements PensionServiceTypeService {

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

        QueryWrapper<PensionServiceTypeEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);
        wrapper.like(StringUtils.isNotBlank(keyword), "name", keyword);

        return wrapper;
    }


}
