扫描二维码入场逻辑

This commit is contained in:
2023-09-05 09:27:00 +08:00
parent f0ef32ffc6
commit 52aa9659a2
41 changed files with 1562 additions and 492 deletions

View File

@@ -0,0 +1,171 @@
<?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.sv.mapper.BarcodeMapper" >
<resultMap id="BaseResultMap" type="com.sv.entity.Barcode" >
<constructor >
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="barcode" jdbcType="VARCHAR" javaType="java.lang.String" />
<arg column="status" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="member_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="venue_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="enter" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="modified_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
<arg column="created_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
<arg column="modified_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
</constructor>
</resultMap>
<sql id="Base_Column_List" >
id, barcode, status, member_id, venue_id, enter, created_id, modified_id, created_time,
modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from sv_barcode
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from sv_barcode
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.sv.entity.Barcode" >
insert into sv_barcode (id, barcode, status,
member_id, venue_id, enter,
created_id, modified_id, created_time,
modified_time)
values (#{id,jdbcType=INTEGER}, #{barcode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{memberId,jdbcType=INTEGER}, #{venueId,jdbcType=INTEGER}, #{enter,jdbcType=INTEGER},
#{createdId,jdbcType=INTEGER}, #{modifiedId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
#{modifiedTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.sv.entity.Barcode" >
insert into sv_barcode
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="barcode != null" >
barcode,
</if>
<if test="status != null" >
status,
</if>
<if test="memberId != null" >
member_id,
</if>
<if test="venueId != null" >
venue_id,
</if>
<if test="enter != null" >
enter,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="barcode != null" >
#{barcode,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="memberId != null" >
#{memberId,jdbcType=INTEGER},
</if>
<if test="venueId != null" >
#{venueId,jdbcType=INTEGER},
</if>
<if test="enter != null" >
#{enter,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sv.entity.Barcode" >
update sv_barcode
<set >
<if test="barcode != null" >
barcode = #{barcode,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
<if test="memberId != null" >
member_id = #{memberId,jdbcType=INTEGER},
</if>
<if test="venueId != null" >
venue_id = #{venueId,jdbcType=INTEGER},
</if>
<if test="enter != null" >
enter = #{enter,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sv.entity.Barcode" >
update sv_barcode
set barcode = #{barcode,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
member_id = #{memberId,jdbcType=INTEGER},
venue_id = #{venueId,jdbcType=INTEGER},
enter = #{enter,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
modified_id = #{modifiedId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="writeOffCode" parameterType="String" >
update sv_barcode
set status = 1
where barcode = #{barcode,jdbcType=VARCHAR}
</update>
<select id="findBarcode" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from sv_barcode
where member_id = #{memberId,jdbcType=INTEGER}
and venue_id = #{venueId,jdbcType=INTEGER}
and status = 0
</select>
</mapper>

View File

@@ -8,8 +8,6 @@
<result column="stream" property="stream"/>
<result column="venue_id" property="venueId"/>
<result column="venue_type" property="venueType"/>
<result column="bind_member" property="bindMember"/>
<result column="bind_time" property="bindTime"/>
<result column="status" property="status"/>
<result column="created_id" property="createdId"/>
<result column="modified_id" property="modifiedId"/>
@@ -35,9 +33,6 @@
venue_id,
status,
venue_type,
device_type,
bind_member,
bind_time,
created_id,
modified_id,
created_time,
@@ -52,8 +47,6 @@
#{stream, jdbcType=VARCHAR},
#{venue_id, jdbcType=INTEGER},
#{venue_type, jdbcType=INTEGER},
#{bind_member, jdbcType=INTEGER},
#{bind_time, jdbcType=TIMESTAMP},
#{createdId, jdbcType=INTEGER},
#{modifiedId, jdbcType=INTEGER},
#{createdTime, jdbcType=TIMESTAMP},
@@ -92,12 +85,6 @@
<if test="venueType != null">
venue_type,
</if>
<if test="bindMember != null">
bind_member,
</if>
<if test="bindTime != null">
bind_time,
</if>
<if test="status != null">
status,
</if>
@@ -133,12 +120,6 @@
<if test="venueType != null">
#{venueType},
</if>
<if test="bindMember != null">
#{bindMember},
</if>
<if test="bindTime != null">
#{bindTime},
</if>
<if test="status != null">
#{status},
</if>
@@ -203,12 +184,6 @@
<if test="venueType != null">
venue_type = #{venueType},
</if>
<if test="bindMember != null">
bind_member = #{bindMember},
</if>
<if test="bindTime != null">
bind_time = #{bindTime},
</if>
<if test="createdId != null">
created_id = #{createdId},
</if>
@@ -275,16 +250,16 @@
<select id="findByDevice" resultType="com.sv.entity.Device">
SELECT
<include refid="Field"></include> FROM sv_device
WHERE 1=1 AND name = #{deviceName} and venue_id=#{venueId} and deleted = 0
WHERE 1=1 and venue_id=#{venueId} and deleted = 0 and status = 2
</select>
<update id="bindMember">
UPDATE sv_device set bind_member = #{bindMember},bind_time = now()
WHERE name = #{deviceName} and venue_id=#{venueId}
</update>
<!-- <update id="bindMember">-->
<!-- UPDATE sv_device set bind_member = #{bindMember},bind_time = now()-->
<!-- WHERE name = #{deviceName} and venue_id=#{venueId}-->
<!-- </update>-->
<update id="unBindMember">
UPDATE sv_device set bind_member = null,bind_time = null
WHERE name = #{deviceName} and venue_id=#{venueId}
</update>
<!-- <update id="unBindMember">-->
<!-- UPDATE sv_device set bind_member = null,bind_time = null-->
<!-- WHERE name = #{deviceName} and venue_id=#{venueId}-->
<!-- </update>-->
</mapper>

View File

@@ -331,7 +331,7 @@
<select id="findLastByMember" resultMap="MemberEnterVeneuLogMap">
SELECT id,member_id,venue_id,created_time,member_card_id,type
FROM sv_member_enter_veneu_log
WHERE member_id = #{memberId} and type = 0 and venue_id = #{venueId} and deleted = 0 order by created_time desc LIMIT 1
WHERE member_id = #{memberId} and venue_id = #{venueId} and deleted = 0 order by created_time desc LIMIT 1
</select>
<select id="findLastNoTypeByMember" resultMap="MemberEnterVeneuLogMap">
@@ -352,4 +352,4 @@
and DATE_FORMAT(created_time,'%X-%m-%d') = #{today} and deleted = 0
</select>
</mapper>
</mapper>

View File

@@ -48,7 +48,7 @@
<sql id="tableName">
sv_member_money_log
</sql>
<!-- 字段 -->
<sql id="Field">
id,
@@ -331,4 +331,20 @@
ORDER BY
created_time DESC
</select>
</mapper>
<!-- oms 查询用户账单 -->
<select id="selectLastLog" resultMap="MemberMoneyLogMap">
SELECT
<include refid="Field"></include>
FROM
sv_member_money_log
WHERE
member_id = #{memberId}
AND venue_id = #{venueId}
AND deleted = 0
ORDER BY
created_time DESC
LIMIT 1
</select>
</mapper>

View File

@@ -90,7 +90,7 @@
domainObjectName 给表对应的 model 起名字
注意:大小写敏感问题。
-->
<table tableName="sys_wx_config" domainObjectName="WxConfig"
<table tableName="sv_barcode" domainObjectName="Barcode"
enableInsert="true"
enableDeleteByPrimaryKey="true"
enableSelectByPrimaryKey="true"