admin
2020-07-03 651a15c78f668bef3859d9ed1bb7ad0b669d3600
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -26,8 +26,7 @@
      <result column="phone" property="phone" jdbcType="VARCHAR" />
      <result column="state" property="state" jdbcType="INTEGER" />
      <result column="state_desc" property="stateDesc" jdbcType="VARCHAR" />
      <!-- <association property="system" column="sid" resultMap="com.yeshi.fanli.dao.mybatis.SystemMapper.BaseResultMap"
         /> -->
      <result column="system" property="system" jdbcType="VARCHAR" />
   </resultMap>
   <resultMap id="BaseResultMapVO" type="com.yeshi.fanli.vo.user.UserInfoVO">
@@ -90,7 +89,7 @@
      <result column="showValue" property="showValue" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
   <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,system,rank,phone,state,state_desc
   </sql>
   <!-- 不能查询缓存 -->
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
@@ -119,9 +118,9 @@
   </delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
      useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user
      (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc,platform)
      (id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,system,rank,phone,state,state_desc,platform)
      values
      (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{platform,jdbcType=VARCHAR})
      (#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system,jdbcType=VARCHAR},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{platform,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
      useGeneratedKeys="true" keyProperty="id">
@@ -145,7 +144,7 @@
         <if test="appId != null">appid,</if>
         <if test="myHongBao != null">my_hongBao,</if>
         <if test="payPassword != null">pay_password,</if>
         <if test="system != null">sid,</if>
         <if test="system != null">system,</if>
         <if test="rank != null">rank,</if>
         <if test="phone != null">phone,</if>
         <if test="state != null">state,</if>
@@ -172,7 +171,7 @@
         <if test="appId != null">#{appId,jdbcType=VARCHAR},</if>
         <if test="myHongBao != null">#{myHongBao,jdbcType=DECIMAL},</if>
         <if test="payPassword != null">#{payPassword,jdbcType=VARCHAR},</if>
         <if test="system != null">#{system.id,jdbcType=BIGINT},</if>
         <if test="system != null">#{system,jdbcType=VARCHAR},</if>
         <if test="rank != null">#{rank,jdbcType=INTEGER},</if>
         <if test="phone != null">#{phone,jdbcType=VARCHAR},</if>
         <if test="state != null">#{state,jdbcType=INTEGER},</if>
@@ -195,8 +194,8 @@
      #{type,jdbcType=INTEGER},appid =
      #{appId,jdbcType=VARCHAR},my_hongBao =
      #{myHongBao,jdbcType=DECIMAL},pay_password =
      #{payPassword,jdbcType=VARCHAR},sid =
      #{system.id,jdbcType=BIGINT},rank = #{rank,jdbcType=INTEGER} ,phone
      #{payPassword,jdbcType=VARCHAR},system =
      #{system,jdbcType=VARCHAR},rank = #{rank,jdbcType=INTEGER} ,phone
      =#{phone,jdbcType=VARCHAR} ,state =#{state,jdbcType=INTEGER}
      ,state_desc =#{stateDesc,jdbcType=VARCHAR} where id =
      #{id,jdbcType=BIGINT}
@@ -221,7 +220,7 @@
         <if test="appId != null">appid=#{appId,jdbcType=VARCHAR},</if>
         <if test="myHongBao != null">my_hongBao=#{myHongBao,jdbcType=DECIMAL},</if>
         <if test="payPassword != null">pay_password=#{payPassword,jdbcType=VARCHAR},</if>
         <if test="system != null">sid=#{system.id,jdbcType=BIGINT},</if>
         <if test="system != null">system=#{system,jdbcType=VARCHAR},</if>
         <if test="rank != null">rank=#{rank,jdbcType=INTEGER},</if>
         <if test="phone !=null">phone =#{phone,jdbcType=VARCHAR},</if>
         <if test="state !=null">state =#{state,jdbcType=INTEGER},</if>
@@ -247,41 +246,41 @@
   <select id="getMyHB" resultType="BigDecimal">SELECT SUM(hb.`money`) FROM
      `yeshi_ec_hongbao` hb WHERE hb.`uid` = #{id};
   </select>
   <!-- 根据AppId与微信unionID获取用户 -->
   <select id="listByAppIdAndWXUnionId" resultMap="BaseResultMap">
   <!-- 根据系统与微信unionID获取用户 -->
   <select id="listBySystemAndWXUnionId" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user where appid=#{appId} and wx_union_id=#{unionId}
      from yeshi_ec_user where system=#{system} and wx_union_id=#{unionId}
   </select>
   <!-- 根据AppId与淘宝OpenId获取用户 -->
   <select id="listByAppIdAndTaoBaoOpenId" resultMap="BaseResultMap">
   <!-- 根据系统与淘宝OpenId获取用户 -->
   <select id="listBySystemAndTaoBaoOpenId" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user where appid=#{appId} and identifycode=#{openId}
      from yeshi_ec_user where  system=#{system} and identifycode=#{openId}
   </select>
   <!-- 根据AppId与电话号码获取用户 -->
   <select id="listByAppIdAndPhone" resultMap="BaseResultMap"
   <!-- 根据系统与电话号码获取用户 -->
   <select id="listBySystemAndPhone" resultMap="BaseResultMap"
      useCache="false" flushCache="true">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user where appid=#{appId} and phone=#{phone}
      from yeshi_ec_user where  system=#{system} and phone=#{phone}
   </select>
   <!-- 根据AppId与电话号码获取用户 -->
   <select id="getEffectiveUserInfoByPhone" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user
      where phone=#{phone} AND state = 0
      where phone=#{phone} AND system=#{system} AND state = 0
      LIMIT 1
   </select>
   <!-- 根据AppId与电话号码获取用户 -->
   <select id="getEffectiveUserInfoByWXUnionId" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user
      where wx_union_id=#{unionId} AND state = 0
      where wx_union_id=#{unionId} AND system=#{system}  AND state = 0
      LIMIT 1
   </select>
@@ -290,18 +289,13 @@
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_user
      where wx_open_id=#{wxOpenId} AND state = 0
      where wx_open_id=#{wxOpenId} AND system=#{system}  AND state = 0
      LIMIT 1
   </select>
   <select id="getMaxUid" resultType="java.lang.Long">select max(id) from
      yeshi_ec_user
   </select>
   <!-- 两个账号的业务融合 -->
   <select id="connectUser">
      call procedure_connect_user(#{mainUid},#{lessUid})
   </select>
   <select id="queryInfo" resultMap="BaseResultMapVO">
   SELECT * FROM yeshi_ec_user u