386 lines
14 KiB
XML
386 lines
14 KiB
XML
<?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.chaozhanggui.system.cashierservice.dao.TbShopUserMapper">
|
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
|
<result column="credit_amount" jdbcType="DECIMAL" property="creditAmount" />
|
|
<result column="consume_amount" jdbcType="DECIMAL" property="consumeAmount" />
|
|
<result column="consume_number" jdbcType="INTEGER" property="consumeNumber" />
|
|
<result column="level_consume" jdbcType="DECIMAL" property="levelConsume" />
|
|
<result column="status" jdbcType="TINYINT" property="status" />
|
|
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
|
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
|
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
|
|
<result column="parent_level" jdbcType="VARCHAR" property="parentLevel" />
|
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
|
<result column="head_img" jdbcType="VARCHAR" property="headImg" />
|
|
<result column="sex" jdbcType="TINYINT" property="sex" />
|
|
<result column="birth_day" jdbcType="VARCHAR" property="birthDay" />
|
|
<result column="telephone" jdbcType="VARCHAR" property="telephone" />
|
|
<result column="is_vip" jdbcType="TINYINT" property="isVip" />
|
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
|
|
|
<result column="dynamic_code" jdbcType="VARCHAR" property="dynamicCode" />
|
|
<result column="is_attention" jdbcType="TINYINT" property="isAttention" />
|
|
<result column="attention_at" jdbcType="INTEGER" property="attentionAt" />
|
|
<result column="is_shareholder" jdbcType="TINYINT" property="isShareholder" />
|
|
<result column="level" jdbcType="TINYINT" property="level" />
|
|
<result column="distribute_type" jdbcType="VARCHAR" property="distributeType" />
|
|
<result column="sort" jdbcType="INTEGER" property="sort" />
|
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
|
<result column="mini_open_id" jdbcType="VARCHAR" property="miniOpenId" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, amount, credit_amount, consume_amount, consume_number, level_consume, status,
|
|
merchant_id, shop_id, user_id, parent_id, parent_level, name, head_img, sex, birth_day,
|
|
telephone, is_vip, code, is_attention, attention_at, is_shareholder, level, distribute_type,
|
|
sort, created_at, updated_at, mini_open_id,dynamic_code
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from tb_shop_user
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
delete from tb_shop_user
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
|
insert into tb_shop_user (id, amount, credit_amount,
|
|
consume_amount, consume_number, level_consume,
|
|
status, merchant_id, shop_id,
|
|
user_id, parent_id, parent_level,
|
|
name, head_img, sex,
|
|
birth_day, telephone, is_vip,
|
|
code, is_attention, attention_at,
|
|
is_shareholder, level, distribute_type,
|
|
sort, created_at, updated_at,
|
|
mini_open_id)
|
|
values (#{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{creditAmount,jdbcType=DECIMAL},
|
|
#{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, #{levelConsume,jdbcType=DECIMAL},
|
|
#{status,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
|
|
#{userId,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{parentLevel,jdbcType=VARCHAR},
|
|
#{name,jdbcType=VARCHAR}, #{headImg,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT},
|
|
#{birthDay,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT},
|
|
#{code,jdbcType=VARCHAR}, #{isAttention,jdbcType=TINYINT}, #{attentionAt,jdbcType=INTEGER},
|
|
#{isShareholder,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{distributeType,jdbcType=VARCHAR},
|
|
#{sort,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
|
|
#{miniOpenId,jdbcType=VARCHAR})
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
|
insert into tb_shop_user
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="amount != null">
|
|
amount,
|
|
</if>
|
|
<if test="creditAmount != null">
|
|
credit_amount,
|
|
</if>
|
|
<if test="consumeAmount != null">
|
|
consume_amount,
|
|
</if>
|
|
<if test="consumeNumber != null">
|
|
consume_number,
|
|
</if>
|
|
<if test="levelConsume != null">
|
|
level_consume,
|
|
</if>
|
|
<if test="status != null">
|
|
status,
|
|
</if>
|
|
<if test="merchantId != null">
|
|
merchant_id,
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id,
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="parentId != null">
|
|
parent_id,
|
|
</if>
|
|
<if test="parentLevel != null">
|
|
parent_level,
|
|
</if>
|
|
<if test="name != null">
|
|
name,
|
|
</if>
|
|
<if test="headImg != null">
|
|
head_img,
|
|
</if>
|
|
<if test="sex != null">
|
|
sex,
|
|
</if>
|
|
<if test="birthDay != null">
|
|
birth_day,
|
|
</if>
|
|
<if test="telephone != null">
|
|
telephone,
|
|
</if>
|
|
<if test="isVip != null">
|
|
is_vip,
|
|
</if>
|
|
<if test="code != null">
|
|
code,
|
|
</if>
|
|
<if test="isAttention != null">
|
|
is_attention,
|
|
</if>
|
|
<if test="attentionAt != null">
|
|
attention_at,
|
|
</if>
|
|
<if test="isShareholder != null">
|
|
is_shareholder,
|
|
</if>
|
|
<if test="level != null">
|
|
level,
|
|
</if>
|
|
<if test="distributeType != null">
|
|
distribute_type,
|
|
</if>
|
|
<if test="sort != null">
|
|
sort,
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at,
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at,
|
|
</if>
|
|
<if test="miniOpenId != null">
|
|
mini_open_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="amount != null">
|
|
#{amount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="creditAmount != null">
|
|
#{creditAmount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="consumeAmount != null">
|
|
#{consumeAmount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="consumeNumber != null">
|
|
#{consumeNumber,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="levelConsume != null">
|
|
#{levelConsume,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="status != null">
|
|
#{status,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="merchantId != null">
|
|
#{merchantId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopId != null">
|
|
#{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="parentId != null">
|
|
#{parentId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="parentLevel != null">
|
|
#{parentLevel,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="name != null">
|
|
#{name,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="headImg != null">
|
|
#{headImg,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sex != null">
|
|
#{sex,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="birthDay != null">
|
|
#{birthDay,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="telephone != null">
|
|
#{telephone,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isVip != null">
|
|
#{isVip,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="code != null">
|
|
#{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isAttention != null">
|
|
#{isAttention,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="attentionAt != null">
|
|
#{attentionAt,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isShareholder != null">
|
|
#{isShareholder,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="level != null">
|
|
#{level,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="distributeType != null">
|
|
#{distributeType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sort != null">
|
|
#{sort,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
#{createdAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
#{updatedAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="miniOpenId != null">
|
|
#{miniOpenId,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
|
update tb_shop_user
|
|
<set>
|
|
<if test="amount != null">
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="creditAmount != null">
|
|
credit_amount = #{creditAmount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="consumeAmount != null">
|
|
consume_amount = #{consumeAmount,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="consumeNumber != null">
|
|
consume_number = #{consumeNumber,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="levelConsume != null">
|
|
level_consume = #{levelConsume,jdbcType=DECIMAL},
|
|
</if>
|
|
<if test="status != null">
|
|
status = #{status,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="merchantId != null">
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="shopId != null">
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="userId != null">
|
|
user_id = #{userId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="parentId != null">
|
|
parent_id = #{parentId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="parentLevel != null">
|
|
parent_level = #{parentLevel,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="name != null">
|
|
name = #{name,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="headImg != null">
|
|
head_img = #{headImg,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sex != null">
|
|
sex = #{sex,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="birthDay != null">
|
|
birth_day = #{birthDay,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="telephone != null">
|
|
telephone = #{telephone,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isVip != null">
|
|
is_vip = #{isVip,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="code != null">
|
|
code = #{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="isAttention != null">
|
|
is_attention = #{isAttention,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="attentionAt != null">
|
|
attention_at = #{attentionAt,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="isShareholder != null">
|
|
is_shareholder = #{isShareholder,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="level != null">
|
|
level = #{level,jdbcType=TINYINT},
|
|
</if>
|
|
<if test="distributeType != null">
|
|
distribute_type = #{distributeType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="sort != null">
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at = #{createdAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at = #{updatedAt,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="miniOpenId != null">
|
|
mini_open_id = #{miniOpenId,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
|
update tb_shop_user
|
|
set amount = #{amount,jdbcType=DECIMAL},
|
|
credit_amount = #{creditAmount,jdbcType=DECIMAL},
|
|
consume_amount = #{consumeAmount,jdbcType=DECIMAL},
|
|
consume_number = #{consumeNumber,jdbcType=INTEGER},
|
|
level_consume = #{levelConsume,jdbcType=DECIMAL},
|
|
status = #{status,jdbcType=TINYINT},
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
shop_id = #{shopId,jdbcType=VARCHAR},
|
|
user_id = #{userId,jdbcType=VARCHAR},
|
|
parent_id = #{parentId,jdbcType=VARCHAR},
|
|
parent_level = #{parentLevel,jdbcType=VARCHAR},
|
|
name = #{name,jdbcType=VARCHAR},
|
|
head_img = #{headImg,jdbcType=VARCHAR},
|
|
sex = #{sex,jdbcType=TINYINT},
|
|
birth_day = #{birthDay,jdbcType=VARCHAR},
|
|
telephone = #{telephone,jdbcType=VARCHAR},
|
|
is_vip = #{isVip,jdbcType=TINYINT},
|
|
code = #{code,jdbcType=VARCHAR},
|
|
is_attention = #{isAttention,jdbcType=TINYINT},
|
|
attention_at = #{attentionAt,jdbcType=INTEGER},
|
|
is_shareholder = #{isShareholder,jdbcType=TINYINT},
|
|
level = #{level,jdbcType=TINYINT},
|
|
distribute_type = #{distributeType,jdbcType=VARCHAR},
|
|
sort = #{sort,jdbcType=INTEGER},
|
|
created_at = #{createdAt,jdbcType=BIGINT},
|
|
updated_at = #{updatedAt,jdbcType=BIGINT},
|
|
mini_open_id = #{miniOpenId,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
|
|
<select id="selectByShopId" resultMap="BaseResultMap">
|
|
select * from tb_shop_user where shop_id=#{shopId} and is_vip=1
|
|
|
|
<if test="phone != null and phone !='' ">
|
|
and telephone like concat("%",#{phone},"%")
|
|
</if>
|
|
order by id desc
|
|
|
|
|
|
</select>
|
|
|
|
<select id="selectByUserIdAndShopId" resultMap="BaseResultMap">
|
|
select * from tb_shop_user where user_id=#{userId} and shop_id =#{shopId}
|
|
</select>
|
|
|
|
<select id="selectByShopIdAndDdynamicCode" resultMap="BaseResultMap">
|
|
select * from tb_shop_user where shop_id=#{shopId} and dynamic_code=#{memberAccount}
|
|
</select>
|
|
</mapper> |