|
@ -75,20 +75,63 @@ |
|
|
SELECT DISTINCT ip_address FROM fx_member WHERE ip_address is not null |
|
|
SELECT DISTINCT ip_address FROM fx_member WHERE ip_address is not null |
|
|
</select> |
|
|
</select> |
|
|
<select id="getSpend" resultType="com.example.demo.domain.dou.Spend"> |
|
|
<select id="getSpend" resultType="com.example.demo.domain.dou.Spend"> |
|
|
|
|
|
SELECT * |
|
|
|
|
|
FROM ( |
|
|
SELECT |
|
|
SELECT |
|
|
fm.nickname, |
|
|
|
|
|
fy.content, |
|
|
|
|
|
fy.pay_type, |
|
|
|
|
|
fm.jwcode, |
|
|
|
|
|
fm.ip_address , |
|
|
|
|
|
fy.money_free , |
|
|
|
|
|
fy.money_buy , |
|
|
|
|
|
fy.money , |
|
|
|
|
|
fy.source_name, |
|
|
|
|
|
fy.`time` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fm.nickname, |
|
|
|
|
|
fy.content, |
|
|
|
|
|
fy.pay_type, |
|
|
|
|
|
fy.source_type AS good, |
|
|
|
|
|
fm.jwcode, |
|
|
|
|
|
fm.ip_address, |
|
|
|
|
|
fy.money_free, |
|
|
|
|
|
fy.money_buy, |
|
|
|
|
|
fy.money AS jinbiCostTotal, |
|
|
|
|
|
fy.source_name, |
|
|
|
|
|
fy.`time` AS createTime, |
|
|
|
|
|
CASE |
|
|
|
|
|
WHEN LOCATE('直播间', content) > 0 AND LOCATE('送礼物', content) > 0 THEN |
|
|
|
|
|
SUBSTRING_INDEX(SUBSTRING(content, LOCATE('直播间', content) + CHAR_LENGTH('直播间')), '送礼物', 1) |
|
|
|
|
|
ELSE |
|
|
|
|
|
NULL |
|
|
|
|
|
END AS room |
|
|
|
|
|
FROM fx_yaoqing_records fy |
|
|
|
|
|
LEFT JOIN fx_member fm ON fm.id = fy.uid |
|
|
|
|
|
WHERE 1=1 |
|
|
|
|
|
<if test="jwcode != null and jwcode.length > 0"> |
|
|
|
|
|
AND fm.jwcode = #{jwcode} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ipAddress != null and ipAddress.length > 0"> |
|
|
|
|
|
AND fm.ip_address = #{ipAddress} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="sourceName != null and sourceName.length > 0"> |
|
|
|
|
|
AND fy.source_name = #{sourceName} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="payType != null and payType.length > 0"> |
|
|
|
|
|
AND fy.pay_type = #{payType} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="good != null and good.length > 0"> |
|
|
|
|
|
AND fy.source_type = #{good} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="startTime != null and endTime != null"> |
|
|
|
|
|
AND FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
) AS subquery |
|
|
|
|
|
WHERE 1=1 |
|
|
|
|
|
<if test="room != null and room.length > 0"> |
|
|
|
|
|
AND room LIKE CONCAT('%', #{room}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<choose> |
|
|
|
|
|
<when test="sortField != null and sortField.length > 0 or sortOrder != null and sortOrder.length > 0"> |
|
|
|
|
|
ORDER BY ${sortField} ${sortOrder} |
|
|
|
|
|
</when> |
|
|
|
|
|
</choose> |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="getSpendTotal" resultType="java.lang.Integer"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
sum(fy.money) as SpendTotal |
|
|
FROM fx_member fm |
|
|
FROM fx_member fm |
|
|
LEFT JOIN fx_yaoqing_records fy ON fm.id = fy.uid |
|
|
|
|
|
|
|
|
LEFT JOIN fx_yaoqing_records fy ON fm.id = fy.uid |
|
|
<where> |
|
|
<where> |
|
|
<if test="jwcode != null and jwcode.length > 0"> |
|
|
<if test="jwcode != null and jwcode.length > 0"> |
|
|
AND fm.jwcode = #{jwcode} |
|
|
AND fm.jwcode = #{jwcode} |
|
@ -102,6 +145,41 @@ |
|
|
<if test="payType != null and payType.length > 0"> |
|
|
<if test="payType != null and payType.length > 0"> |
|
|
AND fy.pay_type = #{payType} |
|
|
AND fy.pay_type = #{payType} |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
<if test="sourceType != null and sourceType.length > 0"> |
|
|
|
|
|
AND fy.source_type = #{sourceType} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="startTime != null and endTime != null"> |
|
|
|
|
|
and FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="getPay" resultType="com.example.demo.domain.dou.Pay"> |
|
|
|
|
|
SELECT fm.nickname, |
|
|
|
|
|
fm.jwcode, |
|
|
|
|
|
fm.ip_address, |
|
|
|
|
|
fy.content as type, |
|
|
|
|
|
fy.order_no, |
|
|
|
|
|
fy.money, |
|
|
|
|
|
fy.money_free, |
|
|
|
|
|
fy.money_buy, |
|
|
|
|
|
fy.money/50, |
|
|
|
|
|
fy.`time` |
|
|
|
|
|
from fx_yaoqing_records as fy |
|
|
|
|
|
LEFT JOIN fx_member as fm on fy.uid = fm.id |
|
|
|
|
|
<where> |
|
|
|
|
|
`data`=0 |
|
|
|
|
|
<if test="jwcode != null"> |
|
|
|
|
|
and fm.jwcode = #{jwcode} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="orderNo != null and orderNo.length > 0"> |
|
|
|
|
|
and fy.order_no = #{orderNo} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="type != null and type.length > 0"> |
|
|
|
|
|
and type LIKE CONCAT('%', #{type}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ipAddress != null and ipAddress.length > 0"> |
|
|
|
|
|
and fm.ip_address = #{ipAddress} |
|
|
|
|
|
</if> |
|
|
<if test="startTime != null and endTime != null"> |
|
|
<if test="startTime != null and endTime != null"> |
|
|
and FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
|
and FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
|
</if> |
|
|
</if> |
|
@ -112,26 +190,28 @@ |
|
|
</when> |
|
|
</when> |
|
|
</choose> |
|
|
</choose> |
|
|
</select> |
|
|
</select> |
|
|
<select id="getSpendTotal" resultType="java.lang.Integer"> |
|
|
|
|
|
|
|
|
<select id="getPayIp" resultType="java.lang.String"> |
|
|
|
|
|
select DISTINCT ip_address from fx_member WHERE ip_address is not null |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="getRechargeTotal" resultType="com.example.demo.domain.dou.RechargeTotal"> |
|
|
SELECT |
|
|
SELECT |
|
|
sum(fy.money) as SpendTotal |
|
|
|
|
|
FROM fx_member fm |
|
|
|
|
|
LEFT JOIN fx_yaoqing_records fy ON fm.id = fy.uid |
|
|
|
|
|
|
|
|
sum(money)/50 as priceTotal, |
|
|
|
|
|
sum(money) as countTotal |
|
|
|
|
|
from fx_yaoqing_records as fy |
|
|
|
|
|
LEFT JOIN fx_member as fm on fy.uid = fm.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="jwcode != null and jwcode.length > 0"> |
|
|
|
|
|
AND fm.jwcode = #{jwcode} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="ipAddress != null and ipAddress.length > 0"> |
|
|
|
|
|
AND fm.ip_address = #{ipAddress} |
|
|
|
|
|
|
|
|
`data`=0 |
|
|
|
|
|
<if test="jwcode != null"> |
|
|
|
|
|
and fm.jwcode = #{jwcode} |
|
|
</if> |
|
|
</if> |
|
|
<if test="sourceName != null and sourceName.length > 0"> |
|
|
|
|
|
AND fy.source_name = #{sourceName} |
|
|
|
|
|
|
|
|
<if test="orderNo != null and orderNo.length > 0"> |
|
|
|
|
|
and fy.order_no = #{orderNo} |
|
|
</if> |
|
|
</if> |
|
|
<if test="payType != null and payType.length > 0"> |
|
|
|
|
|
AND fy.pay_type = #{payType} |
|
|
|
|
|
|
|
|
<if test="type != null and type.length > 0"> |
|
|
|
|
|
and type LIKE CONCAT('%', #{type}, '%') |
|
|
</if> |
|
|
</if> |
|
|
<if test="sourceType != null and sourceType.length > 0"> |
|
|
|
|
|
AND fy.source_type = #{sourceType} |
|
|
|
|
|
|
|
|
<if test="ipAddress != null and ipAddress.length > 0"> |
|
|
|
|
|
and fm.ip_address = #{ipAddress} |
|
|
</if> |
|
|
</if> |
|
|
<if test="startTime != null and endTime != null"> |
|
|
<if test="startTime != null and endTime != null"> |
|
|
and FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
|
and FROM_UNIXTIME(fy.`time`) BETWEEN #{startTime} AND #{endTime} |
|
@ -139,5 +219,4 @@ |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |