sharding-jdbc分表返回数据,缺失字段

osc_57085147 发布于 04/01 13:32
阅读 113
收藏 0

@熊猫你好 你好,想跟你请教个问题: 和分表都没有关系啊。是这种情况,我对a分表,结果影响到了b的查询。上面查询b表的数据,少返回了 `loginDate`, `createUser`, `createDate`, `locked`, `enable`, `salt`, `token`这些内容,程序里面再去取这些值,那就报空指针异常了。 这些b表和分表的a一点关系都没有。
我也遇到了这个问题,怎么解决啊

加载中
0
codebank开发者
codebank开发者

表有关联,肯定会出错

osc_57085147
osc_57085147
这个是为什么。求大神指点
0
codebank开发者
codebank开发者

sharding 的数据表配置关联就可以了

 

0
osc_57085147
osc_57085147

配置文件只有这些配置

0
osc_57085147
osc_57085147

没有对其他任何配置

0
osc_57085147
osc_57085147

SELECT wo.customer_network_name as customerNetworkName,
       wo.order_sn AS orderSn,
       wog.`goods_name` AS goodsName,
       wog.`sku_name` AS skuName,
       wog.`goods_number` AS saleNumber,
       (
SELECT sum(woe.`goods_number`)  from `wxorder_order_express` as woe
 WHERE woe.order_goods_id= wog.id
   and woe.tenant_id= 16) as deliveryGoodsNumber,
         ww.name as wareName,
         ww.manager_nickname as wareManager,
         wc.name as channelName,
         wog.goods_base_sku_price as costSinglePrice,
         wc.manager_nickname as channelManager,
         (wog.money_paid-wog.refund_money)  AS shouldReceiveMoney,
         wog.refund_money AS channelRefund,
         wog.ware_refund_money AS wareRefund,
         (wog.goods_base_sku_price*wog.goods_number+ wog.ware_shipping_price)  AS cost,
         wog.channel_goods_price as channelGoodsPrice,
         wog.money_paid as moneyPaid,
         wo.create_time as orderTime
  FROM `wxorder_order` wo
  INNER JOIN `wxorder_order_goods_origin` wog ON wo.id= wog.`order_id`
   and wo.tenant_id= 16
   and wog.tenant_id= 16
  INNER JOIN wxorder_channel as wc on wc.id= wo.channel_id
  INNER JOIN wxorder_ware as ww on ww.id= wo.ware_id
  INNER JOIN wxorder_channel_goods as wcg on wcg.id= wog.channel_goods_id
 where(wo.control_status= 0
    or wo.control_status= 3)
   and TO_DAYS(NOW())  - TO_DAYS(wo.`create_time`)= 1
   and wo.`tenant_id`= 16
   and wo.channel_id in(41, 55, 61, 101, 135)

0
osc_57085147
osc_57085147

shouldReceiveMoney字段就少了

 

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部