func (obj UserAccountQuery) SQL(query *bsql.QuerySQL) { t := reflect.TypeOf(obj) v := reflect.ValueOf(obj) for i := 0; i < t.NumField(); i++ { field := t.Field(i) tag := field.Tag value := v.Field(i) if ZeroValue(value) == false { query.Where(bsql.BinaryExpression(tag.Get("db"), tag.Get("query"), value.Interface())) } } }
func (sortBy UserAccountSortBy) SQL(query *bsql.QuerySQL) { t := query.Table(DefaultUserAccount.TableName()) switch sortBy.Value { case 1: query.OrderByDesc(t.Column(DefaultUserAccount.PrimaryKey())) case 2: query.OrderByAsc(t.Column(DefaultUserAccount.PrimaryKey())) } }
func (page UserAccountPage) SQL(query *bsql.QuerySQL) { query.Page(page.No, page.Size) }
func (page OptionPage) SQL(query *bsql.QuerySQL) { query.Page(page.No, page.Size) }