JAVA EXCETION
1.使用easyexcel导出excel 身份证字段,显示乱码
@ContentStyle(dataFormat = 49)
private String idCard;
2.mybatis默认0和""相等
<if test="state!=null and state!='' or state==0">state = #{state},</if>
//或者把判断是否为空字符串去掉,变为:
<if test="state!=null">state = #{state},</if>
或者将0转化为String类型,也可以解决该问题
3. case when 统计的数据不准
显示数据是不正确的,把else后面的0改成null
4. restTemplate 请求参数为null,会被过滤掉
看源码分析
formData.forEach((name, values) -> {
if (name == null) {
Assert.isTrue(CollectionUtils.isEmpty(values), "Null name in form data: " + formData);
} else {
values.forEach((value) -> {
try {
if (builder.length() != 0) {
builder.append('&');
}
builder.append(URLEncoder.encode(name, charset.name()));
if (value != null) {
builder.append('=');
builder.append(URLEncoder.encode(String.valueOf(value), charset.name()));
}
} catch (UnsupportedEncodingException var5) {
throw new IllegalStateException(var5);
}
});
}
});