|
|
|
@ -49,61 +49,7 @@ D:\dsWork\YltProject\Ylt\ms-finance\src\main\java\com\charge\finance\controller\
|
|
|
|
|
LEFT JOIN t_user tu ON te.user_id = tu.id
|
|
|
|
|
LEFT JOIN t_user_card c ON tu.id = c.user_id
|
|
|
|
|
WHERE
|
|
|
|
|
refund_state IN ( 1, 2, 3, 4 )
|
|
|
|
|
<if test="dto.ownerId!=null and dto.ownerId!=''">
|
|
|
|
|
AND tu.user_owner_id = #{dto.ownerId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.userType!=null and dto.userType !=''">
|
|
|
|
|
AND tu.user_type = #{dto.userType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.userName!=null and dto.userName!=''">
|
|
|
|
|
AND tu.user_name like "%"#{dto.userName}"%"
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.phone != null and dto.phone != ''">
|
|
|
|
|
AND tu.phone= #{dto.phone}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="dto.outTradeNo!=null and dto.outTradeNo!=''">
|
|
|
|
|
AND outtradeno = #{dto.outTradeNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.userId!=null and dto.userId!=''">
|
|
|
|
|
AND tu.id = #{dto.userId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="dto.refundOuttradno!=null and dto.refundOuttradno!=''">
|
|
|
|
|
AND refund_outtradno = #{dto.refundOuttradno}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="dto.payType!=null and dto.payType!=''">
|
|
|
|
|
AND pay_type = #{dto.payType}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="dto.refundTimeType != null">
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="dto.refundTimeType == 1">
|
|
|
|
|
<if test="dto.refundStartTime !=null and dto.refundStartTime!=''">
|
|
|
|
|
AND refund_apply_time >= date_format(#{dto.refundStartTime} ,'%Y-%m-%d %H:%i:%s')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.refundEndTime !=null and dto.refundEndTime!=''">
|
|
|
|
|
AND refund_apply_time <= date_format(#{dto.refundEndTime} ,'%Y-%m-%d %H:%i:%s')
|
|
|
|
|
</if>
|
|
|
|
|
</when>
|
|
|
|
|
<when test="dto.refundTimeType == 2">
|
|
|
|
|
<if test="dto.refundStartTime !=null and dto.refundStartTime!=''">
|
|
|
|
|
AND refund_time >= date_format(#{dto.refundStartTime} ,'%Y%m%d%H%i%s')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.refundEndTime !=null and dto.refundEndTime!=''">
|
|
|
|
|
AND refund_time <= date_format(#{dto.refundEndTime} ,'%Y%m%d%H%i%s')
|
|
|
|
|
</if>
|
|
|
|
|
</when>
|
|
|
|
|
</choose>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.refundState!=null and dto.refundState!=''">
|
|
|
|
|
and refund_state = #{dto.refundState}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dto.cardNo!=null and dto.cardNo!=''">
|
|
|
|
|
AND c.card_no = #{dto.cardNo}
|
|
|
|
|
</if>
|
|
|
|
|
refund_state IN ( 1, 2, 3, 4 )
|
|
|
|
|
GROUP BY te.id
|
|
|
|
|
ORDER BY te.id DESC
|
|
|
|
|
</select>
|
|
|
|
@ -129,13 +75,35 @@ select * from t_account_recharge where user_id=53958 and refund_state=6 order by
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sql
|
|
|
|
|
App支付记录表 t_account_recharge
|
|
|
|
|
refund_state
|
|
|
|
|
refund_state IN ( 1, 2, 3, 4 )
|
|
|
|
|
退款状态(0未退款 1已退款 2 退款失败 3退款申请审核 4未退款驳回 5建帮活动不可退款)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```sql
|
|
|
|
|
4200002307202408129671269468
|
|
|
|
|
|
|
|
|
|
# 查看这个充值订单是不是可以退款
|
|
|
|
|
select * from t_account_recharge where outtradeno='4200002307202408129671269468'
|
|
|
|
|
refund_state =6 是参加了活动不能退款的
|
|
|
|
|
refund_state =0 是未退款的
|
|
|
|
|
应该检查此充值订单的refund_state 是否为0。
|
|
|
|
|
|
|
|
|
|
# 同时需要满足金额小于一个指定的数值,比如50元
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select * from t_account_recharge where outtradeno='4200002328202408130579252328'
|
|
|
|
|
# 其它充值订单
|
|
|
|
|
4200002345202408109427639311
|
|
|
|
|
4200002227202406207784559922
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|