<?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.MoneyBorrowWarningMapper">


    <select id="getBankRank" resultType="vip.xiaonuo.money.entity.vo.MoneyBankNameVo">
        select IFNULL(sum(borrow_price),'0') 'borrowPrice',bank_name 'bankName' from money_borrow_warning
        ${ew.customSqlSegment}
        group by bank_name
    </select>

    <select id="getBorrowPrice" resultType="vip.xiaonuo.money.entity.vo.MoneyBorrowPriceVo">
        select IFNULL(sum(borrow_price),'0') 'borrowPrice',borrow_time 'borrowTime' from money_borrow_warning
        ${ew.customSqlSegment}
        group by (DATE_FORMAT(borrow_time,'%Y-%m'))
        order by borrow_time asc
    </select>
</mapper>
