Dao切面加入tenantId属性,来自token

This commit is contained in:
ZZ 2021-12-31 14:54:06 +08:00
parent ae7f95db44
commit 883b1730c9
2 changed files with 16 additions and 10 deletions

View File

@ -120,9 +120,7 @@ public class UserDaoAspect {
BeanUtils.setProperty(arg, UPDATE_TIME, date);
}
if (isProperty(arg, TENANT_ID) && StringUtils.isEmpty(BeanUtils.getProperty(arg, TENANT_ID))) {
BeanUtils.setProperty(arg, TENANT_ID, date);
}
BeanUtils.setProperty(arg, TENANT_ID, loginUser.getTenantId());
}
}
} catch (Exception e) {

View File

@ -50,6 +50,9 @@
<if test="null != avatar and '' != avatar">
avatar,
</if>
<if test="null != tenantId ">
tenant_id,
</if>
<if test="null != balance and '' != balance">
balance,
</if>
@ -106,6 +109,9 @@
<if test="null != avatar and '' != avatar">
#{avatar},
</if>
<if test="null != tenantId and '' != tenantId">
#{tenantId},
</if>
<if test="null != balance and '' != balance">
#{balance},
</if>
@ -241,6 +247,9 @@
<if test="null != userType ">
user_type,
</if>
<if test="null != tenantId ">
tenant_id,
</if>
<if test="null != openId and '' != openId">
open_id,
</if>
@ -295,12 +304,11 @@
</update>
<select id="getUserLoginTime" resultType="map">
select
app_user_id as appUserId,
account as account,
user_type as userType,
open_id as openId,
status as status
select app_user_id as appUserId,
account as account,
user_type as userType,
open_id as openId,
status as status
from xhpc_user_login type=#{type} and open_id=#{openid}
</select>
</mapper>
</mapper>