yuan
2026-10-11 ccc9d4533bc7b696f6d539720a6052abc44ff7a5
src/main/resources/mapper/account/AccountIncomeMapper.xml
@@ -20,6 +20,8 @@
        <if test="accountIncome.incomeMethod != null and accountIncome.incomeMethod != '' ">
            AND income_method = #{accountIncome.incomeMethod}
        </if>
        <!-- 2026-10-12 需求:收入管理按收入日期倒序 -->
        ORDER BY income_date DESC, id DESC
    </select>
    <select id="accountIncomeExport" resultType="com.ruoyi.account.pojo.AccountIncome">
        SELECT
@@ -54,7 +56,7 @@
        <if test="dateQueryDto.entryDateEnd != null and dateQueryDto.entryDateEnd != '' ">
            AND income_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
        group by income_type
        group by income_type, sdd.dict_label
    </select>
    <select id="report1" resultType="java.math.BigDecimal">
        SELECT
@@ -69,4 +71,17 @@
            AND income_date &lt;= DATE_FORMAT(#{dateQueryDto.entryDateEnd},'%Y-%m-%d')
        </if>
    </select>
    <select id="selectIncomeStats"
            resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto">
        SELECT DATE_FORMAT(income_date, #{dateFormat}) AS dateStr,
               IFNULL(SUM(income_money), 0)            AS amount
        FROM account_income
        WHERE income_date BETWEEN #{startDate} AND #{endDate}
#           AND business_type = 1
        GROUP BY dateStr
        ORDER BY dateStr
    </select>
</mapper>