From c253b555c7905c5136d47cd615ef545fa50cc6ad Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Sun, 20 Feb 2022 21:24:16 +0800
Subject: [PATCH] Merge branch 'api_score_meger'

---
 zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml
index a767566..96da104 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml
@@ -7,6 +7,7 @@
 	<resultMap type="com.matrix.system.hive.bean.MoneyCardUseFlow" id="MoneyCardUseFlowMap">
 		<id property="id" column="id" />
 		<result property="orderNo" column="order_no" />
+		<result property="payNo" column="pay_no" />
 		<result property="operationId" column="operation_id" />
 		<result property="content" column="content" />
 		<result property="createTime" column="create_time" />
@@ -31,6 +32,7 @@
 	<resultMap type="com.matrix.system.hive.bean.MoneyCardUseFlow" id="MoneyCardUseFlowSimpleMap">
 		<id property="id" column="id" />
 		<result property="orderNo" column="order_no" />
+		<result property="payNo" column="pay_no" />
 		<result property="operationId" column="operation_id" />
 		<result property="content" column="content" />
 		<result property="createTime" column="create_time" />
@@ -51,6 +53,7 @@
 		INSERT INTO money_card_use_flow (
 		id,
 		order_no,
+		pay_no,
 		operation_id,
 		content,
 		create_time,
@@ -66,6 +69,7 @@
 		VALUES (
 		#{id},
 		#{orderNo},
+		#{payNo},
 		#{operationId},
 		#{content},
 		#{createTime},
@@ -94,7 +98,7 @@
 			<if test="content != null and content !='' ">
 				content = #{content},
 			</if>
-			<if test="createTime != null and createTime !='' ">
+			<if test="createTime != null  ">
 				create_time = #{createTime},
 			</if>
 			<if test="vipId != null and vipId !='' ">
@@ -109,8 +113,8 @@
 			<if test="type != null and type !='' ">
 				type = #{type},
 			</if>
-			<if test="taotal != null and taotal !='' ">
-				taotal = #{taotal},
+			<if test="total != null and total !='' ">
+				total = #{total},
 			</if>
 			<if test="times != null and times !='' ">
 				times = #{times},
@@ -149,6 +153,7 @@
 		select
 		id,
 		order_no,
+		pay_no,
 		operation_id,
 		content,
 		create_time,
@@ -160,7 +165,7 @@
 		times,
 		gift_money,
 		balance,
-		(SELECT STAFF_NAME from sys_shopstaff_info a WHERE operation_id=a.id) staffName,
+		(SELECT su_name from sys_users a WHERE operation_id=a.su_id) staffName,
 		(SELECT VIP_NAME FROM sys_vip_info b WHERE vip_id=b.ID) vipName,
 		(SELECT card_NAME FROM money_card_use c WHERE car_use_id=c.ID) cardName
 		from money_card_use_flow
@@ -171,6 +176,9 @@
 			</if>
 			<if test="record.orderNo != null and record.orderNo !='' ">
 				and order_no = #{record.orderNo}
+			</if>
+			<if test="record.payNo != null and record.payNo !='' ">
+				and pay_no = #{record.payNo}
 			</if>
 			<if test="record.operationId != null and record.operationId !='' ">
 				and operation_id = #{record.operationId}
@@ -215,6 +223,9 @@
 			<if test="record.orderNo != null and record.orderNo !='' ">
 				and order_no = #{record.orderNo}
 			</if>
+			<if test="record.payNo != null and record.payNo !='' ">
+				and pay_no = #{record.payNo}
+			</if>
 			<if test="record.operationId != null and record.operationId !='' ">
 				and operation_id = #{record.operationId}
 			</if>
@@ -245,6 +256,7 @@
 		select
 		id,
 		order_no,
+		pay_no,
 		operation_id,
 		content,
 		create_time,
@@ -269,6 +281,7 @@
 		select
 		id,
 		order_no,
+		pay_no,
 		operation_id,
 		content,
 		create_time,
@@ -291,6 +304,9 @@
 			</if>
 			<if test="record.orderNo != null and record.orderNo !='' ">
 				and order_no = #{record.orderNo}
+			</if>
+			<if test="record.payNo != null and record.payNo !='' ">
+				and pay_no = #{record.payNo}
 			</if>
 			<if test="record.operationId != null and record.operationId !='' ">
 				and operation_id = #{record.operationId}
@@ -315,6 +331,41 @@
 			</if>
 		</if>
 	</select>
+
+	<select id="selectForWxInPage" resultMap="MoneyCardUseFlowMap">
+		select
+			id,
+			order_no,
+			pay_no,
+			content,
+			create_time,
+			type,
+			total,
+			times,
+			gift_money,
+			balance,
+			(SELECT su_name from sys_users a WHERE operation_id=a.su_id) staffName
+		from money_card_use_flow
+		<where>
+				and car_use_id=#{record.carUseId}
+			<if test="record.queryTime!=null and record.queryTime!=''">
+				and DATE_FORMAT(create_time,'%Y-%m')=#{record.queryTime}
+			</if>
+			<if test="record.revenueType==1">
+				and  total>0
+			</if>
+			<if test="record.revenueType==2">
+				<![CDATA[ and total<0 ]]>
+			</if>
+		</where>
+		order by  create_time desc
+	</select>
+
+	<update id="updateVipCardId">
+		update money_card_use_flow
+			set car_use_id=#{cardId}
+		where vip_id=#{vipId} and type='会员充值'
+	</update>
 </mapper>
 
 		
\ No newline at end of file

--
Gitblit v1.9.1