在ServiceImpl层加载Spring配置文件进行测试
public static void main(String[] args) { Xm xm = new Xm(); Resource resource = new ClassPathResource("applicationContext-common.xml"); BeanFactory factory = new XmlBeanFactory(resource); XmServiceImpl xmServiceImpl = (XmServiceImpl) factory.getBean("xmService"); int i = xmServiceImpl.getXmByConditionCount(xm); System.out.println(i); }