mybatis中insert into ...select ...from dual union all select ... from dual 提示sql命令未结束的问题

需要在插入时加上useGeneratedKeys="false"

原Mapper:

	 
	 	INSERT INTO AMC_PRODUCT_ROLE_USER
	   		(user_id, role_id)
		
			SELECT 
				#{productRole.user_id,jdbcType=VARCHAR},
				#{productRole.role_id,jdbcType=VARCHAR} 
			FROM DUAL
		 
    

新Mapper:

	 
	 	INSERT INTO AMC_PRODUCT_ROLE_USER
	   		(user_id, role_id)
		
			SELECT 
				#{productRole.user_id,jdbcType=VARCHAR},
				#{productRole.role_id,jdbcType=VARCHAR} 
			FROM DUAL
		 
    


你可能感兴趣的:(MyBatis)