<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    
    <query name="findAllFeesBetweenDates">
        <![CDATA[
            SELECT 
                f
            FROM FeesView f 
                WHERE 
                    DATE(created_on) >= DATE(:startDate) AND 
                    DATE(:endDate) >= DATE(created_on)
            ORDER BY created_on DESC
        ]]>
    </query>
    
    <query name="findAllFeesBetweenDatesUser">
        <![CDATA[
            SELECT 
                f
            FROM FeesView f 
                WHERE 
                    DATE(created_on) >= DATE(:startDate) AND 
                    DATE(:endDate) >= DATE(created_on) AND
                    idUser = :user
            ORDER BY created_on DESC
        ]]>
    </query>
    
    <query name="findAllFeesBetweenDatesRoute">
        <![CDATA[
            SELECT 
                f
            FROM FeesView f 
                WHERE 
                    DATE(created_on) >= DATE(:startDate) AND 
                    DATE(:endDate) >= DATE(created_on) AND
                    idRoute = :route
            ORDER BY created_on DESC
        ]]>
    </query>

</hibernate-mapping>
