Explorar o código

销售易登录逻辑

wjj hai 2 días
pai
achega
b21f1659f5

+ 2 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -430,4 +430,6 @@ public interface FsUserMapper
 
     @Select("select * from fs_user where apple_key = #{appleKey}")
     FsUser findUserByAppleKey(String appleKey);
+
+    int updateMpOpenIdByUserId(@Param("userId") Long userId, @Param("openId") String openId);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserWxMapper.java

@@ -2,6 +2,8 @@ package com.fs.his.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsUserWx;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 public interface FsUserWxMapper extends BaseMapper<FsUserWx> {
 
@@ -10,4 +12,7 @@ public interface FsUserWxMapper extends BaseMapper<FsUserWx> {
      * @param wx    配置信息
      */
     void insertOrUpdateByUniqueKey(FsUserWx wx);
+
+    @Select("select * from fs_user_wx where app_id=#{appid} and fs_user_id=#{userId} limit 1")
+    FsUserWx selectByAppidAndUserId(@Param("appid") String appid, @Param("userId") Long userId);
 }

+ 7 - 0
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -2313,4 +2313,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </select>
 
+    <update id="updateMpOpenIdByUserId">
+        update fs_user
+        set mp_open_id = #{openId},
+            update_time = now()
+        where user_id = #{userId}
+    </update>
+
 </mapper>