

package com.lideeyunji.tool.framework.yunji.component.mybatis;

import com.lideeyunji.tool.framework.yunji.utils.FuncBase;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.wrapper.MapWrapper;

import java.util.Map;

public class CustomWrapper extends MapWrapper {

    public CustomWrapper(MetaObject metaObject, Map<String, Object> map) {
        super(metaObject, map);
    }

    @Override
    public String findProperty(String name, boolean useCamelCaseMapping) {
        if(FuncBase.isEmpty(name)){
            return name;
        }
        String nameUpper = name.toUpperCase();
        if(FuncBase.equals(name,nameUpper)){//将全大写转为小写
            return name.toLowerCase();
        }
        return name;
    }
}
