From 4f99b1df96a35a0cd1339cc1fa29efc1566c25fc Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Fri, 12 Jan 2024 10:25:52 +0800
Subject: [PATCH] 套餐

---
 src/main/resources/mapper/modules/MallAchieveRecordMapper.xml |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallAchieveRecordMapper.xml b/src/main/resources/mapper/modules/MallAchieveRecordMapper.xml
index 8a51fdc..200cf15 100644
--- a/src/main/resources/mapper/modules/MallAchieveRecordMapper.xml
+++ b/src/main/resources/mapper/modules/MallAchieveRecordMapper.xml
@@ -2,4 +2,30 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cc.mrbird.febs.mall.mapper.MallAchieveRecordMapper">
 
+    <select id="selectAchieveTotal" resultType="java.math.BigDecimal">
+        select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record
+        where 1=1
+        <if test='type == "D"'>
+            and date_format(achieve_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d');
+        </if>
+        <if test='type == "M"'>
+            and date_format(achieve_time, '%Y-%m') = date_format(#{date}, '%Y-%m');
+        </if>
+    </select>
+
+    <select id="selectByMemberId" resultType="cc.mrbird.febs.mall.entity.MallAchieveRecord">
+        select
+               *
+        from mall_achieve_record
+        where member_id = #{memberId}
+    </select>
+
+    <select id="selectListByCostAmountAndIsNorMal" resultType="cc.mrbird.febs.mall.entity.MallAchieveRecord">
+        select
+               *
+        from mall_achieve_record
+        where cost_amount > #{costAmount}
+            and is_normal = #{isNormal}
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1