|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
|
|
<mapper namespace="com.epmet.dao.UserWechatDao">
|
|
|
|
|
|
|
|
<!-- 根据userId更新 用户-微信关系表里的属性 -->
|
|
|
|
<update id="updateByUserId" parameterType="com.epmet.dto.UserWechatDTO">
|
|
|
|
UPDATE user_wechat
|
|
|
|
<set>
|
|
|
|
<if test='null != city and "" != city '>
|
|
|
|
CITY = #{city},
|
|
|
|
</if>
|
|
|
|
<if test='null != wxOpenId and "" != wxOpenId'>
|
|
|
|
WX_OPEN_ID = #{wxOpenId},
|
|
|
|
</if>
|
|
|
|
<if test='null != unionId and "" != unionId'>
|
|
|
|
WX_UNION_ID = #{unionId},
|
|
|
|
</if>
|
|
|
|
<if test='null != nickname and "" != nickname '>
|
|
|
|
NICKNAME = #{nickname},
|
|
|
|
</if>
|
|
|
|
<if test='null != country and "" != country '>
|
|
|
|
COUNTRY = #{country},
|
|
|
|
</if>
|
|
|
|
<if test='null != headImgUrl and "" != headImgUrl'>
|
|
|
|
HEAD_IMG_URL = #{headImgUrl},
|
|
|
|
</if>
|
|
|
|
<if test='null != province and "" != province '>
|
|
|
|
PROVINCE = #{province},
|
|
|
|
</if>
|
|
|
|
<if test='null != sex and "" != sex '>
|
|
|
|
SEX = #{sex},
|
|
|
|
</if>
|
|
|
|
UPDATED_TIME = sysdate
|
|
|
|
</set>
|
|
|
|
WHERE
|
|
|
|
USER_ID = #{userId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<!-- 根据app、openId查询用户是否存在 -->
|
|
|
|
<select id="selectUserDTOByOpenId" parameterType="com.epmet.dto.form.WxLoginUserInfoFormDTO" resultType="com.epmet.dto.UserDTO">
|
|
|
|
SELECT
|
|
|
|
u.*
|
|
|
|
FROM
|
|
|
|
USER u
|
|
|
|
LEFT JOIN user_wechat uw ON (
|
|
|
|
u.id = uw.USER_ID
|
|
|
|
AND uw.WX_OPEN_ID = #{openId})
|
|
|
|
WHERE
|
|
|
|
u.DEL_FLAG = '0'
|
|
|
|
AND uw.DEL_FLAG = '0'
|
|
|
|
AND u.FROM_APP = #{app}
|
|
|
|
</select>
|
|
|
|
</mapper>
|