///////////////////////////////////////////////////////////
// THIS FILE IS AUTO GENERATED by gormgen, DON'T EDIT IT //
//        ANY CHANGES DONE HERE WILL BE LOST             //
///////////////////////////////////////////////////////////

package oms_order

import (
	"fmt"
	"time"

	"github.com/pkg/errors"
	"gorm.io/gorm"

	"github.com/ChangSZ/mall-go/internal/repository/mysql"
)

func NewModel() *OmsOrder {
	return new(OmsOrder)
}

func NewQueryBuilder() *omsOrderQueryBuilder {
	return new(omsOrderQueryBuilder)
}

func (t *OmsOrder) Create(db *gorm.DB) (id int64, err error) {
	if err = db.Create(t).Error; err != nil {
		return 0, errors.Wrap(err, "create err")
	}
	return t.Id, nil
}

type omsOrderQueryBuilder struct {
	order []string
	where []struct {
		prefix string
		value  interface{}
	}
	limit  int
	offset int
}

func (qb *omsOrderQueryBuilder) buildQuery(db *gorm.DB) *gorm.DB {
	ret := db
	for _, where := range qb.where {
		ret = ret.Where(where.prefix, where.value)
	}
	for _, order := range qb.order {
		ret = ret.Order(order)
	}
	if qb.limit != 0 {
		ret = ret.Limit(qb.limit)
	}
	ret = ret.Offset(qb.offset)
	return ret
}

func (qb *omsOrderQueryBuilder) Updates(db *gorm.DB, m map[string]interface{}) (int64, error) {
	db = db.Model(&OmsOrder{})

	for _, where := range qb.where {
		db.Where(where.prefix, where.value)
	}

	ret := db.Updates(m)
	err := ret.Error
	if err != nil {
		return 0, errors.Wrap(err, "updates err")
	}
	return ret.RowsAffected, nil
}

func (qb *omsOrderQueryBuilder) Delete(db *gorm.DB) (int64, error) {
	for _, where := range qb.where {
		db = db.Where(where.prefix, where.value)
	}

	ret := db.Delete(&OmsOrder{})
	err := ret.Error
	if err != nil {
		return 0, errors.Wrap(err, "delete err")
	}
	return ret.RowsAffected, nil
}

func (qb *omsOrderQueryBuilder) Count(db *gorm.DB) (int64, error) {
	var c int64
	res := qb.buildQuery(db).Model(&OmsOrder{}).Count(&c)
	if res.Error != nil && res.Error == gorm.ErrRecordNotFound {
		return 0, nil
	}
	return c, res.Error
}

func (qb *omsOrderQueryBuilder) First(db *gorm.DB) (*OmsOrder, error) {
	ret := &OmsOrder{}
	res := qb.buildQuery(db).First(ret)
	if res.Error != nil && res.Error == gorm.ErrRecordNotFound {
		return nil, nil
	}
	return ret, res.Error
}

func (qb *omsOrderQueryBuilder) QueryOne(db *gorm.DB) (*OmsOrder, error) {
	qb.limit = 1
	ret, err := qb.QueryAll(db)
	if len(ret) > 0 {
		return ret[0], err
	}
	return nil, err
}

func (qb *omsOrderQueryBuilder) QueryAll(db *gorm.DB) ([]*OmsOrder, error) {
	var ret []*OmsOrder
	err := qb.buildQuery(db).Find(&ret).Error
	return ret, err
}

func (qb *omsOrderQueryBuilder) Limit(limit int) *omsOrderQueryBuilder {
	qb.limit = limit
	return qb
}

func (qb *omsOrderQueryBuilder) Offset(offset int) *omsOrderQueryBuilder {
	qb.offset = offset
	return qb
}

