|
@@ -41,13 +41,44 @@
|
|
t.biz_name_,
|
|
t.biz_name_,
|
|
max(t.create_time_) as create_time_
|
|
max(t.create_time_) as create_time_
|
|
from user_cash_account_record t
|
|
from user_cash_account_record t
|
|
- where exists(
|
|
|
|
|
|
+ where t.biz_type_ = 'LIVE' and exists(
|
|
select 1 from user_cash_account_record t1
|
|
select 1 from user_cash_account_record t1
|
|
- where t1.id_ = #{id} and t1.biz_id_ = t.biz_id_ and t1.biz_type_ = t.biz_type_
|
|
|
|
|
|
+ where t1.biz_id_ = t.biz_id_ and t1.biz_type_ = 'LIVE' and t1.id_ = #{id}
|
|
)
|
|
)
|
|
group by t.account_id_,t.in_or_out_,t.biz_type_,biz_id_,biz_name_
|
|
group by t.account_id_,t.in_or_out_,t.biz_type_,biz_id_,biz_name_
|
|
|
|
+ union all
|
|
|
|
+ select
|
|
|
|
+ t.id_,
|
|
|
|
+ t.account_id_,
|
|
|
|
+ t.trans_amount_,
|
|
|
|
+ t.account_balance_,
|
|
|
|
+ t.in_or_out_,
|
|
|
|
+ t.biz_type_,
|
|
|
|
+ t.biz_id_,
|
|
|
|
+ t.biz_name_,
|
|
|
|
+ t.create_time_
|
|
|
|
+ from user_cash_account_record t
|
|
|
|
+ where t.biz_type_ != 'LIVE' and t.id_ = #{id}
|
|
) t
|
|
) t
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <sql id="selectCondition">
|
|
|
|
+ <if test="null != param.userId">
|
|
|
|
+ AND t.account_id_ = #{param.userId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="null != param.inOrOut">
|
|
|
|
+ AND t.in_or_out_ = #{param.inOrOut}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="null != param.bizType">
|
|
|
|
+ AND t.biz_type_ = #{param.bizType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.startTime !=null">
|
|
|
|
+ <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="param.endTime !=null">
|
|
|
|
+ <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
|
+ </if>
|
|
|
|
+ </sql>
|
|
|
|
|
|
<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo">
|
|
<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.UserAccountRecordVo">
|
|
SELECT
|
|
SELECT
|
|
@@ -67,24 +98,23 @@
|
|
t.biz_name_,
|
|
t.biz_name_,
|
|
max(t.create_time_) as create_time_
|
|
max(t.create_time_) as create_time_
|
|
from user_cash_account_record t
|
|
from user_cash_account_record t
|
|
- <where>
|
|
|
|
- <if test="null != param.userId">
|
|
|
|
- AND t.account_id_ = #{param.userId}
|
|
|
|
- </if>
|
|
|
|
- <if test="null != param.inOrOut">
|
|
|
|
- AND t.in_or_out_ = #{param.inOrOut}
|
|
|
|
- </if>
|
|
|
|
- <if test="null != param.bizType">
|
|
|
|
- AND t.biz_type_ = #{param.bizType}
|
|
|
|
- </if>
|
|
|
|
- <if test="param.startTime !=null">
|
|
|
|
- <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
|
|
|
|
- </if>
|
|
|
|
- <if test="param.endTime !=null">
|
|
|
|
- <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
+ where t.biz_type_ = 'LIVE'
|
|
|
|
+ <include refid="selectCondition"/>
|
|
group by t.account_id_,t.in_or_out_,t.biz_type_,biz_id_,biz_name_
|
|
group by t.account_id_,t.in_or_out_,t.biz_type_,biz_id_,biz_name_
|
|
|
|
+ union all
|
|
|
|
+ select
|
|
|
|
+ t.id_,
|
|
|
|
+ t.account_id_,
|
|
|
|
+ t.trans_amount_,
|
|
|
|
+ t.account_balance_,
|
|
|
|
+ t.in_or_out_,
|
|
|
|
+ t.biz_type_,
|
|
|
|
+ t.biz_id_,
|
|
|
|
+ t.biz_name_,
|
|
|
|
+ t.create_time_
|
|
|
|
+ from user_cash_account_record t
|
|
|
|
+ where t.biz_type_ != 'LIVE'
|
|
|
|
+ <include refid="selectCondition"/>
|
|
) t
|
|
) t
|
|
left join course_schedule a on t.biz_id_ = a.id_ and t.biz_type_ in ('PRACTICE','LIVE')
|
|
left join course_schedule a on t.biz_id_ = a.id_ and t.biz_type_ in ('PRACTICE','LIVE')
|
|
order by t.create_time_ desc
|
|
order by t.create_time_ desc
|