You've already forked FrameTour-BE
支持用户切换景区账号,单账号多景区权限
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
insert into scenic_account(id, scenic_id, is_super, name, phone, account, password, create_time, update_time)
|
||||
values (#{id}, #{scenicId}, #{isSuper}, #{name}, #{phone}, #{account}, #{password}, now(), now())
|
||||
</insert>
|
||||
<insert id="addAccountScenicRelation">
|
||||
insert into account_scenic(account_id, scenic_id, is_admin)
|
||||
values (#{accountId}, #{scenicId}, #{isAdmin})
|
||||
</insert>
|
||||
<update id="update">
|
||||
update scenic_account
|
||||
<set>
|
||||
@@ -41,11 +45,17 @@
|
||||
<delete id="deleteByScenicId">
|
||||
delete from scenic_account where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<delete id="deleteRelationByScenicId">
|
||||
delete from account_scenic where scenic_id = #{scenicId}
|
||||
</delete>
|
||||
<delete id="deleteRelationById">
|
||||
delete from account_scenic where account_id = #{accountId}
|
||||
</delete>
|
||||
<select id="getSuperAccountOfScenic"
|
||||
resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity">
|
||||
select id, scenic_id, is_super, name, phone, account, password, create_time, update_time
|
||||
from scenic_account
|
||||
where scenic_id = #{scenicId} and is_super = 1
|
||||
select a.id, b.scenic_id, b.is_admin as isSuper, a.name, a.phone, a.account, a.password, a.create_time, a.update_time
|
||||
from scenic_account a left join account_scenic b on a.id = b.account_id
|
||||
where b.scenic_id = #{scenicId} and b.is_admin = 1
|
||||
</select>
|
||||
<select id="getByAccount" resultType="com.ycwl.basic.model.pc.scenic.entity.ScenicAccountEntity">
|
||||
select id, scenic_id, is_super, name, phone, account, password, status,create_time, update_time
|
||||
@@ -61,7 +71,7 @@
|
||||
SELECT * FROM scenic_account
|
||||
<where>
|
||||
<if test="scenicId != null">
|
||||
AND scenic_id = #{scenicId}
|
||||
AND id in (select account_id from account_scenic where scenic_id = #{scenicId})
|
||||
</if>
|
||||
<if test="account != null and account != ''">
|
||||
AND account LIKE CONCAT('%', #{account}, '%')
|
||||
@@ -84,4 +94,9 @@
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="getAccountRelations" resultType="java.lang.Long">
|
||||
SELECT scenic_id
|
||||
FROM account_scenic
|
||||
WHERE account_id = #{scenicId}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user