qin 1 год назад
Родитель
Сommit
6cdd66e577

+ 17 - 0
src/main/java/com/poteviohealth/cgp/statistics/mapper/OrderMapper.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.poteviohealth.cgp.common.integrated.ListParams;
 import com.poteviohealth.cgp.common.integrated.customer.model.CustomerServiceParams;
 import com.poteviohealth.cgp.common.integrated.customer.model.CustomerSubsidyDTO;
+import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanDTO;
+import com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanPageDTO;
 import com.poteviohealth.cgp.common.integrated.partner.model.AreaDTO;
 import com.poteviohealth.cgp.statistics.model.Order;
 import com.poteviohealth.cgp.statistics.model.outdto.*;
@@ -204,4 +206,19 @@ public interface OrderMapper extends BaseMapper<Order>{
      */
     @SqlParser(filter=true)
     LinkedList<OrderCostWebOutDTO> costOrderExcel(@Param(Constants.WRAPPER) Wrapper wrapper,@Param("dbName")String dbName,@Param("operatorId")Integer operatorId,@Param("start")Integer start);
+
+    @SqlParser(filter = true)
+    int pageCardListSize(@Param("queryParam") MemberPlanPageDTO dto, @Param(Constants.WRAPPER) Wrapper wrapper,@Param("dbName") String dbName);
+
+    /**
+     * excel
+     * @param wrapper
+     * @return
+     */
+    @SqlParser(filter=true)
+    LinkedList<MemberPlanDTO> pageCardList(@Param("queryParam") MemberPlanPageDTO dto, @Param(Constants.WRAPPER) Wrapper wrapper,@Param("dbName") String dbName, @Param("start")Integer start);
+
+
+
+
 }

+ 46 - 3
src/main/resources/mapper/statistics/OrderMapper.xml

@@ -138,7 +138,7 @@
             CONCAT(',',c.customer_type_id,',') as customerTypeId
         FROM
             ${dbName}_customer.c_customer_subsidy_${operatorId} c
-            join (select subsidy_customer_id from  c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
+            join (select subsidy_customer_id from  ${dbName}_customer.c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
                 on c.subsidy_customer_id = csp.subsidy_customer_id
                LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
         WHERE
@@ -358,6 +358,49 @@
         order by o.id
             limit 10000
     </select>
-
-
+    <select id="pageCardListSize" resultType="java.lang.Integer">
+        select count(*) from (
+        select count(d.id)
+        from ${dbName}_finance.c_card_acc_detail d
+        left join (SELECT d.id,
+        SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
+        FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
+        LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
+        )
+        where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
+        on d.id = a.id
+        <if test="queryParam.stationIds!=null and queryParam.stationIds.size()>0">
+            and a.stationId in
+            <foreach collection="queryParam.stationIds" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        where d.yn = 0 and d.type = 1 and d.station_ids != ''
+        and  ${ew.sqlSegment}
+        group by d.id) t
+    </select>
+    <select id="pageCardList" resultType="com.poteviohealth.cgp.common.integrated.finance.model.MemberPlanDTO">
+        select d.id,d.name,d.phone,d.id_number,d.category_name,d.type_name,d.customer_address,d.customer_type_name,
+        case when d.enable =1 then '启用' else '停用' end as enabled,TRUNCATE(d.balance/100,2) as balance
+        from ${dbName}_finance.c_card_acc_detail d
+        left join (SELECT d.id,
+        SUBSTRING_INDEX( SUBSTRING_INDEX( d.station_ids, ',', b.id + 1 ), ',', -1 ) AS stationId
+        FROM ${dbName}_finance.c_card_acc_detail d INNER JOIN t_number b ON b.id &lt;(
+        LENGTH( d.station_ids ) - LENGTH( REPLACE(d.station_ids,',','') )  +  1
+        )
+        where d.yn = 0 and d.type = 1 and d.station_ids != '' and  ${ew.sqlSegment}  ) a
+        on d.id = a.id
+        <if test="queryParam.stationIds!=null and queryParam.stationIds.size()>0">
+            and a.stationId in
+            <foreach collection="queryParam.stationIds" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        where d.yn = 0 and d.type = 1 and d.station_ids != ''
+        and d.id > #{start}
+        and ${ew.sqlSegment}
+        group by d.id
+        order by d.id
+        limit 10000
+    </select>
 </mapper>