WebMemberMapper.xml 4.3 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.WebMemberDao">

	<resultMap id="MemberInfoResult" type="com.sibu.orderHelper.integral.model.WebMemberBean">
		<id column="id" property="id"/>
		<result column="member_id" property="memberId" jdbcType="VARCHAR" />
		<result column="member_source" property="memberSource" jdbcType="INTEGER" />
		<result column="db_index" property="dbIndex" jdbcType="INTEGER" />
		<result column="table_index" property="tableIndex" jdbcType="INTEGER" />
		<result column="nick_name" property="nickName" jdbcType="VARCHAR" />
		<result column="true_name" property="trueName" jdbcType="VARCHAR" />
		<result column="id_card" property="idCard" jdbcType="VARCHAR" />
		<result column="id_card_img_front" property="idCardImgFront" jdbcType="VARCHAR" />
		<result column="id_card_img_back" property="idCardImgBack" jdbcType="VARCHAR" />
		<result column="id_card_audit_status" property="idCardAuditStatus" jdbcType="INTEGER" />
		<result column="gender" property="gender" jdbcType="INTEGER" />
		<result column="head_img" property="headImg" jdbcType="VARCHAR" />
		<result column="wechat" property="wechat" jdbcType="VARCHAR" />
		<result column="qq" property="qq" jdbcType="VARCHAR" />
		<result column="phone" property="phone" jdbcType="VARCHAR" />
		<result column="email" property="email" jdbcType="VARCHAR" />
		<result column="password" property="password" jdbcType="VARCHAR" />
		<result column="salt" property="salt" jdbcType="VARCHAR" />
		<result column="ver_pwd" property="verPwd" jdbcType="INTEGER" />
		<result column="wechat_open_id" property="wechatOpenId" jdbcType="VARCHAR" />
		<result column="wechat_union_id" property="wechatUnionId" jdbcType="VARCHAR" />
		<result column="create_dt" property="createDt" jdbcType="TIMESTAMP" />
		<result column="update_dt" property="updateDt" jdbcType="TIMESTAMP" />
		<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
		<result column="kg_id" property="kgId" jdbcType="INTEGER" />
		<result column="kg_referrer_id" property="kgReferrerId" jdbcType="INTEGER" />
		<result column="kg_yws_id" property="kgYwsId" jdbcType="VARCHAR" />
	</resultMap>
	
	<sql id="MemberInfoSql">
		id,member_id,member_source,db_index,table_index,nick_name,true_name, gender, head_img, wechat, phone,id_card,
		password, salt, wechat_open_id,ver_pwd, create_dt, update_dt,id_card_audit_status,id_card_img_front,id_card_img_back
	</sql>
	
	<!--获取用户列表信息-->
	<select id="listMember"  resultMap="MemberInfoResult" parameterType="map">
		select <include refid="MemberInfoSql"/>  from t_member_info
		where 1=1
		<if test="phone != null and phone !=''">
			and phone = #{phone}
		</if>
		<if test="wechat != null and wechat !=''">
			and wechat = #{wechat}
		</if>
		<if test="idCard != null and idCard != ''">
			AND id_card_audit_status=#{idCard}
		</if>
		<if test="trueName != null and trueName !=''">
			and true_name like concat('%',#{trueName},'%')
		</if>
		<if test="keyword != null and keyword !=''">
			and nick_name like concat('%',#{keyword},'%')
		</if>
		ORDER BY id DESC
		LIMIT ${pageNow}, ${pageSize}
	</select>

	<select id="totalMember"  resultType="java.lang.Integer">
		select COUNT(*) from t_member_info
		where 1=1
		<if test="phone != null and phone !=''">
			and phone = #{phone}
		</if>
		<if test="wechat != null and wechat !=''">
			and wechat = #{wechat}
		</if>
		<if test="idCard != null and idCard != ''">
			AND id_card_audit_status=#{idCard}
		</if>
		<if test="trueName != null and trueName !=''">
			and true_name like concat('%',#{trueName},'%')
		</if>
		<if test="keyword != null and keyword !=''">
			and nick_name like concat('%',#{keyword},'%')
		</if>
	</select>

	<!--根据Id获取用户信息-->
	<select id="getMemberById"  resultMap="MemberInfoResult" parameterType="java.lang.Integer">
		select <include refid="MemberInfoSql"/>  from t_member_info
		where id=#{id}
	</select>

	<update id="updateMember" parameterType="map">
		update t_member_info set phone=#{phone},true_name=#{trueName},id_card=#{idCard}  where id=#{id}
	</update>
	<!--审核会员身份证信息-->
	<update id="updateAuditIdCardStatus" parameterType="java.util.Map">
		UPDATE t_member_info SET id_card_audit_status = #{idCardStatus} WHERE id=#{memberId}
	</update>
</mapper>