在數據庫單獨執行沒有任何問題,放在 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中執行不會暴露此問題