package models

import "LAPP_LF_MOM_BACKEND/db"

type PmServiceAttrlst struct {
	Finr          int    `json:"pm_service_attrlst-finr" xorm:"not null pk INT(4)"`
	Mainserviceid string `json:"pm_service_attrlst-mainserviceid" xorm:"not null pk VARCHAR(20)"`
	Pos           int    `json:"pm_service_attrlst-pos" xorm:"not null pk INT(4)"`
	Descr         string `json:"pm_service_attrlst-descr" xorm:"not null VARCHAR(40)"`
	Attrnr        int    `json:"pm_service_attrlst-attrnr" xorm:"not null INT(4)"`
	Parameter     string `json:"pm_service_attrlst-parameter" xorm:"not null VARCHAR(40)"`
	Paravalue     string `json:"pm_service_attrlst-paravalue" xorm:"not null VARCHAR(100)"`
	Lastmodif     string `json:"pm_service_attrlst-lastmodif" xorm:"not null VARCHAR(14)"`
	Lastuser      string `json:"pm_service_attrlst-lastuser" xorm:"not null VARCHAR(20)"`
	Credatuz      string `json:"pm_service_attrlst-credatuz" xorm:"not null VARCHAR(14)"`
	Attrname      string `json:"pm_service_attrlst-attrname" xorm:"-"`
}

//查所有
func (t *PmServiceAttrlst) SelectAll() ([]PmServiceAttrlst, error) {
	e := db.Eloquent.Master()
	var data []PmServiceAttrlst
	err := e.Table("pm_service_attrlst").Where("finr = ? and mainserviceid = ?", t.Finr, t.Mainserviceid).Find(&data)
	if err != nil {
		return data, err
	}
	return data, nil
}
