Helius
2021-04-09 717fc5108619373bd7528c7b8b80ca31dd3f3cea
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -523,6 +523,46 @@
      from area where id=1
   </select>
   <select id="selectCardAmount" resultType="java.util.TreeMap">
      select
      <foreach collection="list" index="index" item="item"   separator=","  >
         (
         select IFNULL(sum(IFNULL(amount, 0)), 0)
         from sys_order_flow a
         inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
         where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
         <if test="shopId != null">
            and a.shop_id=#{shopId}
         </if>
         <if test="companyId != null">
            and a.company_id=#{companyId}
         </if>
         ) as t${index}
      </foreach>
      from area where id=1
   </select>
   <select id="selectFreeAmount" resultType="java.util.TreeMap">
      select
      <foreach collection="list" index="index" item="item"   separator=","  >
         (
         select IFNULL(sum(IFNULL(amount, 0)), 0)
         from sys_order_flow a
         inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
         where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
         <if test="shopId != null">
            and a.shop_id=#{shopId}
         </if>
         <if test="companyId != null">
            and a.company_id=#{companyId}
         </if>
         ) as t${index}
      </foreach>
      from area where id=1
   </select>
   <select id="selectVipAchieveInPage" resultType="com.matrix.system.app.vo.VipAchieveDataShowVo">
      <foreach collection="list" index="index" item="item"   separator="union all"  >
         select