| | |
| | | select |
| | | id as id, |
| | | money as money, |
| | | expirationTime as expirationTime, |
| | | insertTime as insertTime, |
| | | companyId as companyId, |
| | | state as state, |
| | |
| | | from t_user_red_packet_record a |
| | | left join t_user_activity_redenvelope b on (a.redPacketActivityId = b.id) |
| | | left join t_user_activity c on (b.userActivityId = c.id) |
| | | where a.state = 1 |
| | | where a.state != 0 |
| | | <if test="null != uid"> |
| | | and a.userId = #{uid} |
| | | </if> |
| | |
| | | |
| | | |
| | | <select id="queryRemainingAmount" resultType="double"> |
| | | select ifnull(sum(remainingAmount), 0) from t_user_red_packet_record where userId = #{uid} |
| | | select ifnull(sum(remainingAmount), 0) from t_user_red_packet_record where userId = #{uid} and state = 1 |
| | | </select> |
| | | </mapper> |