【WX】预算配置

This commit is contained in:
limqhz
2023-02-09 17:45:43 +08:00
parent 94dc4e7cf3
commit 658ec47494
5 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?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.quinn.mapper.AccBudgetMapper">
<select id="getBudget" resultType="com.quinn.common.wx.BudgetDTO">
select a.id,b.id "expendId",IFNULL(a.budget,0) "budget",b.user_id,a.gmt_create,
IFNULL(
(select sum(money) from qn_acc_bill c where c.money_type = a.expend_id and c.user_id = #{userId} and c.date <![CDATA[ >= ]]> #{startDate} and c.date <![CDATA[ <= ]]> #{endDate})
,0) "used",
b.icon "expendIcon"
from qn_acc_budget a right join qn_acc_setting b on a.expend_id = b.id
where b.user_id = #{userId}
</select>
</mapper>