package main import ( "context" "fmt" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "log" ) //处理测试环境,处理一批测试数据 func dealTestData() { // 获取 company_id 列表 var companyIDs []string if err := MysqlDB.Table("company_base").Select("company_id").Find(&companyIDs).Error; err != nil { log.Fatalf("查询 company_id 失败: %v", err) } host := GF.Mongoqy.Host username := GF.Mongoqy.Username password := GF.Mongoqy.Password authSource := "admin" // 通常是 "admin",也可以是你的数据库名 // 构造 MongoDB URI var mongoURI string if username != "" && password != "" { mongoURI = fmt.Sprintf("mongodb://%s:%s@%s/?authSource=%s", username, password, host, authSource) } else { mongoURI = fmt.Sprintf("mongodb://%s", host) } clientOptions := options.Client().ApplyURI(mongoURI) //clientOptions.SetReadPreference(readpref.Primary()) //clientOptions.SetDirect(true) // 连接MongoDB client, err := mongo.Connect(context.Background(), clientOptions) if err != nil { log.Println(err) } mongoColl := client.Database("mixdata").Collection("company_change") ctx := context.Background() // 分批从 MongoDB 查询并写入 MySQL batchSize := 500 for i := 0; i < len(companyIDs); i += batchSize { end := i + batchSize if end > len(companyIDs) { end = len(companyIDs) } // 构造查询 filter := bson.M{"company_id": bson.M{"$in": companyIDs[i:end]}} cursor, err := mongoColl.Find(ctx, filter) if err != nil { log.Fatalf("MongoDB 查询失败: %v", err) } defer cursor.Close(ctx) //var results []AnnualReportBase //var results []CompanyIndustry //var results []CompanyHistoryName var results []CompanyChange for cursor.Next(ctx) { var m map[string]interface{} if err := cursor.Decode(&m); err != nil { log.Printf("解码单条数据失败: %v", err) continue } //if report := ConvertAnnualReport(m); report != nil { // results = append(results, *report) //} //if report := ConvertCompanyIndustry(m); report != nil { // results = append(results, *report) //} //if report := ConvertCompanyHistoryName(m); report != nil { // results = append(results, *report) //} if report := ConvertCompanyChange(m); report != nil { results = append(results, *report) } } if err := cursor.Err(); err != nil { log.Fatalf("遍历 cursor 时发生错误: %v", err) } if len(results) > 0 { if err := MysqlDB.Create(&results).Error; err != nil { log.Fatalf("写入 MySQL annual_report_base 失败: %v", err) } fmt.Printf("成功插入 %d 条记录\n", len(results)) } else { fmt.Println("没有符合条件的数据写入") } } fmt.Println("完成数据迁移") } // ConvertAnnualReport ConvertAnnualReport func ConvertAnnualReport(m map[string]interface{}) *AnnualReportBase { return &AnnualReportBase{ CompanyID: fmt.Sprint(m["company_id"]), CreditNo: strPtr(m["credit_no"]), CompanyName: strPtr(m["company_name"]), CompanyCode: strPtr(m["company_code"]), ReportYear: parseInt16(m["report_year"]), OperatorName: strPtr(m["operator_name"]), CompanyStatus: strPtr(m["company_status"]), CompanyAddress: strPtr(m["company_address"]), BusinessScope: strPtr(m["business_scope"]), CompanyPhone: strPtr(m["company_phone"]), CompanyEmail: strPtr(m["company_email"]), ZipCode: strPtr(m["zip_code"]), EmployeeNo: strPtr(m["employee_no"]), WomenEmployeeNo: strPtr(m["women_employee_no"]), MemberNo: strPtr(m["member_no"]), MemberFarmerNo: strPtr(m["member_farmer_no"]), MemberIncreaseNo: strPtr(m["member_increase_no"]), MemberOutNo: strPtr(m["member_out_no"]), CompanyHolding: strPtr(m["company_holding"]), HasInvest: strPtr(m["has_invest"]), HasGuarantees: strPtr(m["has_guarantees"]), StockSell: strPtr(m["stock_sell"]), SubjectionCreditNo: strPtr(m["subjection_credit_no"]), SubjectionCompanyName: strPtr(m["subjection_company_name"]), HasWebsite: strPtr(m["has_website"]), ReportDate: parseDate(m["report_date"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: fallbackNow(parseDate(m["create_time"])), UpdateTime: fallbackNow(parseDate(m["update_time"])), } } func ConvertCompanyIndustry(m map[string]interface{}) *CompanyIndustry { return &CompanyIndustry{ CompanyID: fmt.Sprint(m["company_id"]), Industry: strVal(m["industry"]), IndustryL1Code: strVal(m["industry_l1_code"]), IndustryL1Name: strVal(m["industry_l1_name"]), IndustryL2Code: strVal(m["industry_l2_code"]), IndustryL2Name: strVal(m["industry_l2_name"]), IndustryL3Code: strVal(m["industry_l3_code"]), IndustryL3Name: strVal(m["industry_l3_name"]), IndustryL4Code: strVal(m["industry_l4_code"]), IndustryL4Name: strVal(m["industry_l4_name"]), UseFlag: getInt8(m["use_flag"]), CreateTime: fallbackNow(parseDate(m["create_time"])), UpdateTime: fallbackNow(parseDate(m["update_time"])), } } func ConvertCompanyHistoryName(m map[string]interface{}) *CompanyHistoryName { return &CompanyHistoryName{ CompanyID: strVal(m["company_id"]), HistoryName: strVal(m["history_name"]), StartDate: parseDate(m["start_date"]), EndDate: parseDate(m["end_date"]), UseFlag: getInt8Ptr(m["use_flag"]), ChangeDate: parseDate(m["change_date"]), CreateTime: fallbackNow(parseDate(m["create_time"])), UpdateTime: fallbackNow(parseDate(m["update_time"])), } } func ConvertCompanyChange(m map[string]interface{}) *CompanyChange { return &CompanyChange{ CompanyID: strVal(m["company_id"]), ChangeDate: parseDate(m["change_date"]), ChangeType: strVal(m["change_type"]), ChangeField: strVal(m["change_field"]), ContentBefore: strVal(m["content_before"]), ContentAfter: strVal(m["content_after"]), UseFlag: getInt8Ptr(m["use_flag"]), ChangeRecord: strVal(m["change_record"]), CreateTime: fallbackNow(parseDate(m["create_time"])), UpdateTime: fallbackNow(parseDate(m["update_time"])), } } func ConvertCompanyBranch(m map[string]interface{}) *CompanyBranch { return &CompanyBranch{ CompanyID: strVal(m["company_id"]), BranchCompanyID: strPtr(m["branch_company_id"]), BranchName: strVal(m["branch_name"]), BranchCreditNo: strPtr(m["branch_credit_no"]), BranchCode: strPtr(m["branch_code"]), LegalPerson: strPtr(m["legal_person"]), CompanyStatus: strPtr(m["company_status"]), NCompanyStatus: strPtr(m["n_company_status"]), EstablishDate: parseDate(m["establish_date"]), Authority: strPtr(m["authority"]), CancelDate: parseDate(m["cancel_date"]), RevokeDate: parseDate(m["revoke_date"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: fallbackNow(parseDate(m["create_time"])), UpdateTime: fallbackNow(parseDate(m["update_time"])), } } func ConvertAnnualReportWebsite(m map[string]interface{}) *AnnualReportWebsite { return &AnnualReportWebsite{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), WebsiteURL: strVal(m["website_url"]), WebsiteName: strPtr(m["website_name"]), WebsiteType: strPtr(m["website_type"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), URLMD5: strVal(m["url_md5"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } func ConvertAnnualReportPartner(m map[string]interface{}) *AnnualReportPartner { return &AnnualReportPartner{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), StockName: strVal(m["stock_name"]), IsPersonal: getInt8Ptr(m["is_personal"]), StockNameID: strPtr(m["stock_name_id"]), StockCapital: strPtr(m["stock_capital"]), StockDate: parseDate(m["stock_date"]), InvestType: strPtr(m["invest_type"]), StockRealCapital: strPtr(m["stock_real_capital"]), StockRealDate: parseDate(m["stock_real_date"]), InvestRealType: strPtr(m["invest_real_type"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), PartnerRecord: strVal(m["partner_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertAnnualReportInvest 企业年报对外投资信息表 func ConvertAnnualReportInvest(m map[string]interface{}) *AnnualReportInvest { return &AnnualReportInvest{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), CreditNo: strPtr(m["credit_no"]), InvesteeName: strVal(m["investee_name"]), InvesteeNameID: strPtr(m["investee_name_id"]), InvesteeCode: strPtr(m["investee_code"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertAnnualReportSocialSecurity 企业年报社保信息表 func ConvertAnnualReportSocialSecurity(m map[string]interface{}) *AnnualReportSocialSecurity { return &AnnualReportSocialSecurity{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), InsuranceName: strVal(m["insurance_name"]), InsuranceAmount: strPtr(m["insurance_amount"]), InsuranceBase: strPtr(m["insurance_base"]), InsuranceRealCapital: strPtr(m["insurance_real_capital"]), InsuranceArrearage: strPtr(m["insurance_arrearage"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertAnnualReportEquityChange 企业年报股权变更信息表 func ConvertAnnualReportEquityChange(m map[string]interface{}) *AnnualReportEquityChange { return &AnnualReportEquityChange{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), StockName: strVal(m["stock_name"]), ChangeDate: parseDate(m["change_date"]), ProportionBefore: strPtr(m["proportion_change_before"]), ProportionAfter: strPtr(m["proportion_change_after"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), ChangeRecord: strVal(m["change_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertAnnualReportChange 企业年报变更信息表 func ConvertAnnualReportChange(m map[string]interface{}) *AnnualReportChange { return &AnnualReportChange{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), ChangeDate: parseDate(m["change_date"]), ChangeField: strPtr(m["change_field"]), ContentBefore: strPtr(m["content_before"]), ContentAfter: strPtr(m["content_after"]), UseFlag: getInt8Ptr(m["use_flag"]), ChangeRecord: strVal(m["change_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertAnnualReportGuarantee 企业年报对外提供保证担保信息表 func ConvertAnnualReportGuarantee(m map[string]interface{}) *AnnualReportGuarantee { return &AnnualReportGuarantee{ CompanyID: strVal(m["company_id"]), ReportYear: int16Val(m["report_year"]), Creditor: strPtr(m["creditor"]), Debtor: strPtr(m["debtor"]), DebtType: strPtr(m["debt_type"]), GuaranteeAmount: strPtr(m["guarantee_amount"]), PerformTime: strPtr(m["perform_time"]), GuaranteeTerm: strPtr(m["guarantee_term"]), GuaranteeType: strPtr(m["guarantee_type"]), GuaranteeScope: strPtr(m["guarantee_scope"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), GuaranteeRecord: strVal(m["guarantee_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyAllow 行政许可信息表 func ConvertCompanyAllow(m map[string]interface{}) *CompanyAllow { return &CompanyAllow{ CompanyID: strVal(m["company_id"]), AllowCode: strPtr(m["allow_code"]), AllowFilename: strPtr(m["allow_filename"]), AllowContent: strPtr(m["allow_content"]), AllowStartDate: strPtr(m["allow_startdate"]), AllowEndDate: strPtr(m["allow_enddate"]), AllowAuthority: strPtr(m["allow_authority"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), AllowRecord: strVal(m["allow_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyAbnormal 经营异常记录表 func ConvertCompanyAbnormal(m map[string]interface{}) *CompanyAbnormal { return &CompanyAbnormal{ CompanyID: strVal(m["company_id"]), IncludedDate: parseDate(m["included_date"]), IncludedReason: strPtr(m["included_reason"]), IncludedAuthority: strPtr(m["included_authority"]), RemovedDate: parseDate(m["removed_date"]), RemovedReason: strPtr(m["removed_reason"]), RemovedAuthority: strPtr(m["removed_authority"]), UseFlag: getInt8Ptr(m["use_flag"]), IsHistory: getInt8Ptr(m["is_history"]), AbnormalRecord: strVal(m["abnormal_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyIllegal 企业严重违法信息表 func ConvertCompanyIllegal(m map[string]interface{}) *CompanyIllegal { return &CompanyIllegal{ CompanyID: strVal(m["company_id"]), IncludedDate: parseDate(m["included_date"]), IllegalType: strPtr(m["illegal_type"]), IncludedReason: strPtr(m["included_reason"]), IncludedAuthority: strPtr(m["included_authority"]), RemovedDate: parseDate(m["removed_date"]), RemovedReason: strPtr(m["removed_reason"]), RemovedAuthority: strPtr(m["removed_authority"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), IllegalRecord: strVal(m["illegal_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyCheck 企业抽查检查信息表 func ConvertCompanyCheck(m map[string]interface{}) *CompanyCheck { return &CompanyCheck{ CompanyID: strVal(m["company_id"]), CheckDate: parseDate(m["check_date"]), CheckType: strPtr(m["check_type"]), CheckResult: strPtr(m["check_result"]), Authority: strPtr(m["authority"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), CheckRecord: strVal(m["check_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyPledge 企业股权出质信息表 func ConvertCompanyPledge(m map[string]interface{}) *CompanyPledge { return &CompanyPledge{ CompanyID: strVal(m["company_id"]), ProvinceShort: strPtr(m["province_short"]), PledgeCode: strPtr(m["pledge_code"]), Pledgor: strPtr(m["pledgor"]), PledgorIdentifyNo: strPtr(m["pledgor_identify_no"]), PledgorNameID: strPtr(m["pledgor_name_id"]), PledgorIsPersonal: getInt8Ptr(m["pledgor_is_personal"]), Pawnee: strPtr(m["pawnee"]), PawneeIdentifyNo: strPtr(m["pawnee_identify_no"]), PawneeNameID: strPtr(m["pawnee_name_id"]), PawneeIsPersonal: getInt8Ptr(m["pawnee_is_personal"]), PledgeEquity: strPtr(m["pledge_equity"]), PledgeDate: parseDate(m["pledge_date"]), PledgeStatus: strPtr(m["pledge_status"]), PublicDate: parseDate(m["public_date"]), RevokeDate: parseDate(m["revoke_date"]), RevokeReason: strPtr(m["revoke_reason"]), InvalidDate: parseDate(m["invalid_date"]), InvalidReason: strPtr(m["invalid_reason"]), UseFlag: getInt8Ptr(m["use_flag"]), IsHistory: getInt8Ptr(m["is_history"]), PledgeRecord: strVal(m["pledge_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyPledgeExtend 企业股权出质扩展信息表 func ConvertCompanyPledgeExtend(m map[string]interface{}) *CompanyPledgeExtend { return &CompanyPledgeExtend{ CompanyID: strVal(m["company_id"]), PledgeRecord: strVal(m["pledge_record"]), EquityAmount: strPtr(m["equity_amount"]), EquityUnit: strPtr(m["equity_unit"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyPunish 企业行政处罚信息表 func ConvertCompanyPunish(m map[string]interface{}) *CompanyPunish { return &CompanyPunish{ CompanyID: strVal(m["company_id"]), PunishDate: parseDate(m["punish_date"]), PunishCode: strPtr(m["punish_code"]), IllegalType: strPtr(m["illegal_type"]), PunishContent: strPtr(m["punish_content"]), IllegalFact: strPtr(m["illegal_fact"]), PunishType: strPtr(m["punish_type"]), PunishAmount: strPtr(m["punish_amount"]), AmountForfeiture: strPtr(m["amount_forfeiture"]), PunishValidity: strPtr(m["punish_validity"]), PublicDate: parseDate(m["public_date"]), PublicDeadline: strPtr(m["public_deadline"]), PunishBasis: strPtr(m["punish_basis"]), Authority: strPtr(m["authority"]), RevokeNameCode: strPtr(m["revoke_name_code"]), Mark: strPtr(m["mark"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), PunishRecord: strVal(m["punish_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyIntellectual 企业知识产权出质信息表 func ConvertCompanyIntellectual(m map[string]interface{}) *CompanyIntellectual { return &CompanyIntellectual{ CompanyID: strVal(m["company_id"]), PublicDate: parseDate(m["public_date"]), IntellectualCode: strPtr(m["intellectual_code"]), Pledgor: strPtr(m["pledgor"]), IntellectualName: strPtr(m["intellectual_name"]), IntellectualType: strPtr(m["intellectual_type"]), Pledgee: strPtr(m["pledgee"]), IntellectualStatus: strPtr(m["intellectual_status"]), IntellectualDeadline: strPtr(m["intellectual_deadline"]), CancelDate: parseDate(m["cancel_date"]), CancelReason: strPtr(m["cancel_reason"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), IntellectualRecord: strVal(m["intellectual_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyIntellectualChange 知识产权出质变更信息表 func ConvertCompanyIntellectualChange(m map[string]interface{}) *CompanyIntellectualChange { return &CompanyIntellectualChange{ CompanyID: strVal(m["company_id"]), ChangeDate: parseDate(m["change_date"]), ChangeField: strPtr(m["change_field"]), ContentBefore: strPtr(m["content_before"]), ContentAfter: strPtr(m["content_after"]), ChangeRecord: strVal(m["change_record"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), IntellectualRecord: strVal(m["intellectual_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyChattel 动产抵押登记信息表 func ConvertCompanyChattel(m map[string]interface{}) *CompanyChattel { return &CompanyChattel{ CompanyID: strVal(m["company_id"]), ChattelDate: parseDate(m["chattel_date"]), ChattelCode: strVal(m["chattel_code"]), DebtType: strPtr(m["debt_type"]), DebtAmount: strPtr(m["debt_amount"]), GuaranteeScope: strPtr(m["guarantee_scope"]), DebtTerm: strPtr(m["debt_term"]), Remark: strPtr(m["remark"]), ChattelStatus: strPtr(m["chattel_status"]), Authority: strPtr(m["authority"]), PublicDate: parseDate(m["public_date"]), RevokeDate: parseDate(m["revoke_date"]), RevokeReason: strPtr(m["revoke_reason"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyChattelChange 动产抵押变更信息表 func ConvertCompanyChattelChange(m map[string]interface{}) *CompanyChattelChange { return &CompanyChattelChange{ CompanyID: strVal(m["company_id"]), ChangeDate: parseDate(m["change_date"]), ChattelCode: strPtr(m["chattel_code"]), ChangeContent: strPtr(m["change_content"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), ChangeRecord: strVal(m["change_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyChattelMortgage 动产抵押权人信息表 func ConvertCompanyChattelMortgage(m map[string]interface{}) *CompanyChattelMortgage { return &CompanyChattelMortgage{ CompanyID: strVal(m["company_id"]), ChattelCode: strPtr(m["chattel_code"]), Mortgagee: strPtr(m["mortgagee"]), MortgageeIdentifyType: strPtr(m["mortgagee_identify_type"]), MortgageeIdentifyNo: strPtr(m["mortgagee_identify_no"]), MortgageeAddress: strPtr(m["mortgagee_address"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyChattelPawn 动产抵押物信息表 func ConvertCompanyChattelPawn(m map[string]interface{}) *CompanyChattelPawn { return &CompanyChattelPawn{ CompanyID: strVal(m["company_id"]), ChattelCode: strPtr(m["chattel_code"]), PawnNo: getIntPtr(m["pawn_no"]), PawnName: strPtr(m["pawn_name"]), PawnInfo: strPtr(m["pawn_info"]), PawnOwner: strPtr(m["pawn_owner"]), Remark: strPtr(m["remark"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJustice 司法协助信息表 func ConvertCompanyJustice(m map[string]interface{}) *CompanyJustice { return &CompanyJustice{ ID: intVal(m["id"]), CompanyID: strVal(m["company_id"]), DocNo: strPtr(m["doc_no"]), Executee: strPtr(m["executee"]), EquityAmount: strPtr(m["equity_amount"]), EquityStatus: strPtr(m["equity_status"]), ExecCourt: strPtr(m["exec_court"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), JusticeRecord: strVal(m["justice_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJusticeEquityChange 司法协助股权变更信息表 func ConvertCompanyJusticeEquityChange(m map[string]interface{}) *CompanyJusticeEquityChange { return &CompanyJusticeEquityChange{ CompanyID: strVal(m["company_id"]), ExecDate: parseDate(m["exec_date"]), DocNo: strPtr(m["doc_no"]), Executee: strPtr(m["executee"]), ExecuteeIdentifyType: strPtr(m["executee_identify_type"]), ExecuteeIdentifyNo: strPtr(m["executee_identify_no"]), ExecItem: strPtr(m["exec_item"]), EquityAmount: strPtr(m["equity_amount"]), Accepter: strPtr(m["accepter"]), AccepterIdentifyType: strPtr(m["accepter_identify_type"]), AccepterIdentifyNo: strPtr(m["accepter_identify_no"]), ExecCourt: strPtr(m["exec_court"]), ExecNo: strPtr(m["exec_no"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), JusticeRecord: strVal(m["justice_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJusticeFreeze 司法协助冻结信息表 func ConvertCompanyJusticeFreeze(m map[string]interface{}) *CompanyJusticeFreeze { return &CompanyJusticeFreeze{ CompanyID: strVal(m["company_id"]), PublicDate: parseDate(m["public_date"]), DocNo: strPtr(m["doc_no"]), Executee: strPtr(m["executee"]), ExecuteeIdentifyType: strPtr(m["executee_identify_type"]), ExecuteeIdentifyNo: strPtr(m["executee_identify_no"]), ExecItem: strPtr(m["exec_item"]), EquityAmount: strPtr(m["equity_amount"]), FreezeStartDate: parseDate(m["freeze_start_date"]), FreezeEndDate: parseDate(m["freeze_end_date"]), FreezeYears: strPtr(m["freeze_years"]), ExecCourt: strPtr(m["exec_court"]), ExecNo: strPtr(m["exec_no"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), JusticeRecord: strVal(m["justice_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJusticeInvalid 司法协助失效信息表 func ConvertCompanyJusticeInvalid(m map[string]interface{}) *CompanyJusticeInvalid { return &CompanyJusticeInvalid{ CompanyID: strVal(m["company_id"]), InvalidDate: parseDate(m["invalid_date"]), InvalidReason: strPtr(m["invalid_reason"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), JusticeRecord: strVal(m["justice_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJusticeUnfreeze 司法协助解除冻结信息表 func ConvertCompanyJusticeUnfreeze(m map[string]interface{}) *CompanyJusticeUnfreeze { return &CompanyJusticeUnfreeze{ CompanyID: strVal(m["company_id"]), UnfreezeDate: parseDate(m["unfreeze_date"]), UnfreezeDocNo: strPtr(m["unfreeze_doc_no"]), UnfreezeExecutee: strPtr(m["unfreeze_executee"]), UnfreezeExecuteeIdentifyType: strPtr(m["unfreeze_executee_identify_type"]), UnfreezeExecuteeIdentifyNo: strPtr(m["unfreeze_executee_identify_no"]), UnfreezeExecItem: strPtr(m["unfreeze_exec_item"]), UnfreezeEquityAmount: strPtr(m["unfreeze_equity_amount"]), UnfreezePublicDate: parseDate(m["unfreeze_public_date"]), UnfreezeExecCourt: strPtr(m["unfreeze_exec_court"]), UnfreezeExecNo: strPtr(m["unfreeze_exec_no"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), JusticeRecord: strVal(m["justice_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } // ConvertCompanyJusticeKeepFreeze 司法协助续行冻结信息表 func ConvertCompanyJusticeKeepFreeze(m map[string]interface{}) *CompanyJusticeKeepFreeze { return &CompanyJusticeKeepFreeze{ CompanyID: strVal(m["company_id"]), PublicDate: parseDate(m["public_date"]), DocNo: strPtr(m["doc_no"]), Executee: strPtr(m["executee"]), ExecuteeIdentifyType: strPtr(m["executee_identify_type"]), ExecuteeIdentifyNo: strPtr(m["executee_identify_no"]), ExecItem: strPtr(m["exec_item"]), EquityAmount: strPtr(m["equity_amount"]), FreezeStartDate: parseDate(m["freeze_start_date"]), FreezeEndDate: parseDate(m["freeze_end_date"]), FreezeYears: strPtr(m["freeze_years"]), ExecCourt: strPtr(m["exec_court"]), ExecNo: strPtr(m["exec_no"]), JusticeRecord: strVal(m["justice_record"]), IsHistory: getInt8Ptr(m["is_history"]), UseFlag: getInt8Ptr(m["use_flag"]), KeepFreezeRecord: strVal(m["keep_freeze_record"]), CreateTime: parseDate(m["create_time"]), UpdateTime: parseDate(m["update_time"]), } } //