@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class Test {
@Autowired
private XshlqjService xshlqjService;
@org.junit.Test
public void test() throws ParseException {
//从数据库中取数据
Map<String, String> noAssessmentTp = xshlqjService.getNoAssessmentTp("724269254", "20190402");
// if(noAssessmentTp.size()==0){//如果取不到数据,会报空指针,因为地址值为空
// System.out.println(noAssessmentTp);
// }
if(null == noAssessmentTp || noAssessmentTp.isEmpty()){//地址值为空或者长度为空
System.out.println("空");
System.out.println(noAssessmentTp);
} else { //有地址值,长度不为空
System.out.println("不为空");
System.out.println(noAssessmentTp);
}
}
}
03-10
08-16
1114
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)