Helius
2021-04-09 0cd61f7b848c04e2fc431e03272e1b27c3a171cd
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -18,6 +18,7 @@
      <result property="freeConsume" column="free_consume" />
      <result property="hisConsume" column="his_consume" />
      <result property="goodsCash" column="goods_cash" />
      <result property="cardCash" column="card_cash" />
      <result property="projNum" column="proj_num" />
      <result property="numberOfPeople" column="number_of_people" />
      <result property="shopName" column="shop_name" />
@@ -66,7 +67,6 @@
      c.vip_name,
      e.name as pro_name,
      b.ZK_TOTAL as zk_total,
      a.goods_cash,
      a.his_consume,
      a.free_consume,
      f.su_name meiliao,
@@ -79,6 +79,8 @@
      h.shop_short_name shop_name,
      a.order_type,
      a.achieveType,
      case when a.pay_method = '现金' then goods_cash end goods_cash,
      case when a.pay_method = '划扣' then goods_cash end card_cash,
      j.pay_method
      from
      achieve_new a
@@ -918,15 +920,13 @@
   <select id="selectUserAchieveByTime" resultType="com.matrix.system.app.vo.UserAchieveVo">
      select
         sale_id id,
         (select ifnull(sum(case b.pay_method when '现金' then goods_cash else 0 end),0)
         (select ifnull(sum(case pay_method when '现金' then goods_cash else 0 end),0)
            from achieve_new a
            inner join sys_order_item b on a.order_item_id=b.ID
         where a.beault_id=#{userId}
         and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
         ) orderCash,
         (select ifnull(sum(case b.pay_method when '划扣' then goods_cash else 0 end),0)
         (select ifnull(sum(case pay_method when '划扣' then goods_cash else 0 end),0)
            from achieve_new a
            inner join sys_order_item b on a.order_item_id=b.ID
         where  a.beault_id=#{userId}
         and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
         ) cash,
@@ -977,6 +977,7 @@
      select
         b.su_name name,
         b.su_id id,
         b.su_photo photo,
         sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount,
         c.shop_short_name shopName
      from achieve_new a