package io.hmit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.dao.WlUploadInfoDao;
import io.hmit.dto.WlUploadInfoDTO;
import io.hmit.entity.WlUploadInfoEntity;
import io.hmit.service.WlUploadInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 比赛人员信息
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2020-07-16
 */
@Service
public class WlUploadInfoServiceImpl extends CrudServiceImpl<WlUploadInfoDao, WlUploadInfoEntity, WlUploadInfoDTO> implements WlUploadInfoService {

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

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

        return wrapper;
    }


    @Override
    public boolean isName(String name) {
        int count = baseDao.isName(name);
        System.out.println(count);
        if(count==0){
            return true;
        }else {
            return false;
        }
    }
}