作者 yangfu

配置组织修改

... ... @@ -25,6 +25,8 @@ type ListOrgQuery struct {
ParentId int64 `cname:"父级ID" json:"parentId,omitempty"`
// 是否是组织(是:1 不是:2)
IsOrg int `cname:"是否是组织(是:1 不是:2)" json:"isOrg,omitempty"`
// 模糊匹配组织名称
MatchOrgName string `cname:"部门名称" json:"matchOrgName,omitempty"`
}
func (listOrgQuery *ListOrgQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -14,9 +14,6 @@ type PgBatchAddOrgService struct {
}
func (ptr *PgBatchAddOrgService) BatchAddOrg(optUser *domain.OperateInfo, orgList []*domain.BatchAddOrgItem) error {
var (
err error
)
orgRepository, err := repository.NewOrgRepository(ptr.transactionContext)
if err != nil {
return err
... ...
... ... @@ -191,6 +191,9 @@ func (repository *OrgRepository) Find(queryOptions map[string]interface{}) (int6
query.SetWhereByQueryOption("org_name = ?", "depName")
query.SetWhereByQueryOption("org_code = ?", "orgCode")
query.SetWhereByQueryOption("parent_id = ?", "parentId")
if v, ok := queryOptions["matchOrgName"]; ok && len(v.(string)) > 0 {
query.Where(fmt.Sprintf(`org_name like '%%%v%%'`, v))
}
query.SetOrderDirect("org_id", "ASC")
if count, err := query.SelectAndCount(); err != nil {
return 0, orgs, err
... ...