// Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.

package qm

import (
	"LAPP_ACURA_MOM_BACKEND/grmi"
	"xorm.io/core"
)

/******************************************************************************
 *
 * @Struct Name              : DefectRecord
 *-----------------------------------------------------------------------------
 *
 * @Description              : DefectRecord的实体映射
 *
 * @Author                   : 代码生成器创建
 *
 * @Date                     : 2021-04-22 16:01:03
 *
 ******************************************************************************/
type DefectRecord struct {
	PlantNr        int           `xorm:"pk int 'PlantNr'" json:"QM_DefectRecord-PlantNr"`
	RecNr          int           `xorm:"pk int 'RecNr' autoincr" json:"QM_DefectRecord-RecNr"`
	SerialOrderId  string        `xorm:"nvarchar(40) 'SerialOrderId' not null" json:"QM_DefectRecord-SerialOrderId"`
	OperationNr    int           `xorm:"int 'OperationNr' not null" json:"QM_DefectRecord-OperationNr"`
	Qty            int           `xorm:"int 'qty' not null" json:"QM_DefectRecord-qty"`
	ViewId         string        `xorm:"nvarchar(20) 'ViewId' not null" json:"QM_DefectRecord-ViewId"`
	ViewDescr      string        `xorm:"nvarchar(100) 'ViewDescr' not null" json:"QM_DefectRecord-ViewDescr"`
	ViewPicture    string        `xorm:"nvarchar(1000) 'ViewPicture' not null" json:"QM_DefectRecord-ViewPicture"`
	ViewCode       int           `xorm:"int 'ViewCode' not null" json:"QM_DefectRecord-ViewCode"`
	Width          int           `xorm:"int 'Width' not null" json:"QM_DefectRecord-Width"`
	Height         int           `xorm:"int 'Height' not null" json:"QM_DefectRecord-Height"`
	EndProduct     string        `xorm:"nvarchar(40) 'EndProduct' not null" json:"QM_DefectRecord-EndProduct"`
	AreaId         int           `xorm:"int 'AreaId' not null" json:"QM_DefectRecord-AreaId"`
	XStart         int           `xorm:"int 'XStart' not null" json:"QM_DefectRecord-XStart"`
	XEnd           int           `xorm:"int 'XEnd' not null" json:"QM_DefectRecord-XEnd"`
	YStart         int           `xorm:"int 'YStart' not null" json:"QM_DefectRecord-YStart"`
	YEnd           int           `xorm:"int 'YEnd' not null" json:"QM_DefectRecord-YEnd"`
	XPos           int           `xorm:"int 'XPos' not null" json:"QM_DefectRecord-XPos"`
	YPos           int           `xorm:"int 'YPos' not null" json:"QM_DefectRecord-YPos"`
	ReworkplaceId  string        `xorm:"nvarchar(20) 'ReworkplaceId' not null" json:"QM_DefectRecord-ReworkplaceId"`
	Status         string        `xorm:"nvarchar(2) 'status' not null" json:"QM_DefectRecord-status"`
	DefectGrpId    string        `xorm:"nvarchar(20) 'DefectGrpId' not null" json:"QM_DefectRecord-DefectGrpId"`
	DefectGrpDescr string        `xorm:"nvarchar(100) 'DefectGrpDescr' not null" json:"QM_DefectRecord-DefectGrpDescr"`
	DefectReasonId string        `xorm:"nvarchar(20) 'DefectReasonId' not null" json:"QM_DefectRecord-DefectReasonId"`
	DefectDescr    string        `xorm:"nvarchar(100) 'DefectDescr' not null" json:"QM_DefectRecord-DefectDescr"`
	InspectTime    grmi.DateTime `xorm:"datetime 'InspectTime' not null" json:"QM_DefectRecord-InspectTime"`
	InspectShiftId string        `xorm:"nvarchar(20) 'InspectShiftId' not null" json:"QM_DefectRecord-InspectShiftId"`
	Inspector      string        `xorm:"nvarchar(20) 'Inspector' not null" json:"QM_DefectRecord-Inspector"`
	ReworkTime     grmi.DateTime `xorm:"datetime 'ReworkTime' not null" json:"QM_DefectRecord-ReworkTime"`
	ReworkShiftId  string        `xorm:"nvarchar(20) 'ReworkShiftId' not null" json:"QM_DefectRecord-ReworkShiftId"`
	Reworker       string        `xorm:"nvarchar(20) 'Reworker' not null" json:"QM_DefectRecord-Reworker"`
	BuildCode      string        `xorm:"nvarchar(100) 'BuildCode' not null" json:"QM_DefectRecord-BuildCode"`
	DDCCustC1      string        `xorm:"nvarchar(40) 'DDC_CustC1' not null" json:"QM_DefectRecord-DDC_CustC1"`
	DDCCustC2      string        `xorm:"nvarchar(40) 'DDC_CustC2' not null" json:"QM_DefectRecord-DDC_CustC2"`
	DDCCustC3      string        `xorm:"nvarchar(40) 'DDC_CustC3' not null" json:"QM_DefectRecord-DDC_CustC3"`
	DDCCustC4      string        `xorm:"nvarchar(40) 'DDC_CustC4' not null" json:"QM_DefectRecord-DDC_CustC4"`
	DDCCustI1      int           `xorm:"int 'DDC_CustI1' not null" json:"QM_DefectRecord-DDC_CustI1"`
	DDCCustI2      int           `xorm:"int 'DDC_CustI2' not null" json:"QM_DefectRecord-DDC_CustI2"`
	DDCCustI3      int           `xorm:"int 'DDC_CustI3' not null" json:"QM_DefectRecord-DDC_CustI3"`
	DDCCustI4      int           `xorm:"int 'DDC_CustI4' not null" json:"QM_DefectRecord-DDC_CustI4"`
	DDCCustT1      grmi.DateTime `xorm:"datetime 'DDC_CustT1'" json:"QM_DefectRecord-DDC_CustT1"`
	DDCCustT2      grmi.DateTime `xorm:"datetime 'DDC_CustT2'" json:"QM_DefectRecord-DDC_CustT2"`
	WorkPlaceNr    int           `xorm:"int 'WorkPlaceNr' not null" json:"QM_DefectRecord-WorkPlaceNr"`
	LastModify     grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"QM_DefectRecord-LastModify"`
	LastUser       string        `xorm:"nvarchar(20) 'LastUser' not null" json:"QM_DefectRecord-LastUser"`
	CreateTime     grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"QM_DefectRecord-CreateTime"`
	OrderId        string        `xorm:"-" json:"QM_DefectRecord-OrderId"`
}

/******************************************************************************
 *
 * @Function Name            : GetKey
 *-----------------------------------------------------------------------------
 *
 * @Description              : 获取实体的主键
 *
 * @Return Value             : 实体的主键
 *
 * @Author                   : 代码生成器创建
 *
 * @Date                     : 2021-03-23 17:06:57
 *
 ******************************************************************************/
func (self *DefectRecord) GetKey() core.PK {
	return core.PK{self.PlantNr, self.RecNr}
}
