Commit 0f129a612db2b3008ec9013513fe3d484f589473
1 parent
52122555
Exists in
master
debug code about update by id list
Showing
1 changed file
with
43 additions
and
26 deletions
Show diff stats
src/test/java/com/taover/repository/test/TestAutoconfigure.java
| @@ -4,9 +4,9 @@ import java.math.BigDecimal; | @@ -4,9 +4,9 @@ import java.math.BigDecimal; | ||
| 4 | import java.sql.Connection; | 4 | import java.sql.Connection; |
| 5 | import java.sql.PreparedStatement; | 5 | import java.sql.PreparedStatement; |
| 6 | import java.sql.SQLException; | 6 | import java.sql.SQLException; |
| 7 | +import java.util.ArrayList; | ||
| 7 | import java.util.List; | 8 | import java.util.List; |
| 8 | import java.util.Map; | 9 | import java.util.Map; |
| 9 | -import java.util.Optional; | ||
| 10 | 10 | ||
| 11 | import org.springframework.boot.SpringApplication; | 11 | import org.springframework.boot.SpringApplication; |
| 12 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 12 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| @@ -20,6 +20,7 @@ import org.springframework.jdbc.support.KeyHolder; | @@ -20,6 +20,7 @@ import org.springframework.jdbc.support.KeyHolder; | ||
| 20 | import org.springframework.scheduling.annotation.EnableScheduling; | 20 | import org.springframework.scheduling.annotation.EnableScheduling; |
| 21 | 21 | ||
| 22 | import com.taover.repository.jdbctemplate.JdbcTemplateWrapperTenant; | 22 | import com.taover.repository.jdbctemplate.JdbcTemplateWrapperTenant; |
| 23 | +import com.taover.repository.test.repository.CommonRegionRepository; | ||
| 23 | 24 | ||
| 24 | @SpringBootApplication | 25 | @SpringBootApplication |
| 25 | @EnableScheduling | 26 | @EnableScheduling |
| @@ -32,34 +33,50 @@ public class TestAutoconfigure { | @@ -32,34 +33,50 @@ public class TestAutoconfigure { | ||
| 32 | jdbcTemplateWrapperTenant = context.getBean(JdbcTemplateWrapperTenant.class); | 33 | jdbcTemplateWrapperTenant = context.getBean(JdbcTemplateWrapperTenant.class); |
| 33 | jdbcTemplate = context.getBean(JdbcTemplate.class); | 34 | jdbcTemplate = context.getBean(JdbcTemplate.class); |
| 34 | 35 | ||
| 35 | -// testBroadCast(); | ||
| 36 | - //testSelectSubQuery(); | ||
| 37 | - //select子查询包含分片表 | ||
| 38 | - //testSelectShardingSubQuery(); | ||
| 39 | - //where中包含子查询 | ||
| 40 | - //testWhereSubquery(); | ||
| 41 | - | ||
| 42 | - //testWarePaymentSelectSql(); | ||
| 43 | - //testExportPaymentDetailData(); | ||
| 44 | - //testTenantWithRootUser(); | ||
| 45 | - //testDayOrderInfoExcelData(); | ||
| 46 | - //testDayOrderInfoAPI(); | ||
| 47 | - //testWeekOrderInfoExcelData(); | ||
| 48 | - //testOrderPrintExcelData(); | ||
| 49 | - //testRefundCoreSqlForOrderList(); | ||
| 50 | - //testSelectSqlForDeliveryExcel(); | ||
| 51 | - //testDeliveryExpressNumber(); | ||
| 52 | - //testDeliveryGoodsExcel(); | ||
| 53 | - //testExcelSelectForSale(); | ||
| 54 | - //testChannelPrintSelect(); | ||
| 55 | - //testWarePaymentExport(); | ||
| 56 | - //testChannelDeliveryOrderQuery(); | ||
| 57 | - | 36 | + try { |
| 37 | + testRepository(); | ||
| 38 | + //testBroadCast(); | ||
| 39 | + //testSelectSubQuery(); | ||
| 40 | + //select子查询包含分片表 | ||
| 41 | + //testSelectShardingSubQuery(); | ||
| 42 | + //where中包含子查询 | ||
| 43 | + //testWhereSubquery(); | ||
| 44 | + | ||
| 45 | + //testWarePaymentSelectSql(); | ||
| 46 | + //testExportPaymentDetailData(); | ||
| 47 | + //testTenantWithRootUser(); | ||
| 48 | + //testDayOrderInfoExcelData(); | ||
| 49 | + //testDayOrderInfoAPI(); | ||
| 50 | + //testWeekOrderInfoExcelData(); | ||
| 51 | + //testOrderPrintExcelData(); | ||
| 52 | + //testRefundCoreSqlForOrderList(); | ||
| 53 | + //testSelectSqlForDeliveryExcel(); | ||
| 54 | + //testDeliveryExpressNumber(); | ||
| 55 | + //testDeliveryGoodsExcel(); | ||
| 56 | + //testExcelSelectForSale(); | ||
| 57 | + //testChannelPrintSelect(); | ||
| 58 | + //testWarePaymentExport(); | ||
| 59 | + //testChannelDeliveryOrderQuery(); | ||
| 60 | + | ||
| 58 | // testKeyHolder(); | 61 | // testKeyHolder(); |
| 59 | // testKeyHolderWithoutId(); | 62 | // testKeyHolderWithoutId(); |
| 60 | // testKeyHolderWithMultiInsert(); | 63 | // testKeyHolderWithMultiInsert(); |
| 61 | - //testExpressSql(); | ||
| 62 | - //testSimpleQuery(); | 64 | + //testExpressSql(); |
| 65 | + //testSimpleQuery(); | ||
| 66 | + } catch (Exception e) { | ||
| 67 | + e.printStackTrace(); | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + private static void testRepository() throws Exception { | ||
| 72 | + CommonRegionRepository repo = new CommonRegionRepository(jdbcTemplateWrapperTenant); | ||
| 73 | + List<Object[]> changeList = new ArrayList<Object[]>(); | ||
| 74 | + changeList.add(new Object[] {"large_area", 1}); | ||
| 75 | + List<Long> idList = new ArrayList<Long>(); | ||
| 76 | + | ||
| 77 | + for(int i=0; i<102; ++i)idList.add((long)i); | ||
| 78 | + | ||
| 79 | + repo.updateEntityByIdList(changeList, idList, null); | ||
| 63 | } | 80 | } |
| 64 | 81 | ||
| 65 | private static void testSimpleQuery() { | 82 | private static void testSimpleQuery() { |