From 473c4e9cf23f9e43ae2f93c4da79b2204e34c3f8 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Tue, 09 Mar 2021 11:50:48 +0800
Subject: [PATCH] 解决微信回调报错问题
---
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
index 4e58387..5203a47 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -108,6 +108,10 @@
<!-- 扩展属性 -->
<result property="staffName" column="STAFF_NAME"/>
<result property="shopName" column="SHOP_NAME"/>
+ <association property="vipLevel" javaType="com.matrix.system.hive.bean.SysVipLevel" >
+ <result property="levelName" column="levelName"/>
+ <result property="vipLevel" column="vipLevel"/>
+ </association>
</resultMap>
<!-- 查询几天内过生日的会员 -->
@@ -534,6 +538,8 @@
where a.ID=#{id}
</select>
+
+
<!-- 根据手机和密码查询 -->
<select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap">
<include refid="select"></include>
@@ -636,14 +642,11 @@
COMMISSION_ALL,IN_DATE,STAFF_ID,SHOP_ID,IS_DELETE,REMARK,PASSWORD,
EMAIL,CREATE_TIME,UUID,BALANCE,blood,sfCard,link,marry,vocation
from sys_vip_info
- where
- SHOP_ID=#{shopId}
- and (
- instr(PHONE,#{keyWord})
+ where company_id=#{companyId}
+ and (instr(PHONE,#{keyWord})
or instr(VIP_NAME ,#{keyWord})
or instr(zjm ,#{keyWord})
- or instr(VIP_NO ,#{keyWord})
- )
+ or instr(VIP_NO ,#{keyWord}))
limit 0,15
</select>
@@ -668,7 +671,7 @@
and
(a.VIP_NO =#{key} or
a.VIP_NAME =#{key} or
- a.PHONE =#{key}) and a.shop_id=#{shopId}
+ a.PHONE =#{key})
</select>
<select id="getLevelIdByMoney" resultMap="SysVipInfoMap">
@@ -965,12 +968,15 @@
a.province,
a.city,
a.area,
- a.recommend_id
+ a.recommend_id,
+ e.level_name levelName,
+ e.vip_level vipLevel
</sql>
<sql id="from">
from sys_vip_info a
left join sys_users c on c.su_id =a.STAFF_ID
left join sys_shop_info d ON d.ID=a.SHOP_ID
+ left join sys_vip_level e on a.level_id=e.id
</sql>
@@ -1255,7 +1261,8 @@
a.PHONE phone,
a.photo photo,
b.arriveCnt arriveCnt,
- g.shop_short_name shopName
+ g.shop_short_name shopName,
+ z.level_name vipLevel
from sys_vip_info a
left join (
select x.vip_id, count(1) arriveCnt from (
@@ -1273,6 +1280,7 @@
group by date_format(datatime, '%Y-%m-%d'), vip_id
) x group by x.vip_id
) b on a.ID=b.vip_id
+ left join sys_vip_level z on a.level_id=z.id
<!-- 本月消费 -->
<if test="record.sort == 'used'">
left join (
@@ -1309,6 +1317,9 @@
<if test="record.shopId != null">
and a.shop_id=#{record.shopId}
</if>
+ <if test="record.companyId != null">
+ and a.company_id=#{record.companyId}
+ </if>
<if test='record.birthType=="1"'>
and a.BIRTHDAY1 between curdate() and DATE_ADD(CURDATE(), INTERVAL 3 DAY)
</if>
@@ -1331,6 +1342,9 @@
<if test="record.sort != 'monthArrived' and record.sort != 'yearArrived'">
order by ${record.sort} ${record.order}
</if>
+ <if test="record.offset >=0 and record.limit >0">
+ limit #{record.offset},#{record.limit}
+ </if>
</select>
<select id="selectVipInfoById" resultType="com.matrix.system.app.vo.VipInfoVo">
@@ -1345,11 +1359,10 @@
e.shop_short_name shopName,
sum(IFNULL(b.gift_money, 0) + IFNULL(b.real_money, 0)) totalBalance,
sum(IFNULL(b.gift_money, 0)) giftBalance,
- sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) totalShopping
+ (select sum(IFNULL(d.goods_cash, 0) + IFNULL(d.proj_cash, 0) + IFNULL(d.card_cash, 0)) from achieve_new d where d.vip_id=a.id) totalShopping
from sys_vip_info a
left join money_card_use b on a.ID = b.vip_id and b.status='有效'
left join sys_vip_level c on a.LEVEL_ID = c.ID
- left join achieve_new d on a.ID = d.vip_id
left join sys_shop_info e on a.SHOP_ID=e.ID
where a.ID=#{id}
</select>
--
Gitblit v1.9.1