func (qb *omsOrderQueryBuilder) WhereId(p mysql.Predicate, value int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "id", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIdIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "id", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIdNotIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "id", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderById(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "id "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberId(p mysql.Predicate, value int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_id", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberIdIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_id", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberIdNotIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_id", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByMemberId(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "member_id "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponId(p mysql.Predicate, value int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_id", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponIdIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_id", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponIdNotIn(value []int64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_id", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByCouponId(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "coupon_id "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderSn(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_sn", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderSnIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_sn", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderSnNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_sn", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByOrderSn(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "order_sn "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCreateTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "create_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCreateTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "create_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCreateTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "create_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByCreateTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "create_time "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberUsername(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_username", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberUsernameIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_username", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereMemberUsernameNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "member_username", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByMemberUsername(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "member_username "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereTotalAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "total_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereTotalAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "total_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereTotalAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "total_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByTotalAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "total_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByPayAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "pay_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereFreightAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "freight_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereFreightAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "freight_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereFreightAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "freight_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByFreightAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "freight_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByPromotionAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "promotion_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegrationAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegrationAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegrationAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByIntegrationAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "integration_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCouponAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "coupon_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByCouponAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "coupon_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDiscountAmount(p mysql.Predicate, value float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "discount_amount", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDiscountAmountIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "discount_amount", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDiscountAmountNotIn(value []float64) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "discount_amount", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByDiscountAmount(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "discount_amount "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayType(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_type", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayTypeIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_type", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePayTypeNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "pay_type", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByPayType(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "pay_type "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereSourceType(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "source_type", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereSourceTypeIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "source_type", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereSourceTypeNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "source_type", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderBySourceType(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "source_type "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereStatus(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "status", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereStatusIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "status", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereStatusNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "status", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByStatus(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "status "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderType(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_type", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderTypeIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_type", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereOrderTypeNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "order_type", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByOrderType(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "order_type "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryCompany(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_company", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryCompanyIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_company", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryCompanyNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_company", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByDeliveryCompany(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "delivery_company "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliverySn(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_sn", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliverySnIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_sn", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliverySnNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_sn", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByDeliverySn(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "delivery_sn "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereAutoConfirmDay(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "auto_confirm_day", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereAutoConfirmDayIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "auto_confirm_day", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereAutoConfirmDayNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "auto_confirm_day", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByAutoConfirmDay(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "auto_confirm_day "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegration(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegrationIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereIntegrationNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "integration", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByIntegration(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "integration "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereGrowth(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "growth", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereGrowthIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "growth", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereGrowthNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "growth", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByGrowth(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "growth "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionInfo(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_info", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionInfoIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_info", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePromotionInfoNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "promotion_info", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByPromotionInfo(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "promotion_info "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillType(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_type", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillTypeIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_type", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillTypeNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_type", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByBillType(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "bill_type "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillHeader(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_header", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillHeaderIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_header", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillHeaderNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_header", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByBillHeader(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "bill_header "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillContent(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_content", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillContentIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_content", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillContentNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_content", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByBillContent(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "bill_content "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverPhone(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_phone", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverPhoneIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_phone", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverPhoneNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_phone", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByBillReceiverPhone(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "bill_receiver_phone "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverEmail(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_email", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverEmailIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_email", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereBillReceiverEmailNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "bill_receiver_email", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByBillReceiverEmail(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "bill_receiver_email "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverName(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_name", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverNameIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_name", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverNameNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_name", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverName(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_name "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPhone(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_phone", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPhoneIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_phone", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPhoneNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_phone", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverPhone(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_phone "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPostCode(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_post_code", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPostCodeIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_post_code", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverPostCodeNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_post_code", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverPostCode(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_post_code "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverProvince(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_province", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverProvinceIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_province", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverProvinceNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_province", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverProvince(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_province "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverCity(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_city", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverCityIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_city", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverCityNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_city", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverCity(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_city "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverRegion(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_region", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverRegionIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_region", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverRegionNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_region", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverRegion(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_region "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverDetailAddress(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_detail_address", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverDetailAddressIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_detail_address", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiverDetailAddressNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receiver_detail_address", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiverDetailAddress(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receiver_detail_address "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereNote(p mysql.Predicate, value string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "note", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereNoteIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "note", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereNoteNotIn(value []string) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "note", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByNote(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "note "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereConfirmStatus(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "confirm_status", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereConfirmStatusIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "confirm_status", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereConfirmStatusNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "confirm_status", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByConfirmStatus(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "confirm_status "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeleteStatus(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delete_status", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeleteStatusIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delete_status", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeleteStatusNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delete_status", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByDeleteStatus(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "delete_status "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereUseIntegration(p mysql.Predicate, value int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "use_integration", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereUseIntegrationIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "use_integration", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereUseIntegrationNotIn(value []int32) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "use_integration", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByUseIntegration(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "use_integration "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WherePaymentTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "payment_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePaymentTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "payment_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WherePaymentTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "payment_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByPaymentTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "payment_time "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereDeliveryTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "delivery_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByDeliveryTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "delivery_time "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiveTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receive_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiveTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receive_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereReceiveTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "receive_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByReceiveTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "receive_time "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCommentTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "comment_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCommentTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "comment_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereCommentTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "comment_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByCommentTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "comment_time "+order)
	return qb
}

func (qb *omsOrderQueryBuilder) WhereModifyTime(p mysql.Predicate, value time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "modify_time", p),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereModifyTimeIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "modify_time", "IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) WhereModifyTimeNotIn(value []time.Time) *omsOrderQueryBuilder {
	qb.where = append(qb.where, struct {
		prefix string
		value  interface{}
	}{
		fmt.Sprintf("%v %v ?", "modify_time", "NOT IN"),
		value,
	})
	return qb
}

func (qb *omsOrderQueryBuilder) OrderByModifyTime(asc bool) *omsOrderQueryBuilder {
	order := "DESC"
	if asc {
		order = "ASC"
	}

	qb.order = append(qb.order, "modify_time "+order)
	return qb
}
