插入数据时用参数进行判断,插入哪条数据(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}
插入数据时用参数进行判断,插入哪条数据(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}
转载于:https://www.cnblogs.com/hsj666/p/7069158.html