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

package pms_product

import (
	"fmt"
	"time"

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

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

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

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

func (t *PmsProduct) 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 pmsProductQueryBuilder struct {
	order []string
	where []struct {
		prefix string
		value  interface{}
	}
	limit  int
	offset int
}

func (qb *pmsProductQueryBuilder) 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 *pmsProductQueryBuilder) Updates(db *gorm.DB, m map[string]interface{}) (int64, error) {
	db = db.Model(&PmsProduct{})

	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 *pmsProductQueryBuilder) Delete(db *gorm.DB) (int64, error) {
	for _, where := range qb.where {
		db = db.Where(where.prefix, where.value)
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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