448700174 commented on issue #12517:
URL: 
https://github.com/apache/shardingsphere/issues/12517#issuecomment-922236122


   2021-09-18 15:36:20.564 [http-nio-8099-exec-4] INFO  ShardingSphere-SQL - 
Logic SQL: SELECT
       cod.*,
       cc.category,
       cc.category_type,
       cc.category_title,
       cg.goods_title,
       cg.evidence
       FROM
       care_order_detail cod
       left join care_goods cg on cg.id = cod.goods_id
       left join care_category cc on cc.id = cg.category_id
       WHERE 1=1
       AND cod.id = ?
       and cod.tenant_id = ?
   2021-09-18 15:36:20.564 [http-nio-8099-exec-4] INFO  ShardingSphere-SQL - 
SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty, 
window=Optional.empty)
   2021-09-18 15:36:20.564 [http-nio-8099-exec-4] INFO  ShardingSphere-SQL - 
Actual SQL: ds ::: SELECT
       cod.*,
       cc.category,
       cc.category_type,
       cc.category_title,
       cg.goods_title,
       cg.evidence
       FROM
       care_order_detail_12 cod
       left join care_goods cg on cg.id = cod.goods_id
       left join care_category cc on cc.id = cg.category_id
       WHERE 1=1
       AND cod.id = ?
       and cod.tenant_id = ? ::: [2981, 12]
   
   My config is:
            sharding:
               key-generators:
                  snowflake:
                     type: SNOWFLAKE
                     props:
                        worker-id: 123
               sharding-algorithms:
                  tenant-id-sharding:
                     type: CLASS_BASED
                     props:
                        strategy: STANDARD
                        algorithmClassName: 
com.youban.common.dao.TenantIdShardingAlgorithm
               binding-tables:
                  - care_task,care_task_item,care_task_detail
                  - care_patrol_task,care_patrol_subtask,care_patrol_item
               tables:
                  care_task:
                     actual-data-nodes: ds.care_task_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
                  care_task_detail:
                     actual-data-nodes: ds.care_task_detail_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
                  care_task_item:
                     actual-data-nodes: ds.care_task_item_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
                  care_patrol_task:
                     actual-data-nodes: ds.care_patrol_task_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
                  care_patrol_item:
                     actual-data-nodes: ds.care_patrol_item_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
                  care_patrol_subtask:
                     actual-data-nodes: ds.care_patrol_subtask_$->{1..99}
                     table-strategy:
                        sharding-column: tenant_id
                        sharding-algorithm-name: tenant-id-sharding
                  care_order_detail:
                     actual-data-nodes: ds.care_order_detail_$->{1..99}
                     table-strategy:
                        standard:
                           sharding-column: tenant_id
                           sharding-algorithm-name: tenant-id-sharding
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to