yujian
2019-12-19 bb07147aaa96d1ef4c99e358dbbe7dad160dc62a
fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -278,8 +278,8 @@
      where wx_union_id=#{unionId} AND state = 0
      LIMIT 1
   </select>
   <select id="getEffectiveUserInfoByWXOpenId" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
@@ -287,7 +287,7 @@
      where wx_open_id=#{wxOpenId} AND state = 0
      LIMIT 1
   </select>
   <select id="getMaxUid" resultType="java.lang.Long">select max(id) from
      yeshi_ec_user
   </select>
@@ -357,6 +357,11 @@
      <if test="userState == 2">
         AND u.`state` =2   <!-- 封禁用户 -->
      </if>
      <if test="userType!=null">
         AND u.type=#{userType}
      </if>
      <if test="startTime != null and startTime !='' ">
         AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
         DATE_FORMAT(#{startTime},'%Y%m%d')
@@ -427,6 +432,9 @@
      </if>
      <if test="userState == 2">
         AND u.`state` =2   <!-- 封禁用户 -->
      </if>
      <if test="userType!=null">
         AND u.type=#{userType}
      </if>
      <if test="startTime != null and startTime !='' ">
         AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
@@ -690,9 +698,12 @@
   </select>
   <select id="getUserInfoByInviteCode" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_user u
      LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =   u.`id`
      WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR uf.`uie_invite_code` = #{inviteCode}
      SELECT * FROM
      yeshi_ec_user u
      LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =
      u.`id`
      WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR
      uf.`uie_invite_code` = #{inviteCode}
      LIMIT 1
   </select>
@@ -721,17 +732,19 @@
      AND u.`wx_open_id` NOT LIKE 'o_b9%'
      LIMIT #{start},#{count}
   </select>
   <select id="getAutoExtractUserTo1212" resultMap="BaseResultMap">
      SELECT u.* FROM (SELECT v2.`hb_uid` FROM `yeshi_ec_hongbao_v2` v2
      WHERE <![CDATA[v2.`hb_create_time` > '2019-01-01' AND v2.`hb_create_time` < '2019-06-18']]>
      GROUP BY hb_uid)h
      LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid` = h.hb_uid
      LEFT JOIN  `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
      WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]> AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
         AND u.`state` = 0 AND u.`my_hongBao`<![CDATA[> 1]]>
         AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
         AND u.`wx_open_id` NOT LIKE 'o_b9%'
      LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid`
      = h.hb_uid
      LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
      WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]>
      AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
      AND u.`state` = 0 AND u.`my_hongBao`<![CDATA[> 1]]>
      AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
      AND u.`wx_open_id` NOT LIKE 'o_b9%'
      LIMIT #{start},#{count}
   </select>