| | |
| | | WHERE |
| | | T1.sales_ledger_product_id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPurchaseStats" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto"> |
| | | SELECT DATE_FORMAT(entry_date, #{dateFormat}) as dateStr, IFNULL(SUM(contract_amount), 0) as amount |
| | | FROM purchase_ledger |
| | | WHERE entry_date BETWEEN #{startDate} AND #{endDate} |
| | | GROUP BY dateStr |
| | | </select> |
| | | |
| | | <select id="selectTotalPurchaseAmount" resultType="java.math.BigDecimal"> |
| | | SELECT IFNULL(SUM(contract_amount), 0) |
| | | FROM purchase_ledger |
| | | <where> |
| | | <if test="startDate != null and startDate != ''"> |
| | | AND entry_date >= #{startDate} |
| | | </if> |
| | | <if test="endDate != null and endDate != ''"> |
| | | AND entry_date <= #{endDate} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |