lrj
1 天以前 dc643ba44fd2a426263015491268a0f0d6b4671d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.rongyichuang;
 
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ActiveProfiles;
 
import java.util.List;
import java.util.Map;
 
@SpringBootTest
@ActiveProfiles("test")
public class CheckActivityJudgeTableTest {
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
 
    @Test
    public void checkActivityJudgeTableStructure() {
        System.out.println("=== 检查t_activity_judge表结构 ===");
        
        try {
            // 查看表结构
            String describeTableSql = "DESCRIBE t_activity_judge";
            List<Map<String, Object>> columns = jdbcTemplate.queryForList(describeTableSql);
            
            System.out.println("t_activity_judge表字段:");
            for (Map<String, Object> column : columns) {
                System.out.println("  字段名: " + column.get("Field") + 
                                 ", 类型: " + column.get("Type") + 
                                 ", 是否为空: " + column.get("Null") + 
                                 ", 默认值: " + column.get("Default"));
            }
            
            // 查看现有的活动-评委关联记录
            String selectRecordsSql = "SELECT * FROM t_activity_judge LIMIT 3";
            List<Map<String, Object>> records = jdbcTemplate.queryForList(selectRecordsSql);
            
            System.out.println("\n现有活动-评委关联记录示例:");
            for (Map<String, Object> record : records) {
                System.out.println("  " + record);
            }
            
        } catch (Exception e) {
            System.out.println("检查表结构时发生异常: " + e.getMessage());
            e.printStackTrace();
        }
    }
}