924438567 opened a new issue, #18536:
URL: https://github.com/apache/shardingsphere/issues/18536

   mybatis3.5.9 + sharding jdbc5.1.1
   
   
   spring:
     shardingsphere:
       datasource:
         names: ds0
         ds0:
           url: jdbc:mysql://localhost:3306/data_op
           username: root
           password: 9244
           driver-class-name: com.mysql.cj.jdbc.Driver
           type: com.zaxxer.hikari.HikariDataSource
       rules:
         sharding:
           tables:
             qy_barrage: #要分表的名称
               actual-data-nodes: ds0.qy_barrage_$->{['aaa', 
'sss111']}_$->{2022..9999}   #表示 从连接名为master的库中的sys_user_0到sys_user_1号表查询
               table-strategy:
                 standard:
                   sharding-column: cus_no,send_time     #用id 这列来取模
                   sharding-algorithm-name: complexDsAlgorithm   #取模的算法名称
               key-generator:
                 # 主键名
                 column: id
                 # 雪花算法生成
                 type: SNOWFLAKE
           sharding-algorithms:
             complexDsAlgorithm:
               props:
                 sharding-columns: cus_no,send_time
                 algorithm-expression: 
qy_barrage_$->{cus_no}_$->{send_time.split("-")[0]}
               type: COMPLEX_INLINE
       props:
         sql-show: true
   mybatis:
     mapper-locations: classpath:mapper/*.xml


-- 
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