登录
首页 >  文章 >  java教程

SQL语法错误:PnMapperRuKu.xml文件中insert语句的逗号问题怎么解决?

时间:2024-12-07 11:21:50 209浏览 收藏

欢迎各位小伙伴来到golang学习网,相聚于此都是缘哈哈哈!今天我给大家带来《SQL语法错误:PnMapperRuKu.xml文件中insert语句的逗号问题怎么解决?》,这篇文章主要讲到等等知识,如果你对文章相关的知识非常感兴趣或者正在自学,都可以关注我,我会持续更新相关文章!当然,有什么建议也欢迎在评论留言提出!一起学习!

SQL语法错误:PnMapperRuKu.xml文件中insert语句的逗号问题怎么解决?

sqlexception:语法错误

错误原因:

代码块中出现的类似“name后的 ,”实际应为“name后应缺失 ,”。

具体问题:

pnmapperruku.xml文件中的insertpnassertrukudetails方法中,insert语句中storageroom列后跟着一个多余的逗号。

正确语句:

<insert id="insertPnAssertRukuDetails" parameterType="com.ruoyi.system.domain.PnModelInOutInventory">
        insert into pnAssertRukuDetails (
     <if test="parentPnAssertRukuId != null and parentPnAssertRukuId != '' ">parent_pnAssertRuku_id,</if>
     <if test="materialInformation != null and materialInformation != '' ">materialInformation,</if>
     <if test="numbersRuKu != null and numbersRuKu != '' ">numbersRuKu,</if>
     <if test="qualified != null and qualified != '' ">qualified,</if>
     <if test="unit != null and unit != '' ">unit,</if>
     <if test="storageRoom != null and storageRoom != ''">storageRoom</if>
     <if test="sn != null and sn != ''">sn,</if>
     <if test="remark != null and remark != ''">remark,</if>
     <if test="batchNumber != null and batchNumber != ''">batchNumber,</if>
    )values(
     <if test="parentPnAssertRukuId != null and parentPnAssertRukuId != '' ">#{parentPnAssertRukuId},</if>
     <if test="materialInformation != null and materialInformation != '' ">#{materialInformation},</if>
     <if test="numbersRuKu != null and numbersRuKu != '' ">#{numbersRuKu},</if>
     <if test="qualified != null and qualified != '' ">#{qualified},</if>
     <if test="unit != null and unit != '' ">#{unit},</if>
     <if test="storageRoom != null and storageRoom != ''">#{storageRoom},</if>
     <if test="sn != null and sn != ''">#{sn},</if>
     <if test="remark != null and remark != ''">#{remark},</if>
     <if test="batchNumber != null and batchNumber != ''">#{batchNumber},</if>
    )
</insert>

到这里,我们也就讲完了《SQL语法错误:PnMapperRuKu.xml文件中insert语句的逗号问题怎么解决?》的内容了。个人认为,基础知识的学习和巩固,是为了更好的将其运用到项目中,欢迎关注golang学习网公众号,带你了解更多关于的知识点!

相关阅读
更多>
最新阅读
更多>
课程推荐
更多>