| 737 | } |
| 738 | |
| 739 | func (me MPathEquals) Build(builder clause.Builder) { |
| 740 | var expr []clause.Expression |
| 741 | |
| 742 | if mpath1 := me.Value.GetMPath1(); mpath1 != "" { |
| 743 | expr = append(expr, clause.Eq{Column: "mpath1", Value: me.Value.GetMPath1()}) |
| 744 | } |
| 745 | |
| 746 | if mpath2 := me.Value.GetMPath2(); mpath2 != "" { |
| 747 | expr = append(expr, clause.Eq{Column: "mpath2", Value: me.Value.GetMPath2()}) |
| 748 | } |
| 749 | |
| 750 | if mpath3 := me.Value.GetMPath3(); mpath3 != "" { |
| 751 | expr = append(expr, clause.Eq{Column: "mpath3", Value: me.Value.GetMPath3()}) |
| 752 | } |
| 753 | |
| 754 | if mpath4 := me.Value.GetMPath4(); mpath4 != "" { |
| 755 | expr = append(expr, clause.Eq{Column: "mpath4", Value: me.Value.GetMPath4()}) |
| 756 | } |
| 757 | |
| 758 | expr = append(expr, clause.Eq{Column: "level", Value: me.Value.Length()}) |
| 759 | |
| 760 | if len(expr) > 0 { |
| 761 | clause.And(expr...).Build(builder) |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | // MPathLike greater than for where |
| 766 | type MPathLike struct { |