检验二维码是否使用,增加二维码失效功能 & fixbug 未超过半小时只收一半钱
This commit is contained in:
@@ -187,4 +187,11 @@
|
||||
and status = 0
|
||||
</select>
|
||||
|
||||
<select id="checkIsUsed" resultMap="BaseResultMap" parameterType="String" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from sv_barcode
|
||||
where barcode = #{barcode,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -15,12 +15,13 @@
|
||||
<arg column="status" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="paying" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="pay_money" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="sum_pay_money" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="order_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
<arg column="order_add_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
</constructor>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, member_id, venue_id, created_time, modified_time, order_start, order_end, last_enter, last_out, status, paying, pay_money, order_sn,order_add_sn
|
||||
id, member_id, venue_id, created_time, modified_time, order_start, order_end, last_enter, last_out, status, paying, pay_money, sum_pay_money, order_sn,order_add_sn
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
select
|
||||
@@ -35,12 +36,12 @@
|
||||
<insert id="insert" parameterType="com.sv.entity.BarcodeOrderTime" >
|
||||
insert into sv_barcode_order_time (id, member_id, venue_id,
|
||||
created_time, modified_time, order_start,
|
||||
order_end, last_enter, last_out, status,paying ,pay_money,order_sn,order_add_sn)
|
||||
order_end, last_enter, last_out, status,paying ,pay_money,sum_pay_money,order_sn,order_add_sn)
|
||||
values (#{id,jdbcType=INTEGER}, #{memberId,jdbcType=INTEGER}, #{venueId,jdbcType=INTEGER},
|
||||
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP}, #{orderStart,jdbcType=TIMESTAMP},
|
||||
#{orderEnd,jdbcType=TIMESTAMP}, #{lastEnter,jdbcType=TIMESTAMP}, #{lastOut,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
|
||||
#{paying,jdbcType=INTEGER},#{payMoney,jdbcType=INTEGER}, #{orderSn,jdbcType=VARCHAR}
|
||||
,#{orderAddSn,jdbcType=VARCHAR})
|
||||
#{paying,jdbcType=INTEGER},#{payMoney,jdbcType=INTEGER}, #{sumPayMoney,jdbcType=INTEGER},
|
||||
#{orderSn,jdbcType=VARCHAR},#{orderAddSn,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sv.entity.BarcodeOrderTime" >
|
||||
insert into sv_barcode_order_time
|
||||
@@ -81,6 +82,9 @@
|
||||
<if test="payMoney != null" >
|
||||
pay_money,
|
||||
</if>
|
||||
<if test="sumPayMoney != null" >
|
||||
sum_pay_money,
|
||||
</if>
|
||||
<if test="orderSn != null" >
|
||||
order_sn,
|
||||
</if>
|
||||
@@ -125,6 +129,9 @@
|
||||
<if test="payMoney != null" >
|
||||
#{payMoney,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sumPayMoney != null" >
|
||||
#{sumPayMoney,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderSn != null" >
|
||||
#{orderSn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -169,6 +176,9 @@
|
||||
<if test="payMoney != null" >
|
||||
pay_money = #{payMoney,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sumPayMoney != null" >
|
||||
sum_pay_money = #{sumPayMoney,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orderSn != null" >
|
||||
order_sn = #{orderSn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -191,6 +201,7 @@
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
paying = #{paying,jdbcType=INTEGER},
|
||||
pay_money = #{payMoney,jdbcType=INTEGER},
|
||||
sum_pay_money = #{sumPayMoney,jdbcType=INTEGER},
|
||||
order_sn = #{orderSn,jdbcType=VARCHAR},
|
||||
order_add_sn = #{orderAddSn,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
@@ -271,7 +282,7 @@
|
||||
where ot.member_id = #{memberId,jdbcType=INTEGER} and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
|
||||
) as price,
|
||||
t.paying,
|
||||
t.pay_money as payMoney,
|
||||
IFNULL(t.sum_pay_money,0) as payMoney,
|
||||
t.order_sn as orderSn,
|
||||
t.`status`,
|
||||
t.created_time as createTime,
|
||||
@@ -284,4 +295,45 @@
|
||||
and t.id = #{enterId,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultType="com.sv.dto.api.MemberEnterOrderDTO">
|
||||
select
|
||||
t.id as id,
|
||||
(select ue.`name` from sv_venue ue where ue.id = t.venue_id) as lessonName,
|
||||
t.last_enter as lastEnter,
|
||||
t.order_start as startTime,
|
||||
t.last_out as endTime,
|
||||
m.nickname,
|
||||
m.mobile,
|
||||
(select IFNULL(sum(ot.price),0) from sv_order ot
|
||||
where ot.member_id = t.member_id and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
|
||||
) as price,
|
||||
t.paying,
|
||||
IFNULL(t.sum_pay_money,0) as payMoney,
|
||||
t.order_sn as orderSn,
|
||||
(case when t.`status` = 0 then t.paying else 2 end) as `status`,
|
||||
t.created_time as createTime,
|
||||
1 as payType
|
||||
from sv_barcode_order_time t LEFT JOIN sv_member m on t.member_id = m.id
|
||||
where 1=1
|
||||
<if test="state != null and state == 2">
|
||||
AND (t.status = 1 or t.paying = #{state})
|
||||
</if>
|
||||
<if test="state != null and state == 1">
|
||||
AND t.paying = #{state}
|
||||
</if>
|
||||
<if test="state != null and state == 0">
|
||||
AND t.paying = #{state} and t.status = 0
|
||||
</if>
|
||||
<if test="orderSn != ''">
|
||||
AND t.order_sn = #{orderSn}
|
||||
</if>
|
||||
<if test="starTime != ''">
|
||||
AND t.order_start >= #{starTime}
|
||||
</if>
|
||||
<if test="endTime != ''">
|
||||
AND t.order_start <= #{endTime}
|
||||
</if>
|
||||
order by t.order_start desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -122,12 +122,6 @@
|
||||
<if test="orderSn != ''">
|
||||
AND smevl.order_sn = #{orderSn}
|
||||
</if>
|
||||
<if test="starTime != ''">
|
||||
AND so.created_time >= #{starTime}
|
||||
</if>
|
||||
<if test="endTime != ''">
|
||||
AND so.created_time <= #{endTime}
|
||||
</if>
|
||||
<if test="payType != null">
|
||||
AND smevl.pay_type = #{payType}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user