| | |
| | | |
| | | <!--查询所有总交易金额--> |
| | | <select id="getAllTradeMoney" resultType="java.lang.Double"> |
| | | SELECT IFNULL(SUM(num),0) as value FROM ( |
| | | SELECT ROUND(IFNULL(SUM(num),0), 2) as value FROM ( |
| | | (SELECT IFNULL(SUM(payMoney),0) as num FROM t_order_taxi where FIND_IN_SET(state,'8,9') |
| | | <if test="companyId != null and companyId != ''"> |
| | | and companyId = #{companyId} |
| | |
| | | AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | ) |
| | | union all |
| | | select IFNULL(SUM(money),0) as num from t_order_cancel where state = 2 |
| | | <if test="companyId != null and companyId != ''"> |
| | | and ( |
| | | if(orderType = 1, orderId in (select id from t_order_private_car where state = 10 and companyId = #{companyId}), |
| | | orderId in (select id from t_order_logistics where state = 10 and companyId = #{companyId})) |
| | | ) |
| | | </if> |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | union all |
| | | select IFNULL(SUM(money),0) as num from t_reassign where state in (2, 3) |
| | | <if test="companyId != null and companyId != ''"> |
| | | and ( |
| | | if(orderType = 1, orderId in (select id from t_order_private_car where state = 10 and companyId = #{companyId}), |
| | | orderId in (select id from t_order_logistics where state = 10 and companyId = #{companyId})) |
| | | ) |
| | | </if> |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND (insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | ) as o |
| | | </select> |
| | | |
| | | <!--查询所有总收益--> |
| | | <select id="getAllIncomeMoney" resultType="java.lang.Double"> |
| | | SELECT IFNULL(SUM(money),0) as value FROM t_income where userType = 1 |
| | | SELECT ROUND(IFNULL(SUM(money),0), 2) as value FROM t_income where userType = 1 |
| | | <if test="companyId != null and companyId != ''"> |
| | | and objectId = #{companyId} |
| | | </if> |