|
@@ -138,7 +138,7 @@
|
|
|
CONCAT(',',c.customer_type_id,',') as customerTypeId
|
|
CONCAT(',',c.customer_type_id,',') as customerTypeId
|
|
|
FROM
|
|
FROM
|
|
|
${dbName}_customer.c_customer_subsidy_${operatorId} c
|
|
${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
|
|
on c.subsidy_customer_id = csp.subsidy_customer_id
|
|
|
LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
|
|
LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
|
|
|
WHERE
|
|
WHERE
|
|
@@ -358,6 +358,49 @@
|
|
|
order by o.id
|
|
order by o.id
|
|
|
limit 10000
|
|
limit 10000
|
|
|
</select>
|
|
</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 <(
|
|
|
|
|
+ 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 <(
|
|
|
|
|
+ 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>
|
|
</mapper>
|