| | |
| | | </where> |
| | | order by T1.entry_date desc |
| | | </select> |
| | | |
| | | <select id="selectIncomeStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto"> |
| | | SELECT DATE_FORMAT(entry_date, #{dateFormat}) as dateStr, IFNULL(SUM(contract_amount), 0) as amount |
| | | FROM sales_ledger |
| | | WHERE entry_date BETWEEN #{startDate} AND #{endDate} |
| | | GROUP BY dateStr |
| | | </select> |
| | | |
| | | <select id="selectCustomerSalesComposition" resultType="com.ruoyi.dto.MapDto"> |
| | | SELECT customer_name as name, CAST(IFNULL(SUM(contract_amount), 0) AS CHAR) as value |
| | | FROM sales_ledger |
| | | GROUP BY customer_name |
| | | </select> |
| | | </mapper> |