ushouldup 2021-10-01 22:33 采纳率: 80%
浏览 44
已结题

mybatis报错,You have an error in your SQL syntax;

img

img


自认为写的貌似没问题,不知道为啥报错,难道是空格?

<update id="updatePromotionAd" parameterType="com.lagou.domain.PromotionAd">
        update 'promotion_ad'
        <set>
            <if test="name != null">
                name = #{name},
            </if>
            <if test="spaceId != null">
                spaceId = #{spaceId},
            </if>
            <if test="keyword != null">
                keyword = #{keyword},
            </if>
            <if test="htmlContent != null">
                htmlContent = #{htmlContent},
            </if>
            <if test="text != null">
                text = #{text},
            </if>
            <if test="link != null">
                link = #{link},
            </if>
            <if test="startTime != null">
                startTime = #{startTime},
            </if>
            <if test="endTime != null">
                endTime = #{endTime},
            </if>
            <if test="updateTime != updateTime">
                updateTime = #{updateTime},
            </if>
            <if test="status != null">
                status = #{status},
            </if>
            <if test="priority != null">
                priority = #{priority},
            </if>
            <if test="img != null">
                img = #{img},
            </if>
        </set>
        <where>
            <if test="id != null">
                id = #{id}
            </if>
        </where>
    </update>


  • 写回答

1条回答 默认 最新

  • weixin_42346558 2021-10-01 22:47
    关注

    update 'promotion_ad'换成update promotion_ad或者update promotion_ad

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 10月9日
  • 已采纳回答 10月1日
  • 创建了问题 10月1日

悬赏问题

  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退