xuhy
2023-03-10 c12019a820f2b06cf7aae214e1e5dd70f623d1ac
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TRechargeRecordMapper.xml
@@ -18,7 +18,51 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, type, userId, code, amount, payType, payTime, payStatus, orderNumber, createTime
        id, `type`, userId, code, amount, payType, payTime, payStatus, orderNumber, createTime
    </sql>
    <select id="userRecharge" resultType="com.stylefeng.guns.modular.system.controller.resp.TRechargeRecordUserResp">
        select rr.id, rr.`type`, rr.userId, rr.code, rr.amount, rr.payType, rr.payTime, rr.payStatus, rr.orderNumber, rr.createTime,au.nickname AS userName,au.phone AS userPhone
        from t_recharge_record rr
        left join t_app_user au on rr.userId = au.id
        <where>
            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                AND rr.createTime between #{startTime} and #{endTime}
            </if>
            <if test="userName != null and userName != ''">
                AND au.nickname LIKE concat('%',#{userName},'%')
            </if>
            <if test="userPhone != null and userPhone != ''">
                AND au.phone LIKE concat('%',#{userPhone},'%')
            </if>
            <if test="code != null and code != ''">
                AND rr.code LIKE concat('%',#{code},'%')
            </if>
            AND rr.`type` = 1
        </where>
        ORDER BY rr.createTime DESC
    </select>
    <select id="agentRechargeList" resultType="com.stylefeng.guns.modular.system.controller.resp.TRechargeRecordAgentResp">
        select rr.id, rr.`type`, rr.userId, rr.code, rr.amount, rr.payType, rr.payTime, rr.payStatus, rr.orderNumber, rr.createTime,
               d.name AS driverName,d.phone AS driverPhone,a.principal,a.principalPhone,a.provinceName,a.cityName
        from t_recharge_record rr
        left join t_driver d on rr.userId = d.id
        left join t_agent a on d.agentId = a.id
        <where>
            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                AND rr.createTime between #{startTime} and #{endTime}
            </if>
            <if test="driverName != null and driverName != ''">
                AND d.name LIKE concat('%',#{driverName},'%')
            </if>
            <if test="driverPhone != null and driverPhone != ''">
                AND d.phone LIKE concat('%',#{driverPhone},'%')
            </if>
            <if test="roleType != null and roleType == 3">
                AND a.id = #{objectId}
            </if>
            AND rr.`type` = 3
        </where>
        ORDER BY rr.createTime DESC
    </select>
</mapper>