package dto

import (
	userVO "server/modules/user/vo"
	"server/modules/yx/entity"
)

type UserMajorDTO struct {
	SchoolCode                  string  `json:"schoolCode"`
	SchoolName                  string  `json:"schoolName"`
	MajorCode                   string  `json:"majorCode"`
	MajorName                   string  `json:"majorName"`
	MajorType                   string  `json:"majorType"`
	MajorTypeChild              string  `json:"majorTypeChild"`
	PlanNum                     int     `json:"planNum"`
	MainSubjects                string  `json:"mainSubjects"`
	Limitation                  string  `json:"limitation"`
	ChineseScoreLimitation      float64 `json:"chineseScoreLimitation"`
	EnglishScoreLimitation      float64 `json:"englishScoreLimitation"`
	CulturalScoreLimitation     float64 `json:"culturalScoreLimitation"`
	ProfessionalScoreLimitation float64 `json:"professionalScoreLimitation"`
	EnrollmentCode              string  `json:"enrollmentCode"`
	Tuition                     string  `json:"tuition"`
	Detail                      string  `json:"detail"`
	Category                    string  `json:"category"`
	Batch                       string  `json:"batch"`
	RulesEnrollProbability      string  `json:"rulesEnrollProbability"`
	ProbabilityOperator         string  `json:"probabilityOperator"`
	// PrivateRulesEnrollProbability string                             `json:"privateRulesEnrollProbability"`
	// PrivateProbabilityOperator    string                             `json:"privateProbabilityOperator"`
	RulesEnrollProbabilitySx string                             `json:"rulesEnrollProbabilitySx"`
	Kslx                     string                             `json:"kslx"`
	State                    string                             `json:"state"`
	HistoryMajorEnrollMap    map[string]YxHistoryMajorEnrollDTO `json:"historyMajorEnrollMap"`
	// 计算相关字段 (非数据库直接映射)
	EnrollProbability float64 `json:"enrollProbability"`                       // 录取率
	StudentScore      float64 `json:"studentScore" gorm:"column:studentScore"` // 学生折合分
	// PrivateStudentScore    float64                       `json:"privateStudentScore"`   // 学生折合分(私有)
	// StudentConvertedScore  float64                       `json:"studentConvertedScore"` // 学生折合分(转换后)
	// FirstLevelDiscipline   string                        `json:"firstLevelDiscipline"`  // 一级学科 (需确认来源)

	Province        string `json:"province"`        // 省份
	SchoolNature    string `json:"schoolNature"`    // 院校性质
	InstitutionType string `json:"institutionType"` // 院校类型
}

// SchoolMajorDTO 院校专业查询结果 DTO
type SchoolMajorDTO struct {
	SchoolCode                    string                             `json:"schoolCode"`
	SchoolName                    string                             `json:"schoolName"`
	MajorCode                     string                             `json:"majorCode"`
	MajorName                     string                             `json:"majorName"`
	MajorType                     string                             `json:"majorType"`
	MajorTypeChild                string                             `json:"majorTypeChild"`
	PlanNum                       int                                `json:"planNum"`
	MainSubjects                  string                             `json:"mainSubjects"`
	Limitation                    string                             `json:"limitation"`
	ChineseScoreLimitation        float64                            `json:"chineseScoreLimitation"`
	EnglishScoreLimitation        float64                            `json:"englishScoreLimitation"`
	CulturalScoreLimitation       float64                            `json:"culturalScoreLimitation"`
	ProfessionalScoreLimitation   float64                            `json:"professionalScoreLimitation"`
	EnrollmentCode                string                             `json:"enrollmentCode"`
	Tuition                       string                             `json:"tuition"`
	Detail                        string                             `json:"detail"`
	Category                      string                             `json:"category"`
	Batch                         string                             `json:"batch"`
	RulesEnrollProbability        string                             `json:"rulesEnrollProbability"`
	ProbabilityOperator           string                             `json:"probabilityOperator"`
	PrivateRulesEnrollProbability string                             `json:"privateRulesEnrollProbability"`
	PrivateProbabilityOperator    string                             `json:"privateProbabilityOperator"`
	RulesEnrollProbabilitySx      string                             `json:"rulesEnrollProbabilitySx"`
	Kslx                          string                             `json:"kslx"`
	State                         string                             `json:"state"`
	HistoryMajorEnrollMap         map[string]YxHistoryMajorEnrollDTO `json:"historyMajorEnrollMap"`
	// 计算相关字段 (非数据库直接映射)
	HistoryMajorEnrollList []entity.YxHistoryMajorEnroll `json:"historyMajorEnrollList"`
	EnrollProbability      float64                       `json:"enrollProbability"`     // 录取率
	StudentScore           float64                       `json:"studentScore"`          // 学生折合分
	PrivateStudentScore    float64                       `json:"privateStudentScore"`   // 学生折合分(私有)
	StudentConvertedScore  float64                       `json:"studentConvertedScore"` // 学生折合分(转换后)
	FirstLevelDiscipline   string                        `json:"firstLevelDiscipline"`  // 一级学科 (需确认来源)
}

type YxHistoryMajorEnrollDTO struct {
	Year                   string  `json:"year"`
	EnrollmentCode         string  `json:"enrollmentCode"`
	EnrollmentCount        int     `json:"enrollmentCount"`
	RulesEnrollProbability string  `json:"rulesEnrollProbability"`
	ProbabilityOperator    string  `json:"probabilityOperator"`
	AdmissionLine          float64 `json:"admissionLine"`
	ControlLine            float64 `json:"controlLine"`
	// 其他字段...
}

// SchoolMajorQuery 院校专业查询条件
type SchoolMajorQuery struct {
	Page                       int                `json:"page"`
	Size                       int                `json:"size"`
	Keyword                    string             `json:"keyword"`                    // 对应 keyword
	MajorType                  string             `json:"majorType"`                  // 对应 major_type
	Category                   string             `json:"category"`                   // 对应 category
	Batch                      string             `json:"batch"`                      // 对应 批次
	MajorTypeChildren          []string           `json:"majorTypeChildren"`          // 对应 major_type_child in (...)
	MainSubjects               string             `json:"mainSubjects"`               // 对应 main_subjects
	Probability                string             `json:"probability"`                // 对应 录取概率类型
	ScoreId                    string             `json:"scoreId"`                    // 对应 score_id
	TagList                    []string           `json:"tagList"`                    // 对应 tags in (...)
	SchoolNatureList           []string           `json:"schoolNatureList"`           // 对应 school_nature in (...)
	AddressList                []string           `json:"addressList"`                // 对应 address in (...)
	KyjxList                   []string           `json:"kyjxList"`                   // 对应 kyjx in (...)
	RulesEnrollProbabilityList []string           `json:"rulesEnrollProbabilityList"` // 录取方式，对应 rules_enroll_probability in (...)
	LoginUserId                string             `json:"loginUserId"`                // 登录用户 ID
	UserScoreVO                userVO.UserScoreVO `json:"userScoreVO"`                // 用户成绩 VO
	CalculationTableName       string             `json:"calculationTableName"`       // 对应 calculation_table_name
	SchoolCode                 string             `json:"schoolCode"`                 // 对应的 院校代码
}
