void updateVMIQuantityParamvmiMaterialDocuments ListVmiMaterialDocument vmiMaterialDocuments; update id=updateVMIQuantity parameterType=javautilList foreach collection=vmiMaterialDocuments i
该错误是因为在执行SQL语句时出现了SQL注入的风险。 在上述代码中,使用了动态SQL的foreach标签来循环更新vmi_materialdocument表中的数据。然而,这种方式可能存在安全风险,因为它允许构造恶意的SQL语句来执行其他非法操作。
为了解决该问题,可以使用预编译的SQL语句来执行更新操作,以避免SQL注入的风险。以下是修改后的代码示例:
void updateVMIQuantity(@Param("vmiMaterialDocuments") List
请注意,这里的#{item.automaticConsume}和#{item.materialDocument}是预编译的参数,会被安全地转义,从而防止SQL注入攻击
原文地址: https://www.cveoy.top/t/topic/iM4l 著作权归作者所有。请勿转载和采集!