note_book/RuoYi-Vue/ruoyi-homejizhang/src/main/resources/mapper/system/ChartMapper.xml

21 lines
706 B
XML
Raw Normal View History

2024-03-03 13:28:45 +00:00
<?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.app.system.mapper.ChatMapper">
<select id="pyline" resultType="com.ruoyi.app.system.domain.ChatDomain">
SELECT SUM(money) AS total_money, month, kind
FROM accounttb
WHERE `month` IS NOT NULL
<if test="Year != null">
AND `year` = #{Year}
</if>
<if test="startMonth != null and endMonth != null">
AND `month` BETWEEN #{startMonth} AND #{endMonth}
</if>
GROUP BY month, kind
ORDER BY month;
</select>
</mapper>