插入数据时用参数进行判断

插入数据时用参数进行判断,插入哪条数据(type也是传入参数)

     update u_user_info
        <set>
            <if test="type=='QQ'">user_qq=#{account}</if>
            <if test="type=='WX'">user_weixin=#{account}</if>
            <if test="type=='WB'">user_sina=#{account}</if>
        </set>
        where user_id=#{user_id}

 

posted @ 2017-06-23 11:49  灬花生酱  阅读(280)  评论(0)    收藏  举报