在数据库单独执行没有任何问题,放在 mybatis xml中就一直报错
Truncated incorrect DOUBLE value: 'leadergroup'
insert into eval_employee_plan_his(employee_id,plan_id,fd_plan_detail_uuid)
select t.id,t1.fd_plan_id,t.fd_plan_detail_uuid
from eval_employee_his t
inner join eval_plan_year_detail_object t1 on t1.fd_employee_type = t.type
and t.fd_plan_detail_uuid = #{fdPlanDetailUuid,jdbcType=VARCHAR};
网上所有的解决方法都试了一遍,最后发现问题在数据库字段类型
主表eval_employee_his 中的type字段类型为int
而eval_plan_year_detail_object中的fd_employee_type类型为varchar类型
但数字类型匹配到'leadergroup'字符串,就报错了
修改方式:将eval_employee_his 中的type字段类型修改为varchar即可
mybatis中不会自动转化类型导致报错,在数据库软件navicat中执行不会暴露此问题