樂觀鎖xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bwie.dao.IWalletDao">
 <!--   private int  id;
    private int uid;
    private String userName;
    private int version;
    private Date createTime;
    private double money;-->




    <update id="modifyMoney" parameterType="Map" >
        update tb_wallet set money =money +#{money} ,version =1+#{version}
        where uid=#{uid} and version=#{version}
    </update>


    <select id="findWalletByUid" parameterType="int" resultType="wallet">
select * from tb_wallet where uid=#{uid}
    </select>




</mapper>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章