SELECT 
    qu.id AS qy_user_id,
    qu.name AS user_name,
    qu.ab98_user_id,
    qu.corpid,
    qu.balance AS qy_balance_yuan,
    qu.use_balance AS qy_use_balance_yuan,
    qu.balance_limit AS qy_balance_limit_yuan,
    ub.balance AS ub_balance_fen,
    ub.use_balance AS ub_use_balance_fen,
    ub.balance_limit AS ub_balance_limit_fen,
    ROUND(qu.balance * 100) AS qy_balance_converted_fen,
    ROUND(qu.use_balance * 100) AS qy_use_balance_converted_fen,
    ROUND(qu.balance_limit * 100) AS qy_balance_limit_converted_fen
FROM qy_user qu
INNER JOIN user_balance ub ON (
    (qu.ab98_user_id IS NOT NULL AND ub.ab98_user_id = qu.ab98_user_id)
    OR 
    (qu.ab98_user_id IS NULL AND ub.qy_user_id = qu.id)
)
WHERE qu.deleted = 0
  AND ub.deleted = 0
  AND (
      ROUND(qu.balance * 100) != ub.balance
      OR ROUND(qu.use_balance * 100) != ub.use_balance
      OR ROUND(qu.balance_limit * 100) != ub.balance_limit
  );