yinbentan
2024-07-31 b94bef381946e22fd1038f24e6d9de911d194640
models/payroll_other_subsidies.go
@@ -12,15 +12,16 @@
   // PayrollOtherSubsidies 其它补贴、奖惩
   PayrollOtherSubsidies struct {
      BaseModelInt
      Cycle           string                      `json:"cycle" gorm:"index;size:20;not null;comment:统计周期"` //月份
      WorkerID        string                      `json:"workerId" gorm:"size:200;not null;comment:员工ID"`   //员工ID
      Worker          Worker                      `json:"worker" gorm:"foreignKey:WorkerID;references:ID"`
      WorkTypeID      uint                        `json:"workTypeID" gorm:"type:bigint(20);not null;comment:工种ID"` //工种ID
      WorkTypeCode    constvar.JobType            `json:"workTypeCode" gorm:"size:255;not null;comment:工种代码"`      //工种代码
      WorkTypeName    string                      `json:"workTypeName" gorm:"size:255;not null;comment:工种名称"`      //工种名称
      SubsidyType     constvar.PayrollSubsidyType `json:"subsidyType" gorm:"size:50;not null;comment:补贴类型"`        // 补贴类型
      SubsidyTypeName string                      `json:"subsidyTypeName" gorm:"size:255;comment:补贴类型名称"`          // 补贴类型名称
      Amount          decimal.Decimal             `json:"amount" gorm:"type:decimal(12,4);comment:金额"`             // 金额
      Cycle         string           `json:"cycle" gorm:"index;size:20;not null;comment:统计周期"` //月份
      WorkerID      string           `json:"workerId" gorm:"size:200;not null;comment:员工ID"`   //员工ID
      Worker        Worker           `json:"worker" gorm:"foreignKey:WorkerID;references:ID"`
      WorkTypeID    uint             `json:"workTypeID" gorm:"type:bigint(20);not null;comment:工种ID"`      //工种ID
      WorkTypeCode  constvar.JobType `json:"workTypeCode" gorm:"size:255;not null;comment:工种代码"`           //工种代码
      WorkTypeName  string           `json:"workTypeName" gorm:"size:255;not null;comment:工种名称"`           //工种名称
      SalaryPlanId  uint             `json:"salaryPlanId" gorm:"type:bigint(20);not null;comment:薪资方案ID"`  //薪资方案ID
      SalaryPlan    SalaryPlan       `json:"subsidyTypeName" gorm:"foreignKey:SalaryPlanId;references:ID"` //薪资方案
      SalaryFormula string           `json:"salaryFormula" gorm:"size:255;not null;comment:薪资方案(翻译后)"`     //薪资方案
      Amount        decimal.Decimal  `json:"amount" gorm:"type:decimal(12,4);comment:金额"`                  // 金额
   }
   PayrollOtherSubsidiesSearch struct {
@@ -83,11 +84,6 @@
   return slf
}
func (slf *PayrollOtherSubsidiesSearch) SetSubsidyType(subsidyType constvar.PayrollSubsidyType) *PayrollOtherSubsidiesSearch {
   slf.SubsidyType = subsidyType
   return slf
}
func (slf *PayrollOtherSubsidiesSearch) build() *gorm.DB {
   var db = slf.Orm.Table(slf.TableName())
@@ -113,10 +109,6 @@
   if slf.WorkerID != "" {
      db = db.Where("worker_id = ?", slf.WorkerID)
   }
   if slf.SubsidyType != "" {
      db = db.Where("subsidy_type = ?", slf.SubsidyType)
   }
   db.Where("1 = 1")