class CreateTimeShardingDatabaseAlgorithm implements PreciseShardingAlgorithm<Long>, RangeShardingAlgorithm {


    @Override
    public String doSharding(Collection<String> collection, PreciseShardingValue<Long> preciseShardingValue) {<FILL_FUNCTION_BODY>}

    @Override
    public Collection<String> doSharding(Collection collection, RangeShardingValue rangeShardingValue) {
        Collection<String> collect = new ArrayList<>();
        Range<Integer> valueRange = rangeShardingValue.getValueRange();

        //开始年份结束年份
        String start = DateUtil.toString(valueRange.lowerEndpoint().longValue(), "yyyy");
        String end = DateUtil.toString(valueRange.upperEndpoint().longValue(), "yyyy");
        //循环增加区间的查询条件
        for (Integer i = Integer.valueOf(start); i <= Integer.valueOf(end); i++) {
            collect.add("data" + i);
        }
        return collect;
    }
}

        Long createTime = preciseShardingValue.getValue();
        String value = DateUtil.toString(createTime, "yyyy");
        //data2019,data2020
        return "data" + value;
    
<no_super_class>