| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?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.fs.store.mapper.FsUserWxMapper">
- <insert id="insertOrUpdateByUniqueKey">
- insert into fs_user_wx
- (fs_user_id, app_id, union_id, open_id, create_time, update_time)
- values
- (#{fsUserId}, #{appId}, #{unionId}, #{openId}, #{createTime, jdbcType=TIMESTAMP}, #{updateTime, jdbcType=TIMESTAMP})
- ON DUPLICATE KEY UPDATE
- <if test="unionId != null">
- union_id = VALUES(union_id),
- </if>
- open_id = VALUES(open_id),
- update_time = VALUES(update_time)
- </insert>
- <update id="updateFsUserWx">
- UPDATE fs_user_wx
- <set>
- <if test="companyId != null and companyId != ''">
- company_id = #{companyId},
- </if>
- <if test="unionId != null">
- union_id = #{unionId},
- </if>
- update_time = #{updateTime}
- </set>
- WHERE
- fs_user_id = #{userId}
- AND app_id = #{appId}
- AND open_id = #{openId}
- </update>
- <select id="selectListByUserIdAndAppId" resultType="com.fs.store.domain.FsUserWx">
- SELECT * FROM fs_user_wx
- WHERE fs_user_id = #{userId}
- AND app_id = #{appId} limit 1
- </select>
- </mapper>
|