dongoewang commented on issue #30600:
URL: 
https://github.com/apache/shardingsphere/issues/30600#issuecomment-2017380623

   > @dongoewang After using the correct SQL, is it still incorrect if 
rewritten? If so, can you provide your sharding configuration?
   
   still incorrect。
   
   sharding configuration is following
   
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: sharding-data-source
         server-lists: ${zookeeper.ip}:2181
   
   dataSources:
     datasource:
       type: com.alibaba.druid.pool.DruidDataSource
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
       url: 
${store.datasource.ip}:3306/${store.datasource.oa}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
       username: ${store.datasource.username}
       password: ${store.datasource.password}
       driverClassName: com.mysql.cj.jdbc.Driver
       # 初始化,最小,最大连接数
       initialSize: 3
       minidle: 3
       maxActive: 18
       # 获取数据库连接等待的超时时间
       maxWait: 60000
       # 配置多久进行一次检测,检测需要关闭的空闲连接 单位毫秒
       timeBetweenEvictionRunsMillis: 60000
       validationQuery: SELECT 1 FROM dual
   
   rules:
   - !SINGLE
       tables:
         - "*.*"
   - !SHARDING
       tables:
         kq_employee_clock_record:
           actualDataNodes: 
datasource.kq_employee_clock_record_${202403..208801}
           tableStrategy:
             standard:
               shardingColumn: clock_day
               shardingAlgorithmName: clockRecordAutoCustom
           keyGenerateStrategy:
             column: id
             keyGeneratorName: snowflake_generator
   
         kq_attendance_daily:
           actualDataNodes: datasource.kq_attendance_daily_${202403..208801}
           tableStrategy:
             standard:
               shardingColumn: attendance_date
               shardingAlgorithmName: clockRecordAutoCustom
           keyGenerateStrategy:
             column: id
             keyGeneratorName: snowflake_generator
   
         kq_attendance_daily_clock:
           actualDataNodes: 
datasource.kq_attendance_daily_clock_${202403..208801}
           tableStrategy:
             standard:
               shardingColumn: attendance_date
               shardingAlgorithmName: clockRecordAutoCustom
           keyGenerateStrategy:
             column: id
             keyGeneratorName: snowflake_generator
   
         kq_attendance_daily_reset:
           actualDataNodes: 
datasource.kq_attendance_daily_reset_${202403..208801}
           tableStrategy:
             standard:
               shardingColumn: attendance_date
               shardingAlgorithmName: clockRecordAutoCustom
           keyGenerateStrategy:
             column: id
             keyGeneratorName: snowflake_generator
   #      留着备用,复合分片用
   #      kq_attendance_daily_clock:
   #        actualDataNodes: datasource.kq_attendance_daily_clock
   #        tableStrategy:
   #          complex:
   #            shardingColumns: clock_in_time,clock_out_time
   #            shardingAlgorithmName: attendanceDailyDetailAutoCustom
   #        keyGenerateStrategy:
   #          column: id
   #          keyGeneratorName: snowflake_generator
       bindingTables:
         - kq_employee_clock_record, kq_attendance_daily, 
kq_attendance_daily_clock, kq_attendance_daily_reset
   
       shardingAlgorithms:
         clockRecordAutoCustom:
           type: CLASS_BASED
           props:
             strategy: standard
             algorithmClassName: 
com.younike.oa.shardingAlgorithm.ClockRecordAutoShardingAlgorithm
   #      留着备用,复合分片用
   #      attendanceDailyDetailAutoCustom:
   #        type: CLASS_BASED
   #        props:
   #          strategy: complex
   #          algorithmClassName: 
com.younike.oa.shardingAlgorithm.AttendanceDailyDetailComplexKeysAlgorithm
   
       keyGenerators:
         snowflake_generator:
           type: CUSTOMIZE_SNOWFLAKE
   
   
   props:
     sql-show: true
   


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