master
huanghai 5 years ago
parent 83289e3914
commit 9eccfa3c0f

@ -339,6 +339,8 @@ func main() {
//增加超级管理员 //增加超级管理员
AddSuperManager() AddSuperManager()
_ProvinceMap := make(map[string]string, 0)
sql = "select * from t_gov_area" sql = "select * from t_gov_area"
list, _ := db.SQL(sql).Query().List() list, _ := db.SQL(sql).Query().List()
//1、提取所有的省 //1、提取所有的省
@ -379,8 +381,7 @@ func main() {
//生成省教育厅管理员 //生成省教育厅管理员
AddWardManager(organization.OrgId, organization.OrgName, organization.AreaCode) AddWardManager(organization.OrgId, organization.OrgName, organization.AreaCode)
//吉林省教育厅的ORG_ID
//放入省map
_ProvinceMap[list[i]["area_code"].(string)] = shengId _ProvinceMap[list[i]["area_code"].(string)] = shengId
fmt.Printf("生成省:%s\n", list[i]["area_name"].(string)) fmt.Printf("生成省:%s\n", list[i]["area_name"].(string))
@ -443,7 +444,7 @@ func main() {
organization.Lxdh = "" organization.Lxdh = ""
organization.MainSchoolId = "" organization.MainSchoolId = ""
organization.MainSchoolType = -1 organization.MainSchoolType = -1
organization.OrgCode = CommonUtil.GetUUID()[0:30] organization.OrgCode = CommonUtil.GetUUID()[0:30]
organization.OrgLat = 0 organization.OrgLat = 0
organization.OrgLng = 0 organization.OrgLng = 0
organization.ParentId = Const.ZeroGuid organization.ParentId = Const.ZeroGuid
@ -466,7 +467,7 @@ func main() {
} }
//每个批次的大小 //每个批次的大小
var batchSize =50 var batchSize = 50
//批量插入1 //批量插入1
var t1 = make([]models.TBaseOrganization, 0) var t1 = make([]models.TBaseOrganization, 0)
@ -533,13 +534,13 @@ func main() {
| max_allowed_packet | 16777216 | | max_allowed_packet | 16777216 |
+--------------------+----------+ +--------------------+----------+
1 row in set (0.002 sec) 1 row in set (0.002 sec)
*/ */
//max_allowed_packet //max_allowed_packet
/* /*
vi /etc/my.cnf.d/server.cnf vi /etc/my.cnf.d/server.cnf
[mysqld] [mysqld]
max_allowed_packet = 1G max_allowed_packet = 1G
*/ */
//恢复外键约束 //恢复外键约束

Loading…
Cancel
Save