<?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="vip.xiaonuo.money.mapper.MoneyOverdueMapper">


    <select id="getUserRank" resultType="vip.xiaonuo.money.entity.vo.MoneyBorrowUserVo">
      SELECT
    w.`user_name` as userName,
    w.collect_price as collectPrice,
    COALESCE(o.money, 0) AS overduePrice
FROM
    `money_overdue`  AS w
LEFT JOIN
    money_write_overdue AS o
ON
    w.user_name = o.user_name
   <!-- WHERE date_time between #{startTime} and #{endTime}
        <if test="orgId!=null and orgId!=''">
            and  w.org_id = #{orgId}
        </if>-->
	GROUP BY  w.user_name
	ORDER BY w.collect_price DESC
    </select>
</mapper>
