update xzx_user_address_info set flag="0" where mobile_phone=#{mobilePhone} and address_id!=#{addressId} update xzx_user_address_info set del_flag="1" where address_id=#{addressId} update xzx_user_address_info a set a.flag="1" where a.address_id = ( select c.minid from (select min(b.address_id) as minid from xzx_user_address_info b where b.del_flag='0' and b.user_id=#{userId})c)