手机号在同一企业内唯一

dev_xiangguanfang
zhaokai 2025-12-30 14:37:40 +08:00
parent 0f6ecbd809
commit b38c52c2c2
2 changed files with 4 additions and 0 deletions

View File

@ -201,6 +201,7 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
Map<String, Object> verifyParam = new HashMap<>();
verifyParam.put("phone", params.get("phone"));
verifyParam.put("id", params.get("id"));
verifyParam.put("corpinfoId", AuthContext.getTenantId());
Integer count = userMapper.countUser(verifyParam);
if (count > 0) {
return Response.buildFailure("手机号已经存在,请联系管理员");

View File

@ -273,6 +273,9 @@
<if test="params.phone != null">
and phone = #{params.phone}
</if>
<if test="params.corpinfoId != null">
and corpinfo_id = #{params.corpinfoId}
</if>
</where>
</select>