<?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="org.springblade.modules.system.mapper.PayLogMapper">

    <select id="logPage" resultType="org.springblade.modules.system.vo.PayLogVO">
        select
        bpl.*,
        bu.real_name as userName,
        bu.account as phone
        from  blade_pay_log bpl
        left join blade_user bu  on bu.id=bpl.receiver_user_id
        where 1=1
        <if test="@cn.hutool.core.util.ObjectUtil@isNotNull(p.startTime)">
            and bpl.create_time &gt;= #{p.startTime}
        </if>
        <if test="@cn.hutool.core.util.ObjectUtil@isNotNull(p.endTime)">
            and bpl.create_time &lt;= #{p.endTime}
        </if>
        <if test="@cn.hutool.core.util.StrUtil@isNotBlank(p.userName)">
            and bu.real_name like concat ('%',#{p.userName},'%')
        </if>
        <if test="@cn.hutool.core.util.StrUtil@isNotBlank(p.phone)">
            and bu.account = #{p.phone}
        </if>
        order by bpl.create_time desc
    </select>

</mapper>
