master
huanghai 5 years ago
parent f8f9704d95
commit 28c01cb5f7

@ -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。")
}

@ -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 = "输入的学校编号不存在,无法创建班级!"

@ -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

@ -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
}

@ -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:大学区

@ -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)
//事务声明

@ -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

@ -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没有找到!"

@ -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 = "没有找到对应的学生!"

@ -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("没有找到此单位编码!")
}

@ -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"

@ -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

@ -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

@ -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

@ -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)

@ -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))
}

Loading…
Cancel
Save