Helius
2022-05-11 562ac2c071de933e04aec1fb32ee98c7a85d448d
src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -216,7 +216,10 @@
    </select>
    <select id="selectByIdAndNoLevel" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member where referrer_id=#{refererId} and level != #{level}
        select * from mall_member where level != #{level}
        <if test="refererId != null and refererId != ''">
            and referrer_id=#{refererId}
        </if>
    </select>
    <select id="selectMallMemberByInviteIdAndLevel" resultType="cc.mrbird.febs.mall.entity.MallMember">
@@ -299,5 +302,26 @@
            ) t3 ON DATE_FORMAT(t3.CREATED_TIME, '%Y-%m-%d') = DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d')
        GROUP BY
            DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d')
        ORDER BY
            DATE_FORMAT(a.CREATED_TIME, '%Y-%m-%d') DESC
    </select>
    <select id="selectRankListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from (
          select a.id, a.name, a.invite_id, a.avatar, sum(b.amount) amount,max(order_time) orderTime from mall_member a, mall_order_info b
          where  a.id=b.member_id and b.status = 4
        <!-- 日 -->
        <if test="record.query == '1'">
        </if>
        <!-- 月 -->
        <if test="record.query == '2'">
            and date_format(#{record.createdTime},'%Y-%m') = date_format(b.order_time,'%Y-%m')
        </if>
        <if test="record.amount != null">
            and amount = #{record.amount}
        </if>
          group by a.id
      ) a order by amount desc, a.orderTime desc
    </select>
</mapper>