ads10.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package model
  2. import (
  3. "git.getensh.com/common/gopkgsv2/database"
  4. "gorm.io/gorm"
  5. )
  6. type Ads10Model interface{
  7. Get(db *gorm.DB) (*Ads10, error)
  8. }
  9. type Ads10 struct {
  10. ID int64 `gorm:"column:id" json:"id"`
  11. Vin string `gorm:"column:vin" json:"vin"`
  12. CertificateNumber string `gorm:"column:certificate_number" json:"certificate_number"`
  13. CertificateDate string `gorm:"column:certificate_date" json:"certificate_date"`
  14. VehicleManufacturer string `gorm:"column:vehicle_manufacturer" json:"vehicle_manufacturer"`
  15. BrandName string `gorm:"column:brand_name" json:"brand_name"`
  16. ModelNo string `gorm:"column:model_no" json:"model_no"`
  17. VehicleBodyColorDetail string `gorm:"column:vehicle_body_color_detail" json:"vehicle_body_color_detail"`
  18. ChassisModel string `gorm:"column:chassis_model" json:"chassis_model"`
  19. ChassisId string `gorm:"column:chassis_id" json:"chassis_id"`
  20. ChassisCertificateNumber string `gorm:"column:chassis_certificate_number" json:"chassis_certificate_number"`
  21. EngineType string `gorm:"column:engine_type" json:"engine_type"`
  22. EngineNo string `gorm:"column:engine_no" json:"engine_no"`
  23. FuelTypeDetail string `gorm:"column:fuel_type_detail" json:"fuel_type_detail"`
  24. Displacement string `gorm:"column:displacement" json:"displacement"`
  25. DisplacementL string `gorm:"column:displacement_l" json:"displacement_l"`
  26. RatedPower string `gorm:"column:rated_power" json:"rated_power"`
  27. EmissionStandard string `gorm:"column:emission_standard" json:"emission_standard"`
  28. OilWear string `gorm:"column:oil_wear" json:"oil_wear"`
  29. Long string `gorm:"column:long" json:"long"`
  30. Wide string `gorm:"column:wide" json:"wide"`
  31. High string `gorm:"column:high" json:"high"`
  32. CargoLong string `gorm:"column:cargo_long" json:"cargo_long"`
  33. CargoWide string `gorm:"column:cargo_wide" json:"cargo_wide"`
  34. CargoHigh string `gorm:"column:cargo_high" json:"cargo_high"`
  35. NumberOfLeafSprings string `gorm:"column:number_of_leaf_springs" json:"number_of_leaf_springs"`
  36. TyreNumber string `gorm:"column:tyre_number" json:"tyre_number"`
  37. TyreSize string `gorm:"column:tyre_size" json:"tyre_size"`
  38. FrontWheelDistance string `gorm:"column:front_wheel_distance" json:"front_wheel_distance"`
  39. BackWheelDistance string `gorm:"column:back_wheel_distance" json:"back_wheel_distance"`
  40. WheelBase string `gorm:"column:wheel_base" json:"wheel_base"`
  41. AxleWeight string `gorm:"column:axle_weight" json:"axle_weight"`
  42. AxleNumber string `gorm:"column:axle_number" json:"axle_number"`
  43. SteeringMode string `gorm:"column:steering_mode" json:"steering_mode"`
  44. GrossMass string `gorm:"column:gross_mass" json:"gross_mass"`
  45. UnladenMass string `gorm:"column:unladen_mass" json:"unladen_mass"`
  46. ApprovedLoad string `gorm:"column:approved_load" json:"approved_load"`
  47. LoadMassCoefficient string `gorm:"column:load_mass_coefficient" json:"load_mass_coefficient"`
  48. TractionMass string `gorm:"column:traction_mass" json:"traction_mass"`
  49. SemitrailerSaddleMaxAllowGrossMass string `gorm:"column:semitrailer_saddle_max_allow_gross_mass" json:"semitrailer_saddle_max_allow_gross_mass"`
  50. NumberOfPassengers string `gorm:"column:number_of_passengers" json:"number_of_passengers"`
  51. ApprovedNumber string `gorm:"column:approved_number" json:"approved_number"`
  52. TopSpeed string `gorm:"column:top_speed" json:"top_speed"`
  53. ReleaseDate string `gorm:"column:release_date" json:"release_date"`
  54. CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
  55. UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
  56. }
  57. type defalutAds10Model struct {
  58. tableName string
  59. }
  60. func NewAds10Model() Ads10Model {
  61. return &defalutAds10Model{
  62. "db_adm_ads.t_adm_ads10",
  63. }
  64. }
  65. func (d *defalutAds10Model) Get(db *gorm.DB) (*Ads10, error) {
  66. var res Ads10
  67. err := database.Get(db, &res, database.Option{
  68. TableName: d.tableName,
  69. })
  70. return &res, err
  71. }