spring 静态注入

在一个静态方法中使用自动注入的对象

public class CommonUtil {
    
    // log:注册日志
    private static Log log = LogFactory.getLog(CommonUtil.class);
    @Autowired
    private SlssjcMapper slssjcMapper;

    private static CommonUtil commonUtil;

     public static BigDecimal getZmkc(参数) {
           commonUtil.slssjcMapper.getZmkc(参数);
    	    //相关处理
    	
    }



}

猜你喜欢

转载自blog.csdn.net/weixin_39144798/article/details/83584287
今日推荐