表,是一张还是四张,还是三张,

@interface IMMessageInfo : NSObject

 

@property(nonatomic) int messageId;

@property(nonatomic,strong) NSString *content;

@property(nonatomic) double sendDate;

@property(nonatomic) ChatMessageType type;

@property(nonatomic) ChatMessageState state;

@property(nonatomic) CGFloat voice_durition;

@property(nonatomic,strong) NSString *pic_voice_localPath;//本地图片或语音地址

@property(nonatomic,strong) NSString *pic_voice_networkPath;//网络图片或语音地址

@property(nonatomic,strong) NSString *thumbnail_networkPath;//网络图片缩略图地址

@property(nonatomic) CGFloat pic_width;

@property(nonatomic) CGFloat pic_height;

@property(nonatomic) BOOL isPlay;

 

 

@end

 

@interface IMUserInfo : NSObject

 

@property(nonatomic) int openfireAccountId;

@property(nonatomic,strong) NSString *riches_grade;

@property(nonatomic,strong) NSString *singer_grade;

@property(nonatomic,strong) NSString *nick;

@property(nonatomic,strong) NSString *avatar;

 

@end

 

@interface IMUserRelateInfo : NSObject

 

@property(nonatomic) int relateId;

@property(nonatomic) int currentOpenfireAccountId;

@property(nonatomic) int friendOpenfireAccountId;

 

@end

 

 

@interface IMUserMessageRelateInfo : NSObject

 

@property(nonatomic) int messageId;

@property(nonatomic) int kgwbAccountId;

@property(nonatomic) int messageSenderId;

@property(nonatomic) int messageReceiverId;

 

@end

 

@interface ChatMessageInfo : NSObject

 

@property(nonatomic) int idNumber;

@property(nonatomic) int ownerId;

@property(nonatomic) int friendId;

@property(nonatomic,strong) NSString *messageId;

@property(nonatomic) int fromId;

@property(nonatomic) int toId;

@property(nonatomic,strong) NSString *nick;

@property(nonatomic,strong) NSString *avatar;

@property(nonatomic) double sendDate;

@property(nonatomic,strong) NSString *content;

@property(nonatomic) ChatMessageType type;

@property(nonatomic) ChatMessageState state;

@property(nonatomic) CGFloat durition;

@property(nonatomic,strong) NSString *localPath;

@property(nonatomic,strong) NSString *networkPath;

@property(nonatomic,strong) NSString *sNetworkPath;

@property(nonatomic) CGFloat width;

@property(nonatomic) CGFloat height;

 

@property(nonatomic,strong) NSString *ofusername;

@property(nonatomic,strong) NSString *ofId;

@property(nonatomic,strong) NSString *riches_grade;

@property(nonatomic,strong) NSString *title;

 

@property(nonatomic) BOOL isPlay;

@end

select * from IMUser as u,(select *from IMMessage order by IMMessage.sendData desc) as m where (m.messageSenderId = u.openfireAccountId or m.messageReceiverId = u.openfireAccountId) and (u.openfireAccountId != 1234) group by u.openfireAccountId

1,分组,只要是在两个 表里面的字段都是可以的

2,拿着 openfireAccountId 把user表字段全部读取出来,然后 去另外 一个表的筛选  最后拼接在一块,

3,m.messageReceiverId = u.openfireAccountId 这个 意味着接收 信息的人可以拿到信息的,因此 那条信息 不隶属 特定的一个人,而是 相互发和接收 的两个人,

posted @   路在脚下,  阅读(204)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示