func (m *default{{.upperStartCamelObject}}Model) Update(ctx context.Context, tx *gorm.DB, data *{{.upperStartCamelObject}}) error { {{if .withCache}}{{.keys}} return m.ExecCtx(ctx, func(conn *gorm.DB) error { result := gormx.WithTx(ctx, conn, tx).Save(data) if result.Error != nil { return result.Error } if result.RowsAffected == 0 { return gormx.ErrRowsAffectedZero } return nil }, {{.keyValues}}){{else}} result:=gormx.WithTx(ctx, m.DB, tx).Save(data) if result.Error != nil { return result.Error } if result.RowsAffected == 0 { return gormx.ErrRowsAffectedZero } return nil {{end}} }