Files
sb-backend/src/main/resources/mapper/AccountSettingMapper.xml
T

18 lines
755 B
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sb.web.account.mapper.AccountSettingMapper">
<select id="findExpectedIncome" resultType="java.lang.Long">
SELECT expected_income FROM budget_income
WHERE member_id = #{memberId} AND `year` = #{year} AND `month` = #{month}
</select>
<update id="upsertExpectedIncome">
INSERT INTO budget_income (member_id, `year`, `month`, expected_income, updated_at)
VALUES (#{memberId}, #{year}, #{month}, #{expectedIncome}, NOW())
ON DUPLICATE KEY UPDATE expected_income = #{expectedIncome}, updated_at = NOW()
</update>
</mapper>