lrj
1 天以前 93eb6b470773bc49ea6e1a9d4cbd914eb95d525b
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
51
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 CheckJudgeDataTest {
 
    @Autowired
    private JdbcTemplate jdbcTemplate;
 
    @Test
    public void checkJudgeData() {
        // 检查评委表结构
        String describeTableSql = "DESCRIBE t_judge";
        List<Map<String, Object>> tableStructure = jdbcTemplate.queryForList(describeTableSql);
        
        System.out.println("=== t_judge 表结构 ===");
        for (Map<String, Object> column : tableStructure) {
            System.out.println("字段: " + column.get("Field") + 
                             ", 类型: " + column.get("Type") + 
                             ", 是否为空: " + column.get("Null") + 
                             ", 键: " + column.get("Key") + 
                             ", 默认值: " + column.get("Default"));
        }
        
        // 检查评委数据
        String countSql = "SELECT COUNT(*) as count FROM t_judge";
        Map<String, Object> countResult = jdbcTemplate.queryForMap(countSql);
        System.out.println("\n=== 评委数据统计 ===");
        System.out.println("评委总数: " + countResult.get("count"));
        
        // 查看前5条评委数据
        String dataSql = "SELECT * FROM t_judge LIMIT 5";
        List<Map<String, Object>> judgeData = jdbcTemplate.queryForList(dataSql);
        System.out.println("\n=== 前5条评委数据 ===");
        for (Map<String, Object> judge : judgeData) {
            System.out.println("ID: " + judge.get("id") + 
                             ", 姓名: " + judge.get("name") + 
                             ", 用户ID: " + judge.get("user_id") + 
                             ", 状态: " + judge.get("state"));
        }
    }
}