该用户从未签到
|
- INSERT INTO sys_user_wechat
- (user_id,
- openid)
- SELECT
- #{userId},
- #{openid}
- FROM DUAL
- WHERE NOT EXISTS(SELECT
- user_id,
- openid
- FROM sys_user_wechat
- WHERE user_id = #{userId}
- AND openid = #{openid});
复制代码 mybatis 使用方法
表:
CREATE TABLE `sys_user_wechat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) DEFAULT NULL,
`openid` varchar(28) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8
|
|