| | |
| | | </if> |
| | | order by insertTime desc limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | <select id="exportRecord" resultType="map"> |
| | | select |
| | | case when pr.payType = 1 then '微信' |
| | | when pr.payType = 2 then '支付宝' end payTypeStr, |
| | | pr.amount, |
| | | pr.code, |
| | | pr.userId, |
| | | DATE_FORMAT(pr.insertTime,'%Y-%m-%d %H:%i:%S') as insertTimeStr, |
| | | case when pr.state = 1 then '失败' |
| | | when pr.state = 2 then '成功' end stateStr, |
| | | u.nickName, |
| | | u.phone |
| | | from t_payment_record pr |
| | | left join t_user u |
| | | on pr.userId = u.id |
| | | where pr.type = 1 and pr.category = 2 |
| | | <if test="userName != null and userName != ''"> |
| | | and u.nickName like CONCAT('%',#{userName},'%') |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and u.phone like CONCAT('%',#{phone},'%') |
| | | </if> |
| | | <if test="code != null and code != ''"> |
| | | and pr.code like CONCAT('%',#{code},'%') |
| | | </if> |
| | | <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
| | | and (pr.insertTime between CONCAT(#{startTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | </if> |
| | | order by pr.id desc |
| | | </select> |
| | | </mapper> |