diff --git a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go index 3c613338..d3ec163a 100644 --- a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go +++ b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go @@ -100,7 +100,7 @@ func PageBaseClass(in *BaseClassProto.QueryArg) ([]map[string]interface{}, int32 //根据学校ID获取学部(学段)信息 func GetStage(schoolId string) ([]map[string]interface{}, int32, error) { //1、获取办学类型 - list := SqlKit.QueryMapArrayByIds([]string{schoolId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{schoolId}, "t_base_organization") if list == nil || len(list) == 0 { return nil, 0, errors.New("无法找到此学校id。") } diff --git a/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go b/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go index 4ab4b295..ee0ca9e1 100644 --- a/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go +++ b/dsBaseRpc/RpcService/BaseClass/BaseClassService/BaseClassService.go @@ -24,7 +24,7 @@ func (s *Rpc) GetBaseClass(ctx context.Context, in *BaseClassProto.ModelArg) (*B //rpc响应 var reply BaseClassProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{in.ClassId}, "t_base_class") //将结果序列化 reply.Success = true reply.Count = 1 @@ -38,7 +38,7 @@ func (s *Rpc) AddBaseClass(ctx context.Context, in *BaseClassProto.ModelArg) (*B //rpc响应 var reply BaseClassProto.Reply //检查单位号是不是存在 - list := SqlKit.QueryMapArrayByIds([]string{in.BureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.BureauId}, "t_base_organization") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "输入的学校编号不存在,无法创建班级!" diff --git a/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go b/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go index 1352da41..dcff768f 100644 --- a/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go +++ b/dsBaseRpc/RpcService/BaseGlobal/BaseGlobalService/BaseGlobalService.go @@ -18,7 +18,7 @@ func (s *Rpc) GetBaseGlobal(ctx context.Context, in *BaseGlobalProto.ModelArg) ( //rpc响应 var reply BaseGlobalProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.GlobalId}, "t_base_global") + list := SqlKit.QueryByIds([]string{in.GlobalId}, "t_base_global") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go index 103f2814..c8d996dc 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao/BaseOrganizationDao.go @@ -265,7 +265,7 @@ func GetChildSchoolCount(mainSchoolId string) (int64, error) { 时间:2020-06-03 */ func GetBureauAdministrativeDivision(BureauId string) (string, string, string, string, string, error) { - list := SqlKit.QueryMapArrayByIds([]string{BureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{BureauId}, "t_base_organization") if len(list) > 0 { return list[0]["area_code"].(string), list[0]["province_code"].(string), list[0]["city_code"].(string), list[0]["district_code"].(string), list[0]["main_school_id"].(string), nil @@ -280,7 +280,7 @@ func GetBureauAdministrativeDivision(BureauId string) (string, string, string, s 时间:2020-06-03 */ func GetMultipleBaseOrganization(Ids []string) ([]map[string]interface{}, int32, error) { - list := SqlKit.QueryMapArrayByIds(Ids, "t_base_organization") + list := SqlKit.QueryByIds(Ids, "t_base_organization") return list, int32(len(list)), nil } diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go index 7d85db04..8a891e19 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go @@ -30,7 +30,7 @@ func (s *Rpc) GetBaseOrganization(ctx context.Context, in *BaseOrganizationProto //rpc响应 var reply BaseOrganizationProto.Reply //使用通用方法获取单条记录 - list := SqlKit.QueryMapArrayByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") //将结果序列化 reply.Success = true @@ -373,7 +373,7 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr //普通学校 model.MainSchoolType = 1 //查看它有没有父校? - list := SqlKit.QueryMapArrayByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") mainSchoolId := list[0]["main_school_id"] if mainSchoolId != "" { @@ -596,7 +596,7 @@ func (s *Rpc) GetOrgManager(ctx context.Context, in *BaseOrganizationProto.Multi */ func UpdateManager(bureauId string, bUse int32) error { //使用通用方法获取单条记录 - list := SqlKit.QueryMapArrayByIds([]string{bureauId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{bureauId}, "t_base_organization") bureauName := list[0]["org_name"].(string) orgType := int32(list[0]["org_type"].(float64)) //组织机构类型 1:教育局 2:学校 3:部门 4:院 5:系 6:专业 7:教辅单位,8:大学区 diff --git a/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go b/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go index 8a7d2c0c..3ece3cf9 100644 --- a/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go +++ b/dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao/BaseOrganizationManagerDao.go @@ -22,7 +22,7 @@ func UpdateOrgManager(OrgId string, OrgManagerIds []string) error { //2、后插入 //部门所在的单位 - list := SqlKit.QueryMapArrayByIds([]string{OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{OrgId}, "t_base_organization") BureauId := list[0]["bureau_id"].(string) //事务声明 diff --git a/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go b/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go index 37fb388c..93f9d5a9 100644 --- a/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go +++ b/dsBaseRpc/RpcService/BasePurview/BasePurviewService/BasePurviewService.go @@ -20,7 +20,7 @@ func (s *Rpc) GetBasePurview(ctx context.Context, in *BasePurviewProto.ModelArg) //统一返回的结构体 var reply BasePurviewProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.PurviewId}, "t_base_purview") + list := SqlKit.QueryByIds([]string{in.PurviewId}, "t_base_purview") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go index 68b0aae8..a39af5c1 100644 --- a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go +++ b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go @@ -20,7 +20,7 @@ func (s *Rpc) GetBaseRolePerson(ctx context.Context, in *BaseRolePersonProto.Mod //rpc响应 var reply BaseRolePersonProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.Id}, "t_base_role_person") + list := SqlKit.QueryByIds([]string{in.Id}, "t_base_role_person") //将结果序列化 reply.Success = true reply.Count = 1 @@ -269,7 +269,7 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch orgIds := in.OrgId if len(orgIds) > 0 { found = true - l2 := SqlKit.QueryMapArrayByIds(orgIds, "t_base_organization") + l2 := SqlKit.QueryByIds(orgIds, "t_base_organization") if l2 == nil { reply.Success = false reply.Message = "传入的单位或部门ID没有找到!!" @@ -296,7 +296,7 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch classIds := in.ClassId if len(classIds) > 0 { found = true - listClass := SqlKit.QueryMapArrayByIds(classIds, "t_base_class") + listClass := SqlKit.QueryByIds(classIds, "t_base_class") if listClass == nil { reply.Success = false reply.Message = "传入的班级ID没有找到!!" diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go index b514b1d2..62849b4b 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go @@ -27,7 +27,7 @@ func (s *Rpc) GetBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) //rpc响应 var reply BaseStudentProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.PersonId}, "t_base_student") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_student") //将结果序列化 reply.Success = true reply.Count = 1 @@ -102,7 +102,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) model.BUse = 1 //状态码 model.StateId = 1 - list := SqlKit.QueryMapArrayByIds([]string{in.ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{in.ClassId}, "t_base_class") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到对应的班级!" @@ -282,7 +282,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA //残疾标志 0:不是 1:是 model.Cjbz = in.Cjbz //查找此学生所在的班级 - list := SqlKit.QueryMapArrayByIds([]string{in.PersonId}, "t_base_student") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_student") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到对应的学生!" diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go index 10ff688e..562e2031 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go @@ -101,7 +101,7 @@ func PageBaseTeacher(in *BaseTeacherProto.QueryArg) ([]map[string]interface{}, i From("t_base_teacher as t1"). LeftJoin("t_base_teacher_org as t2", "t1.person_id=t2.person_id") //所在单位ID - list := SqlKit.QueryMapArrayByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") if list == nil { return nil, 0, errors.New("没有找到此单位编码!") } diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go index 63546ee7..f568ed2b 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go @@ -30,7 +30,7 @@ func (s *Rpc) GetBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) //rpc响应 var reply BaseTeacherProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.PersonId}, "t_base_teacher") + list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_teacher") //将结果序列化 reply.Success = true @@ -151,7 +151,7 @@ func (s *Rpc) AddBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) //排序号 model.SortId = int32(BaseTeacherDao.GetMaxSortId(in.OrgId)) + 1 //主单位与主部门 - list := SqlKit.QueryMapArrayByIds([]string{in.OrgId}, "t_base_organization") + list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization") if list == nil || len(list) == 0 { reply.Success = false reply.Message = "没有找到指定的组织机构ID!" diff --git a/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go b/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go index 00f388b7..d3fd06d1 100644 --- a/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go +++ b/dsBaseRpc/RpcService/GovArea/GovAreaService/GovAreaService.go @@ -25,7 +25,7 @@ func (s *Rpc) GetGovArea(ctx context.Context, in *GovAreaProto.ModelArg) (*GovAr return &reply, nil } //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.AreaCode}, "t_gov_area") + list := SqlKit.QueryByIds([]string{in.AreaCode}, "t_gov_area") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go b/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go index 86ceef44..1ec863f7 100644 --- a/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go +++ b/dsBaseRpc/RpcService/SysDict/SysDictService/SysDictService.go @@ -19,7 +19,7 @@ func (s *Rpc) GetSysDict(ctx context.Context, in *SysDictProto.ModelArg) (*SysDi //统一返回的结构体 var reply SysDictProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{CommonUtil.ConvertInt32ToString(in.DictId)}, "t_sys_dict") + list := SqlKit.QueryByIds([]string{CommonUtil.ConvertInt32ToString(in.DictId)}, "t_sys_dict") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go index 4d641068..3f6191b3 100644 --- a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go +++ b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonService/SysLoginpersonService.go @@ -21,7 +21,7 @@ func (s *Rpc) GetSysLoginperson(ctx context.Context, in *SysLoginpersonProto.Mod //rpc响应 var reply SysLoginpersonProto.Reply //通用获取单条 - list := SqlKit.QueryMapArrayByIds([]string{in.Id}, "t_sys_loginperson") + list := SqlKit.QueryByIds([]string{in.Id}, "t_sys_loginperson") //将结果序列化 reply.Success = true reply.Count = 1 diff --git a/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go b/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go index 2b717100..0ceab67e 100644 --- a/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go +++ b/dsBaseRpc/Test/TestOutIndex/TestOutIndex.go @@ -8,7 +8,7 @@ import ( func main(){ var ClassId="1" - list := SqlKit.QueryMapArrayByIds([]string{ClassId}, "t_base_class") + list := SqlKit.QueryByIds([]string{ClassId}, "t_base_class") list2:=make([]map[string]interface{},0) fmt.Println(list) fmt.Println(list2) diff --git a/dsBaseRpc/Utils/SqlKit/SqlKit.go b/dsBaseRpc/Utils/SqlKit/SqlKit.go index 10c3f76f..6d917e23 100644 --- a/dsBaseRpc/Utils/SqlKit/SqlKit.go +++ b/dsBaseRpc/Utils/SqlKit/SqlKit.go @@ -43,7 +43,7 @@ func DeleteIds(tableName string, ids []string) error { 作者:黄海 时间:2020-02-05 */ -func QueryMapArrayByIds(ids []string, tableName string) []map[string]interface{} { +func QueryByIds(ids []string, tableName string) []map[string]interface{} { return getListByIds(ids, GetBean(tableName)) }