步步Bubu
2019-10-15 23:05
Caused by: org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 65; 必须为元素类型 "insert" 声明属性 "useGeneratedkeys"。
<mapper>文件
<insert id="insertCommodity" useGeneratedkeys="true" keyProperty="commodityId" keyColum="commodity_id" parameteerType="com.seer.demoshop.entity.Commodity"> INSERT INTO commodity(commodity_id,commodity_name,commodity_sales,create_time,last_edit_time) VALUE (#{commodityId},#{commodityName},#{commoditySales},#{createTime},#{lastEditTime}) </insert> <update id="updateCommodityId" resultType="com.seer.demoshop.entity.Commodity"> UPDATE commodity <set> <if test="commodityName!=null">commodity_name=#{commodityName},</if> <if test="commoditySales!=null">commodity_sales=#{commoditySales},</if> <if test="lastEditTime!=null">last_edit_time=#{lastEditTime}</if> </set> WHERE commodity_id=#{commodityId} </update> <delete id="deleteCommodity"> DELETE FROM commodity WHERE commodity_id=#{commodityId} </delete>
同学好,请仔细区分大小写,是useGeneratedKeys 而非
useGeneratedkeys
SpringBoot+MyBatis搭建迷你小程序
91500 学习 · 621 问题
相似问题