package Stock import ( "ERP_storage/logs" "git.baozhida.cn/ERP_libs/lib" orm2 "github.com/beego/beego/v2/client/orm" ) type Mqtt struct { Username string Iccid string Imei string } func Read_MqttUser(T_sn string) (r Mqtt) { o := orm2.NewOrmUsingDB("mqtt") err := o.Raw("SELECT username,iccid,imei FROM mqtt_user WHERE username = '" + T_sn + "'").QueryRow(&r) if err != nil { logs.Error(lib.FuncName(), err) return } return r }