<?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="com.ruoyi.purchase.mapper.PurchaseLedgerMapper">
|
|
<update id="updateContractAmountById">
|
UPDATE purchase_ledger
|
SET contract_amount = #{totalTaxInclusiveAmount}
|
WHERE id = #{id}
|
</update>
|
<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>
|