Where("user_id = ? AND operate_type in (?)",userId,[]uint8{diamond_e.BuyDiamond,diamond_e.DealerTransfer,diamond_e.Checkout,diamond_e.PayerMax,diamond_e.Paypal}).
diamondAccount.SetCheckUpdateCondition(" EXISTS (SELECT * from (SELECT COUNT(1) as n from diamond_account_detail d where d.user_id = "+strconv.FormatUint(diamondAccount.UserId,10)+" and d.operate_type = "+strconv.FormatUint(uint64(operateType),10)+" and d.created_time >= from_unixtime("+strconv.FormatInt(utils.GetZeroTime(time.Now()).Unix(),10)+")) t where t.n < "+strconv.Itoa(diamondOperateSet.FrequencyNum)+" )")
diamondAccount.SetCheckUpdateCondition(" EXISTS (SELECT * from (SELECT COUNT(1) as n from "+DiamondAccountDetail{}.TableName()+" d where d.user_id = "+strconv.FormatUint(diamondAccount.UserId,10)+" and d.operate_type = "+strconv.FormatUint(uint64(operateType),10)+" and d.created_time >= from_unixtime("+strconv.FormatInt(utils.GetZeroTime(time.Now()).Unix(),10)+")) t where t.n < "+strconv.Itoa(diamondOperateSet.FrequencyNum)+" )")