You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.9 KiB

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qniao.dam.infrastructure.persistent.dao.view.WithdrawAuditViewDao">
<resultMap id="UserPageWithdrawAuditVo"
type="com.qniao.dam.api.query.withdrawaudit.user.response.UserPageWithdrawAuditVo">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="extDetailsInfo" column="ext_details_info"
typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
</resultMap>
<select id="pageWithdrawAudit" resultMap="UserPageWithdrawAuditVo">
select
dwa.id,
dwa.wallet_account_id,
dwa.wallet_account_user_id,
dwa.identity_type,
IF(dwa.identity_type=2,dao.full_name,dm.`name`) as walletAccountUserName,
dwa.withdraw_amount,
dwa.`status`,
dwa.`create_time` as applyTime,
dwa.withdraw_type,
dwa.ext_details_info
from da_withdraw_audit as dwa
LEFT JOIN da_matchmaker as dm on dwa.wallet_account_user_id=dm.user_id and dm.is_delete=0
LEFT JOIN da_organization as dao on dao.id=dwa.wallet_account_org_id
where dwa.is_delete=0
<if test="queryParams.queryUserId != null">
and dm.user_id = #{queryParams.queryUserId}
</if>
<if test="queryParams.queryOrgId != null">
and dao.id = #{queryParams.queryOrgId}
</if>
<if test="queryParams.status != null">
and dwa.`status` = #{queryParams.status}
</if>
<if test="queryParams.applyTimeFrom != null and queryParams.applyTimeTo != null">
and dwa.`create_time` BETWEEN #{queryParams.applyTimeFrom} and #{queryParams.applyTimeTo}
</if>
order by dwa.`create_time` desc
</select>
</mapper>