提交 60e3f872 编写于 作者: xinxu.wang's avatar xinxu.wang

根据openid 获取医生id

上级 d90305eb
流水线 #38210 已失败 于阶段
...@@ -126,4 +126,6 @@ public interface DoctorMapper { ...@@ -126,4 +126,6 @@ public interface DoctorMapper {
List<Integer> selectIdByParams(@Param("fromId") Integer fromId, List<Integer> selectIdByParams(@Param("fromId") Integer fromId,
@Param("toId") Integer toId, @Param("toId") Integer toId,
@Param("loginTime") Date loginTime); @Param("loginTime") Date loginTime);
String selectIdByOpenId(String openId);
} }
\ No newline at end of file
...@@ -102,11 +102,16 @@ public class WechatServiceImpl implements WechatService { ...@@ -102,11 +102,16 @@ public class WechatServiceImpl implements WechatService {
@Override @Override
public Integer getDoctorByOpenid(String openId) { public Integer getDoctorByOpenid(String openId) {
AccountWeChatInfoEntity entity = weChatInfoMapper.selectByOpenId(openId); AccountWeChatInfoEntity entity = weChatInfoMapper.selectByOpenId(openId);
String unionId = "";
if (StringUtil.isNotNull(entity)) { if (StringUtil.isNotNull(entity)) {
DoctorUnionResp doctorUnionfoModel = getDoctorByUnionid(entity.getUnionid()); unionId = entity.getUnionid();
if (StringUtil.isNotNull(doctorUnionfoModel)) {
return doctorUnionfoModel.getDoctorId(); } else {
} unionId = doctorMapper.selectIdByOpenId(openId);
}
DoctorUnionResp doctorUnionfoModel = getDoctorByUnionid(unionId);
if (StringUtil.isNotNull(doctorUnionfoModel)) {
return doctorUnionfoModel.getDoctorId();
} }
return null; return null;
} }
......
...@@ -1099,4 +1099,10 @@ ...@@ -1099,4 +1099,10 @@
and id &lt;= #{toId} and id &lt;= #{toId}
and last_login_time &lt;= #{loginTime} and last_login_time &lt;= #{loginTime}
</select> </select>
<select id="selectIdByOpenId" parameterType="java.lang.String" resultType="java.lang.String">
select unionid from p_wechat_doctor
where openid = #{openId} and delete_flag = 1
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册