INSERT INTO user_info (name,password,phone,email,user_key,nick_name,real_name,id_no,type,status,sex,img_id,remark,register_time,wx_open_id,validate_code,validate_time,aid) VALUES (#{name},#{password},#{phone},#{email},#{user_key},#{nick_name},#{real_name},#{id_no},#{type},#{status},#{sex},#{img_id},#{remark},#{register_time},#{wx_open_id},#{validate_code},#{validate_time},#{aid}) select id from user_info ORDER BY id desc LIMIT 1 UPDATE user_info SET password=#{password} WHERE id=#{id} AND email=#{email} UPDATE user_info SET password=#{password} WHERE user_key=#{user_key} UPDATE user_info SET aid=#{aid} where id=#{id} UPDATE user_info SET id=id ,name=#{name} ,password=#{password} ,phone=#{phone} ,wx_img_url=#{wx_img_url} ,email=#{email} ,user_key=#{user_key} ,nick_name=#{nick_name} ,real_name=#{real_name} ,id_no=#{id_no} ,type=#{type} ,status=#{status} ,sex=#{sex} ,img_id=#{img_id} ,remark=#{remark} ,register_time=#{register_time} ,wx_open_id=#{wx_open_id} ,wp_id=#{wp_id} ,validate_code=#{validate_code} ,validate_time=#{validate_time} ,delete_flag=#{delete_flag} WHERE id=#{id} AND aid=#{aid} SELECT o.* , ua.sms_num , ua.voice_num FROM user_info o LEFT JOIN user_account_info ua ON o.id = ua.user_id SELECT o.* , ( SELECT COUNT(1) FROM iot_scene_user_relation ics where ics.user_id = o.id ) scene_num FROM user_info o WHERE 1=1 AND o.id=#{id} AND o.name=#{name} AND o.password = #{password} AND o.phone = #{phone} AND o.email =#{email} AND o.user_key =#{user_key} AND o.nick_name =#{nick_name} AND o.real_name =#{real_name} AND o.id_no = #{id_no} AND o.type=#{type} AND o.status=#{status} AND o.sex=#{sex} AND o.img_id=#{img_id} AND o.remark =#{remark} AND o.register_time=#{register_time} AND o.wp_id =#{wp_id} AND o.wx_open_id =#{wx_open_id} AND o.validate_code =#{validate_code} AND o.validate_time=#{validate_time} AND o.aid=#{aid} AND o.delete_flag =#{delete_flag}