# 注册功能
# 1.根据用户名查询用户
select * from tab_user where username=#{username}
# 2.插入注册用户信息
insert into tab_user(username, password, name, birthday, sex, telephone, email, status, code) values
(#{username}, #{password}, #{name}, #{birthday}, #{sex}, #{telephone}, #{email}, #{status}, #{code});
# 3.根据激活码查询用户
select * from tab_user where code=#{code}
# 4.根据用户id修改激活状态
update tab_user set status=#{status} where uid=#{uid}
# 登录功能
# 1.根据用户名查询用户
# 2.根据用户名和密码查询用户
select * from tab_user where username=#{username} and password=#{password}
# 根据分类和旅游线路名称动态查询路线
# 旅游线路详情查询
# 分别查询出卖家,图片列表实体,然后设置到Route对象中。
select R.*, S.sname, S.consphone, S.address
from tab_route R, tab_seller S
where R.sid = S.sid;
# 旅游线路收藏
# 1.是否已经收藏,根据用户id和路线id查询收藏表
select * from tab_favorite where uid=#{uid} and rid=#{rid}
# 2.收藏线路
insert into tab_favorite(uid, rid, date) values(#{uid}, #{rid}, now())
# 3.线路收藏次数
select count(*) from tab_favorite where rid=#{rid}