|
@@ -204,4 +204,31 @@
|
|
|
WHERE s.type_ = 'REWARDS' AND DATE_FORMAT(s.create_time_,'%Y-%m') = #{currentMonth}
|
|
|
AND s.user_id_ = #{teacherId} AND s.description_ = #{activeId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <sql id="queryAccountDetailCondition">
|
|
|
+ <where>
|
|
|
+ <if test="userId!=null">
|
|
|
+ user_id_=#{userId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <select id="queryAccountDetail" resultMap="SysUserCashAccountDetail">
|
|
|
+ SELECT * FROM (
|
|
|
+ SELECT create_time_,amount_,balance_,status_,type_,description_,comment_ FROM sys_user_cash_account_detail
|
|
|
+ <include refid="queryAccountDetailCondition"/>
|
|
|
+ UNION ALL
|
|
|
+ SELECT create_time_,amount_,balance_,status_,type_,description_,comment_ FROM sys_user_courses_account_detail
|
|
|
+ <include refid="queryAccountDetailCondition"/>
|
|
|
+ ) t ORDER BY t.create_time_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+ <select id="countAccountDetails" resultType="int">
|
|
|
+ SELECT COUNT(t.id_) FROM (
|
|
|
+ SELECT id_,create_time_,amount_,balance_,status_,type_,description_,comment_ FROM sys_user_cash_account_detail
|
|
|
+ <include refid="queryAccountDetailCondition"/>
|
|
|
+ UNION ALL
|
|
|
+ SELECT id_,create_time_,amount_,balance_,status_,type_,description_,comment_ FROM sys_user_courses_account_detail
|
|
|
+ <include refid="queryAccountDetailCondition"/>
|
|
|
+ ) t
|
|
|
+ </select>
|
|
|
</mapper>
|