MyBatis 插入空值时,需要指定JdbcType
mybatis insert空值报空值异常,但是在pl/sql不会提示错误,主要原因是mybatis无法进行转换
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
insert into
instruments
(group_name,
name,
description,
on_line,
operator,
x_sbxh,
serial_no,
x_lc,
x_sbjd,
vendor,
location,
changed_on,
changed_by,
removed,
low_threshold,
high_threshold,
stability_delta,
stability_number,
port_number,
discard_time,
size_limit,
time_out,
polling_time,
needs_calibration,
needs_pm,
holds_samples,
include_subdirs,
debug,
store_in_db_file,
db_file_prompt,
x_jlsx,
x_funcheck_status,
x_timecheck_status,
x_name,
x_description,
x_funcheck_date,
x_timecheck_date,
pm_date,
x_pm_status,
x_status,
x_group_name
) values(
#{group_name,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{on_line,jdbcType=VARCHAR},
#{operator,jdbcType=VARCHAR},
#{x_sbxh,jdbcType=VARCHAR},
#{serial_no,jdbcType=VARCHAR},
#{x_lc,jdbcType=VARCHAR},
#{x_sbjd,jdbcType=VARCHAR},
#{vendor,jdbcType=VARCHAR},
#{location,jdbcType=VARCHAR},
#{changed_on,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
#{changed_by,jdbcType=VARCHAR},
'F'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'F'
,
'F'
,
'F'
,
'F'
,
'F'
,
'F'
,
'F'
,
'T'
,
'F'
,
'F'
,
#{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{x_funcheck_date,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
#{x_timecheck_date,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
#{pm_date,javaType=String,jdbcType=DATE,typeHandler=com.labway.portal.handler.LwDateTypeHandler},
#{x_pm_status,jdbcType=VARCHAR},
#{x_status,jdbcType=VARCHAR},
#{x_group_name,jdbcType=VARCHAR}
)
|