Merge branch 'test' into dev
# Conflicts: # src/main/resources/application-pre.yml
This commit is contained in:
@@ -55,7 +55,7 @@ logging:
|
||||
# web日志
|
||||
org.springframework.web: debug
|
||||
# mybatis日志
|
||||
org.mybatis: debug
|
||||
org.apache.ibatis: debug
|
||||
charset:
|
||||
# 输出控制台编码
|
||||
console: UTF-8
|
||||
|
||||
@@ -39,6 +39,23 @@
|
||||
group by tb_activate_in_record.pro_id
|
||||
</select>
|
||||
|
||||
<select id="queryVipPro" resultType="com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo">
|
||||
SELECT tb_product.name as detail,
|
||||
0 as status,
|
||||
sum(tb_activate_in_record.over_num) as num,
|
||||
<choose>
|
||||
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
||||
<otherwise>''</otherwise>
|
||||
</choose> AS shopName,
|
||||
2 as type
|
||||
FROM tb_activate_in_record
|
||||
LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id
|
||||
WHERE vip_user_id = #{vipUserId}
|
||||
and tb_activate_in_record.shop_id = #{shopId}
|
||||
and num!=0
|
||||
group by tb_activate_in_record.pro_id
|
||||
</select>
|
||||
|
||||
<select id="queryByVipIdAndShopIdAndProId" resultType="INTEGER">
|
||||
SELECT
|
||||
sum(tb_activate_in_record.num)
|
||||
|
||||
@@ -27,6 +27,25 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryVipPro" resultType="com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo">
|
||||
SELECT tb_product.NAME AS detail,
|
||||
1 AS status,
|
||||
tb_activate_out_record.use_num AS num,
|
||||
<choose>
|
||||
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
||||
<otherwise>''</otherwise>
|
||||
</choose>
|
||||
AS shopName,
|
||||
2 AS type
|
||||
FROM tb_activate_out_record
|
||||
LEFT JOIN tb_product ON tb_activate_out_record.pro_id = tb_product.id
|
||||
LEFT JOIN tb_activate_in_record ON tb_activate_in_record.id = tb_activate_out_record.give_id
|
||||
WHERE vip_user_id = #{vipUserId}
|
||||
AND tb_activate_in_record.shop_id = #{shopId}
|
||||
AND tb_activate_out_record.STATUS = 'closed'
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAll" resultMap="TbActivateOutRecordMap">
|
||||
select
|
||||
|
||||
@@ -51,53 +51,58 @@
|
||||
<result column="out_number" jdbcType="VARCHAR" property="outNumber"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
||||
refund_amount, pay_type, pay_amount, order_amount, freight_amount, discount_ratio,
|
||||
discount_amount, table_id, small_change, send_type, order_type, product_type, status,
|
||||
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
||||
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
||||
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
||||
refund_amount, pay_type, pay_amount, order_amount, freight_amount, discount_ratio,
|
||||
discount_amount, table_id, small_change, send_type, order_type, product_type, status,
|
||||
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
||||
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
||||
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,
|
||||
remark,master_id,`table_name`,is_buy_coupon,is_use_coupon,out_number
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
*
|
||||
from tb_order_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from tb_order_info
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">-->
|
||||
<!-- delete from tb_order_info-->
|
||||
<!-- where id = #{id,jdbcType=INTEGER}-->
|
||||
<!-- </delete>-->
|
||||
<update id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
update tb_order_info
|
||||
set is_del = 1
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_order_info (id, order_no, settlement_amount,
|
||||
pack_fee, origin_amount, product_amount,
|
||||
amount, refund_amount, pay_type,
|
||||
pay_amount, order_amount, freight_amount,
|
||||
discount_ratio, discount_amount, table_id,
|
||||
small_change, send_type, order_type,
|
||||
product_type, status, billing_id,
|
||||
merchant_id, shop_id, is_vip,
|
||||
member_id, user_id, product_score,
|
||||
deduct_score, user_coupon_id, user_coupon_amount,
|
||||
refund_able, paid_time, is_effect,
|
||||
is_group, updated_at, system_time,
|
||||
insert into tb_order_info (id, order_no, settlement_amount,
|
||||
pack_fee, origin_amount, product_amount,
|
||||
amount, refund_amount, pay_type,
|
||||
pay_amount, order_amount, freight_amount,
|
||||
discount_ratio, discount_amount, table_id,
|
||||
small_change, send_type, order_type,
|
||||
product_type, status, billing_id,
|
||||
merchant_id, shop_id, is_vip,
|
||||
member_id, user_id, product_score,
|
||||
deduct_score, user_coupon_id, user_coupon_amount,
|
||||
refund_able, paid_time, is_effect,
|
||||
is_group, updated_at, system_time,
|
||||
created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name,is_buy_coupon,is_use_coupon,out_number
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
||||
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
||||
#{amount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR},
|
||||
#{payAmount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL},
|
||||
#{discountRatio,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{tableId,jdbcType=VARCHAR},
|
||||
#{smallChange,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR},
|
||||
#{productType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR},
|
||||
#{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT},
|
||||
#{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{productScore,jdbcType=INTEGER},
|
||||
#{deductScore,jdbcType=INTEGER}, #{userCouponId,jdbcType=VARCHAR}, #{userCouponAmount,jdbcType=DECIMAL},
|
||||
#{refundAble,jdbcType=TINYINT}, #{paidTime,jdbcType=BIGINT}, #{isEffect,jdbcType=TINYINT},
|
||||
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
||||
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
||||
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
||||
#{amount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR},
|
||||
#{payAmount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL},
|
||||
#{discountRatio,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{tableId,jdbcType=VARCHAR},
|
||||
#{smallChange,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR},
|
||||
#{productType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR},
|
||||
#{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT},
|
||||
#{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{productScore,jdbcType=INTEGER},
|
||||
#{deductScore,jdbcType=INTEGER}, #{userCouponId,jdbcType=VARCHAR}, #{userCouponAmount,jdbcType=DECIMAL},
|
||||
#{refundAble,jdbcType=TINYINT}, #{paidTime,jdbcType=BIGINT}, #{isEffect,jdbcType=TINYINT},
|
||||
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
||||
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR},
|
||||
#{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
|
||||
#{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR}, #{isBuyCoupon,jdbcType=VARCHAR}, #{isUseCoupon,jdbcType=VARCHAR},#{outNumber,jdbcType=VARCHAR}
|
||||
@@ -486,9 +491,10 @@
|
||||
<if test="isBuyCoupon != null">
|
||||
is_buy_coupon = #{isBuyCoupon,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isUseCoupon != null">
|
||||
is_use_coupon = #{isUseCoupon,jdbcType=VARCHAR},
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
@@ -549,6 +555,7 @@
|
||||
|
||||
where user_id = #{userId}
|
||||
and order_type='miniapp'
|
||||
and is_del != 1
|
||||
<if test="status != null and status != ''">
|
||||
<choose>
|
||||
<when test="status == 'unpaid'">
|
||||
@@ -576,4 +583,4 @@
|
||||
left join tb_user_info tui on tui.id = toi.user_id
|
||||
where toi.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -414,6 +414,10 @@
|
||||
select * from tb_shop_user where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectVipByUserId" resultMap="BaseResultMap">
|
||||
select * from tb_shop_user where user_id=#{userId} and is_vip = 1
|
||||
</select>
|
||||
|
||||
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||
select * from tb_shop_user where mini_open_id = #{openId}
|
||||
</select>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="detail" jdbcType="VARCHAR" property="detail" />
|
||||
<result column="coupons_price" jdbcType="DECIMAL" property="couponsPrice" />
|
||||
<result column="coupons_amount" jdbcType="DECIMAL" property="couponsAmount" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
@@ -13,7 +14,7 @@
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, coupons_price, coupons_amount, status, create_time, update_time, end_time,is_double
|
||||
id, user_id, detail, coupons_price, coupons_amount, status, create_time, update_time, end_time,is_double
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -21,6 +22,21 @@
|
||||
from tb_user_coupons
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<select id="queryAllSelective" resultMap="BaseResultMap">
|
||||
select
|
||||
detail,coupons_price as couponsPrice,coupons_amount as couponsAmount,status,1 as num,0 as type
|
||||
from tb_user_coupons
|
||||
<where>
|
||||
<if test="userId != null and userId != ''">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByUserId" resultType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||
select * from tb_user_coupons where user_id = #{userId}
|
||||
<if test="status != null and status != ''">
|
||||
@@ -44,10 +60,10 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_user_coupons (id, user_id, coupons_price,
|
||||
insert into tb_user_coupons (id, user_id, detail, coupons_price,
|
||||
coupons_amount, status, create_time,
|
||||
update_time, end_time,is_double)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
||||
#{couponsAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{isDouble,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
@@ -60,6 +76,9 @@
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="detail != null">
|
||||
detail,
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
coupons_price,
|
||||
</if>
|
||||
@@ -86,6 +105,9 @@
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="detail != null">
|
||||
#{detail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
#{couponsPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -112,6 +134,9 @@
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="detail != null">
|
||||
detail = #{detail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="couponsPrice != null">
|
||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@@ -137,6 +162,7 @@
|
||||
update tb_user_coupons
|
||||
set user_id = #{userId,jdbcType=VARCHAR},
|
||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||
detail = #{detail,jdbcType=VARCHAR},
|
||||
coupons_amount = #{couponsAmount,jdbcType=DECIMAL},
|
||||
status = #{status,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
|
||||
Reference in New Issue
Block a user