From 4d4805096b898a6e99f31794facb81794bd1fcf7 Mon Sep 17 00:00:00 2001 From: jyy <935090232@qq.com> Date: Mon, 25 Jan 2021 09:39:24 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/hive2.0' into hive2.0 --- zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 103 insertions(+), 0 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 new file mode 100644 index 0000000..b42140a --- /dev/null +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.matrix.system.hive.dao.SysVipLabelDao"> + <insert id="insert" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true" + keyProperty="id"> + insert sys_vip_label ( + create_time, + create_by, + id, + label, + shop_id, + company_id, + is_all, + user_id, + color + ) values ( + now(), + #{createBy}, + #{id}, + #{label}, + #{shopId}, + #{companyId}, + #{isAll}, + #{userId}, + #{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> + + <update id="update"> + update sys_vip_label + <set> + <if test="label != null and label !='' "> + label = #{label}, + </if> + <if test="color != null and color !='' "> + color = #{color}, + </if> + </set> + WHERE ID=#{id} + </update> + + <delete id="deleteById"> + delete from sys_vip_label + where id=#{id} + </delete> + + + <select id="selectByVipId" resultType="com.matrix.system.hive.bean.SysVipLabel"> + 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 + 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 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> + + <delete id="deleteRelateByVipId"> + delete from sys_vip_label_relate + where vip_id=#{vipId} + </delete> +</mapper> \ No newline at end of file -- Gitblit v1.9.1