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/SysVipLabelDao.xml | 137 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 125 insertions(+), 12 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
index b71cf45..cae0a7a 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
@@ -9,7 +9,6 @@
create_time,
create_by,
id,
- vip_id,
label,
shop_id,
company_id,
@@ -17,10 +16,9 @@
user_id,
color
) values (
- #{createTime},
+ now(),
#{createBy},
#{id},
- #{vipId},
#{label},
#{shopId},
#{companyId},
@@ -29,6 +27,81 @@
#{color}
)
</insert>
+
+ <insert id="insertRelate" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true"
+ keyProperty="id">
+ insert sys_vip_label_relate (
+ id,
+ label_id,
+ vip_id
+ ) values (
+ #{id},
+ #{labelId},
+ #{vipId}
+ )
+ </insert>
+
+ <select id="selectInPage" resultType="com.matrix.system.hive.bean.SysVipLabel">
+ select
+ a.create_time createTime,
+ a.create_by createBy,
+ a.id,
+ a.label,
+ a.shop_id shopId,
+ a.company_id companyId,
+ a.is_all isAll,
+ a.user_id userId,
+ a.color,
+ b.shop_short_name shopName
+ from sys_vip_label a
+ left join sys_shop_info b on a.shop_id=b.id
+ where 1=1
+ <if test="record!=null">
+ <if test="record.label!=null and record.label!=''">
+ and a.label like CONCAT('%', CONCAT(#{record.label},'%'))
+ </if>
+ <if test="record.isAll!=null and record.isAll!=0">
+ and a.is_all=#{record.isAll}
+ </if>
+ <if test="record.userId!=null and record.userId!=''">
+ and a.user_id=#{record.userId}
+ </if>
+ <if test="record.companyId!=null and record.companyId!=''">
+ and a.company_id=#{record.companyId}
+ </if>
+ </if>
+ <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
+ <if test="pageVo.sort !=null and pageVo.order !=null">
+ order by
+ ${pageVo.sort} ${pageVo.order}
+ </if>
+ <if test="pageVo.offset >=0 and pageVo.limit >0">
+ limit
+ #{pageVo.offset},#{pageVo.limit}
+ </if>
+ </if>
+ </select>
+
+ <select id="selectTotal" resultType="java.lang.Integer">
+ select
+ count(1)
+ from sys_vip_label
+ where 1=1
+ <if test="record!=null">
+ <if test="record.label!=null and record.label!=''">
+ and label like CONCAT('%', CONCAT(#{record.label},'%'))
+ </if>
+ <if test="record.isAll!=null and record.isAll!=0">
+ and is_all=#{record.isAll}
+ </if>
+ <if test="record.userId!=null and record.userId!=''">
+ and user_id=#{record.userId}
+ </if>
+ <if test="record.companyId!=null and record.companyId!=''">
+ and company_id=#{record.companyId}
+ </if>
+ </if>
+ </select>
<update id="update">
update sys_vip_label
@@ -48,28 +121,68 @@
where id=#{id}
</delete>
+ <delete id="deleteByIds" parameterType="java.util.List">
+ delete from sys_vip_label where id in
+ <foreach collection="list" index="index" item="item" open="("
+ separator="," close=")">
+ #{item}
+ </foreach>
+ </delete>
+
<select id="selectByVipId" resultType="com.matrix.system.hive.bean.SysVipLabel">
- select *
- from sys_vip_label
- where vip_id=#{vipId}
+ select b.*
+ from sys_vip_label_relate a
+ inner join sys_vip_label b on a.label_id=b.id
+ where a.vip_id=#{vipId}
</select>
<select id="selectByModel" resultType="com.matrix.system.hive.bean.SysVipLabel">
- select * from sys_vip_label
+ select
+ create_time createTime,
+ create_by createBy,
+ id,
+ label,
+ shop_id shopId,
+ company_id companyId,
+ is_all isAll,
+ user_id userId,
+ color
+ from sys_vip_label
where 1=1
<if test="record!=null">
<if test="record.label!=null and record.label!=''">
- and label=#{record.label}
+ and label like CONCAT('%', CONCAT(#{record.label},'%'))
</if>
- <if test="record.vipId!=null">
- and vip_id=#{record.vipId}
+ <if test="record.isAll!=null and record.isAll!=0">
+ and is_all=#{record.isAll}
+ </if>
+ <if test="record.userId!=null and record.userId!=''">
+ and user_id=#{record.userId}
+ </if>
+ <if test="record.companyId!=null and record.companyId!=''">
+ and company_id=#{record.companyId}
</if>
</if>
</select>
- <delete id="deleteByVipId">
- delete from sys_vip_label
+ <delete id="deleteRelateByVipId">
+ delete from sys_vip_label_relate
where vip_id=#{vipId}
</delete>
+
+ <select id="selectById" resultType="com.matrix.system.hive.bean.SysVipLabel">
+ select
+ create_time createTime,
+ create_by createBy,
+ id,
+ label,
+ shop_id shopId,
+ company_id companyId,
+ is_all isAll,
+ user_id userId,
+ color
+ from sys_vip_label
+ where id=#{id}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1