package excel import ( "eta_gn/eta_task/global" "eta_gn/eta_task/utils" "time" ) type ExcelEdbMapping struct { ExcelEdbMappingId int `gorm:"column:excel_edb_mapping_id;primaryKey"` // `orm:"column(excel_edb_mapping_id);pk"` ExcelInfoId int `description:"excel的id"` Source int `description:"表格来源,1:excel插件的表格,2:自定义表格,3:混合表格,4:自定义分析,默认:1"` EdbInfoId int `description:"计算指标id"` CreateTime time.Time `description:"创建时间"` ModifyTime time.Time `description:"修改时间"` } func GetExcelEdbMappingTotalBySource(sources []int) (total int, err error) { sql := ` SELECT count(*) FROM excel_edb_mapping WHERE source in (` + utils.GetOrmInReplace(len(sources)) + `)` err = global.DmSQL["data"].Raw(sql, sources).Scan(total).Error return } func GetExcelEdbMappingListBySource(sources []int, pageIndex, pageSize int) (items []*ExcelEdbMapping, err error) { sql := ` SELECT * FROM excel_edb_mapping WHERE source in (` + utils.GetOrmInReplace(len(sources)) + `) Limit ?,? ` err = global.DmSQL["data"].Raw(sql, sources, pageIndex, pageSize).Find(&items).Error return }