|
|
@@ -324,6 +324,7 @@
|
|
|
sn,
|
|
|
customer_phone,
|
|
|
product_string,
|
|
|
+ id_card as idCard,
|
|
|
DATE_FORMAT(order_time,'%Y-%m-%d %H:%i') AS orderTime,
|
|
|
TRUNCATE ( sum_price/ 100.0, 2 ) AS sumPrice,
|
|
|
TRUNCATE ( card_price/ 100.0, 2 ) AS cardPrice,
|
|
|
@@ -332,7 +333,11 @@
|
|
|
fund_price,
|
|
|
'已支付' as payStatusStr,
|
|
|
pay_account as payAccountStr,
|
|
|
- service_station_name
|
|
|
+ service_station_name,
|
|
|
+ street_name as streetName,
|
|
|
+ country_name as countryName,
|
|
|
+ case when source_id = 1 then '刷脸' when source_id = 2 then '手机号' else '' end as sourceStr,
|
|
|
+ case when eat_in = 0 then '否' when eat_in = 1 then '是' else '' end as eatInStr
|
|
|
FROM
|
|
|
${dbName}_order.o_dishes_order_${operatorId} o
|
|
|
WHERE o.yn = 0
|
|
|
@@ -392,6 +397,7 @@
|
|
|
select count(*) from (
|
|
|
select count(d.id)
|
|
|
from ${dbName}_finance.c_card_acc_detail d
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
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 <(
|
|
|
@@ -399,6 +405,7 @@
|
|
|
)
|
|
|
where d.yn = 0 and d.type = 1 and d.station_ids != '' and ${ew.sqlSegment} ) a
|
|
|
on d.id = a.id
|
|
|
+ </if>
|
|
|
where d.yn = 0 and d.type = 1 and d.station_ids != ''
|
|
|
<if test="queryParam.stationIds.size()>0">
|
|
|
and a.stationId in
|
|
|
@@ -413,6 +420,7 @@
|
|
|
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
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
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 <(
|
|
|
@@ -420,6 +428,7 @@
|
|
|
)
|
|
|
where d.yn = 0 and d.type = 1 and d.station_ids != '' and ${ew.sqlSegment} ) a
|
|
|
on d.id = a.id
|
|
|
+ </if>
|
|
|
where d.yn = 0 and d.type = 1 and d.station_ids != ''
|
|
|
and d.id > #{start}
|
|
|
<if test="queryParam.stationIds.size()>0">
|
|
|
@@ -433,4 +442,68 @@
|
|
|
order by d.id
|
|
|
limit 10000
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="transRechargeExcelListAllSize" resultType="int">
|
|
|
+ select count(*)
|
|
|
+ from ${dbName}_finance.c_card_acc_detail d
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
+ 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 ${dbName}_finance.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>
|
|
|
+ left join ${dbName}_finance.c_card_acc_trans t on t.detail_id = d.id
|
|
|
+ where d.yn = 0 and t.yn = 0 and d.type = 1
|
|
|
+ and t.trans_type = 0
|
|
|
+ <if test="queryParam.startDate != null">
|
|
|
+ and t.build_time between #{queryParam.startDate} and #{queryParam.endDate}
|
|
|
+ </if>
|
|
|
+ and d.station_ids != ''
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
+ and a.stationId in
|
|
|
+ <foreach collection="queryParam.stationIds" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and ${ew.sqlSegment}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="transRechargeExcel"
|
|
|
+ resultType="com.poteviohealth.cgp.common.integrated.finance.model.CardAccTransRecharge">
|
|
|
+ select t.id, t.build_time,
|
|
|
+ d.name,
|
|
|
+ d.id_number,
|
|
|
+ TRUNCATE(t.amount/100,2) as amount,
|
|
|
+ d.type_name
|
|
|
+ from ${dbName}_finance.c_card_acc_detail d
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
+ 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 ${dbName}_finance.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>
|
|
|
+ left join ${dbName}_finance.c_card_acc_trans t on t.detail_id = d.id
|
|
|
+ where d.yn = 0 and t.yn = 0 and d.type = 1
|
|
|
+ and t.trans_type = 0
|
|
|
+ and t.id > #{start}
|
|
|
+ <if test="queryParam.startDate != null">
|
|
|
+ and t.build_time between #{queryParam.startDate} and #{queryParam.endDate}
|
|
|
+ </if>
|
|
|
+ and d.station_ids != ''
|
|
|
+ <if test="queryParam.stationIds.size()>0">
|
|
|
+ and a.stationId in
|
|
|
+ <foreach collection="queryParam.stationIds" item="item" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and ${ew.sqlSegment}
|
|
|
+ order by t.id
|
|
|
+ limit 10000
|
|
|
+ </select>
|
|
|
</mapper>
|