sevenxiyi
sevenxiyi
2017-10-17 06:59

SSM连接sqlserver获取主键重复

  • xml

日志:
update M_mouldPlace set item_no=?, warehouse=?, place=?, keeper=?, validate=?, verify=?, accept=?, status=?, remark=?, lastEditNo=?, lastEditDate=? where mouldID = ?
08:34:20.663 [http-bio-8080-exec-3] DEBUG c.c.d.M.editMouldPlace - ==> Parameters: 566(String), 5555(String), 666(String), 333(String), 66633(String), 322(String), 11133(String), 22000(String), 000(String), 777(String), 2017-10-16(String), 10033,10033(String)
08:34:20.695 [http-bio-8080-exec-3] DEBUG c.c.d.M.editMouldPlace - <== Updates: 0
--为什么主键出现了两个10033,10033,导致update失败,删除也是这样
xml文件:

update M_mouldPlace

<!-- item_no = #{item_no,jdbcType=VARCHAR},
warehouse = #{warehouse,jdbcType=VARCHAR},
place = #{place,jdbcType=VARCHAR},
keeper = #{keeper,jdbcType=VARCHAR},
validate = #{validate,jdbcType=VARCHAR},
verify = #{verify,jdbcType=VARCHAR},
accept = #{accept,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
lastEditNo = #{lastEditNo,jdbcType=VARCHAR},
lastEditDate = #{lastEditDate,jdbcType=TIMESTAMP} -->
item_no=#{item_no,jdbcType=VARCHAR},
warehouse=#{warehouse,jdbcType=VARCHAR},
place=#{place,jdbcType=VARCHAR},
keeper=#{keeper,jdbcType=VARCHAR},
validate=#{validate,jdbcType=VARCHAR},
verify=#{verify,jdbcType=VARCHAR},
accept=#{accept,jdbcType=VARCHAR},
status=#{status,jdbcType=VARCHAR},
remark=#{remark,jdbcType=VARCHAR},
lastEditNo=#{lastEditNo,jdbcType=VARCHAR},
lastEditDate=#{lastEditDate,jdbcType=TIMESTAMP},

where mouldID = #{mouldID}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答