SyncUser.xml 1.8 KB
<?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.sibu.orderHelper.integral.web.dao.IWebSyncUserDao">

	<!--插入-->
	<insert id="insertMember" parameterType="com.sibu.orderHelper.integral.request.MemberInfoRequest">
		INSERT INTO `t_member_info` (
		`member_id`,`member_source`,`uid`,`table_index`, `db_index`,`referrer_id`,`nick_name`,`phone`, `password`,`ver_pwd`,
		`salt`,`gender`,`true_name`,`id_card`,`wechat`,`qq`,`email`, `head_img`,`remark`, `wechat_open_id`,`wechat_union_id`
		)
		VALUES
		 (#{memberId},#{memberSource},#{uid},#{tableIndex},#{dbIndex},#{referrerId},#{nickName},#{phone},#{password},#{verPwd},
		 #{salt},#{gender},#{trueName},#{idCard},#{wechat},#{qq},#{email},#{headImg},#{remark},#{wechatOpenId},#{wechatUnionId})
	</insert>

	<!--更新用户信息-->
	<update id="updateMemberInfo" parameterType="com.sibu.orderHelper.integral.request.MemberInfoRequest">
		update `t_member_info`
	  	set
		uid =#{uid},
		table_index=#{tableIndex},
		db_index=#{dbIndex},
		referrer_id=#{referrerId},
		nick_name=#{nickName},
		phone=#{phone},
		password=#{password},
		ver_pwd=#{verPwd},
		salt=#{salt},
		gender=#{gender},
		true_name=#{trueName},
		id_card=#{idCard},
		wechat=#{wechat},
		qq=#{qq},
		email=#{email},
		head_img=#{headImg},
		remark=#{remark}
		where member_id=#{memberId}
	</update>

	<!--查询用户是否存在-->
	<select id="selectMemberCountByMemberId" parameterType="java.lang.String" resultType="java.lang.Integer">
		SELECT COUNT(1) FROM `t_member_info` WHERE member_id=#{memberId}
	</select>

	<select id="selectMemberCountByPhone" parameterType="java.lang.String" resultType="java.lang.Integer">
		SELECT COUNT(1) FROM `t_member_info` WHERE phone=#{phone}
	</select>
</mapper>