You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

<?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">
UPDATE user_wechat
<set>
<if test='null != city and "" != city '>
CITY = #{city},
</if>
<if test='null != nickname and "" != nickname '>
NICKNAME = #{nickname},
</if>
<if test='null != country and "" != country '>
COUNTRY = #{country},
</if>
<if test='null != province and "" != province '>
PROVINCE = #{province},
</if>
<if test='null != sex and "" != sex '>
SEX = #{sex},
</if>
<if test='null != wxOpenId and "" != wxOpenId'>
WX_OPEN_ID = #{wxOpenId},
</if>
<if test='null != updatedBy and "" != updatedBy'>
UPDATED_BY = #{updatedBy},
</if>
UPDATED_TIME = sysdate
</set>
WHERE
USER_ID = #{userId}
</update>
<!-- 根据openId查询系统下(所有身份)用户信息 -->
<select id="selectUserIdByOpenId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
uw.user_id as id
FROM
user_wechat uw
WHERE
uw.DEL_FLAG = '0'
AND uw.WX_OPEN_ID = #{openId}
</select>
</mapper>