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

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.fhjw.dao.FhjwRoleFunctionDao;
import io.hmit.modules.fhjw.dto.FhjwRoleFunctionDTO;
import io.hmit.modules.fhjw.entity.FhjwRoleFunctionEntity;
import io.hmit.modules.fhjw.service.FhjwRoleFunctionService;
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-06-22
 */
@Service
public class FhjwRoleFunctionServiceImpl extends CrudServiceImpl<FhjwRoleFunctionDao, FhjwRoleFunctionEntity, FhjwRoleFunctionDTO> implements FhjwRoleFunctionService {

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

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

        return wrapper;
    }


}
