package models_func

import (
	"errors"

	"github.com/dabory/abango-rest"
	e "github.com/dabory/abango-rest/etc"
)

type SgroupSelect struct {
	Id         int    `xorm:"not null pk autoincr INT(10)"`
	SgroupName string `xorm:"not null VARCHAR(49)"`
}
type SgroupSelectPage struct {
	Page []SgroupSelect
}

func GetSgroupSelect(y *abango.Controller, sel *SgroupSelectPage, filter string) error { //여기서는 filter 안쓰고 슴슴

	qry := *y.Db.Table("dbr_sgroup").Asc("sgroup_code").Where(filter)
	if err := qry.Find(&sel.Page); err == nil {
		e.FuncRun("234adsrared", e.CurrFuncName())
		return nil
	} else {
		return errors.New(e.PageQryErr("ltrysgaera", e.CurrFuncName()+err.Error()))
	}
}
