func (p *UserTable) DupCheck(entityx *entity.UserTable) bool { cbx := cb.CreateUserTableCB() cbx.Query().SetDelFlag_Equal(0) cbx.Query().SetTableName_Equal(entityx.GetTableName()) cbx.Query().SetKey1_Equal(entityx.GetKey1()) cbx.Query().SetKey2_Equal(entityx.GetKey2()) res, err := bhv.UserTableBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } return res.AllRecordCount > 0 }
func (p *UserTable) getDelFlagMaxValue(entityx *entity.UserTable) int64 { cbx := cb.CreateUserTableCB() cbx.Query().SetTableName_Equal(entityx.GetTableName()) cbx.Query().SetKey1_Equal(entityx.GetKey1()) cbx.Query().SetKey2_Equal(entityx.GetKey2()) cbx.Query().AddOrderBy_DelFlag_Desc() cbx.FetchFirst(1) res, err := bhv.UserTableBhv_I.SelectList(cbx, p.tx) if err != nil { panic(err.Error()) } if res.AllRecordCount == 1 { return (res.List.Get(0)).(*entity.UserTable).GetDelFlag() } panic("DelFlag Max not found") return 1 }