SJA工艺
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

39 lines
1.4 KiB

package models
import (
"LAPP_SJA_ME/db"
"LAPP_SJA_ME/utils"
)
type MeSupplyGroupPartlst struct {
Finr int `xorm:"pk comment('工厂号') int(0)" json:"me_supplygroup_partlst-finr"`
Supplygroupid string `xorm:"pk comment('供应组Id') VARCHAR(20)" json:"me_supplygroup_partlst-supplygroupid"`
Partid string `xorm:"pk comment('零件Id') VARCHAR(20)" json:"me_supplygroup_partlst-partid"`
Projnrid string `xorm:"pk comment('项目Id') VARCHAR(40)" json:"me_supplygroup_partlst-projnrid"`
Lastmodif string `xorm:"comment('最近一次更改时间') VARCHAR(14)" json:"me_supplygroup_partlst-lastmodif"`
Lastuser string `xorm:"comment('最近一次更改人') VARCHAR(20)" json:"me_supplygroup_partlst-lastuser"`
Credatuz string `xorm:"comment('创建时间') VARCHAR(14)" json:"me_supplygroup_partlst-credatuz"`
}
func (t *MeSupplyGroupPartlst) TableName() string {
return "me_supplygroup_partlst"
}
// 清除string字段的右侧空格
func (t *MeSupplyGroupPartlst) Clipped() {
utils.TrimStruct(t, *t)
}
//查询当前partids集合
func (t *MeSupplyGroupPartlst) SelectArr() (arr []string, err error) {
e := db.Eloquent.Master()
var data []MeSupplyGroupPartlst
err = e.Where("finr = ? ", t.Finr).Cols("partid").Find(&data)
for _, v := range data {
arr = append(arr, v.Partid)
}
if err != nil {
return arr, err
}
return arr, nil
}