修改库存
This commit is contained in:
@@ -46,6 +46,9 @@
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
||||
<result column="master_id" jdbcType="VARCHAR" property="masterId"/>
|
||||
<result column="table_name" jdbcType="VARCHAR" property="tableName"/>
|
||||
<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,
|
||||
@@ -53,7 +56,7 @@
|
||||
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`
|
||||
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,remark,master_id,`table_name`,out_number
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -542,4 +545,24 @@
|
||||
|
||||
select * from tb_order_info where trade_day = #{day} and table_id = #{masterId} and shop_id = #{shopId}
|
||||
</select>
|
||||
|
||||
<select id="selectByOutNumber" resultMap="BaseResultMap">
|
||||
select * from tb_order_info where trade_day = #{tradeDay} and out_number=#{outNumber} and shop_id=#{shopId}
|
||||
</select>
|
||||
|
||||
<select id="selectByOutNumberLimit" resultMap="BaseResultMap">
|
||||
select * from tb_order_info where out_number=#{outNumber} and shop_id=#{shopId} order by id desc limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByOrderId" resultType="java.util.Map">
|
||||
SELECT
|
||||
GROUP_CONCAT( d.product_name, ',' ) AS product_names,
|
||||
GROUP_CONCAT( d.product_sku_name, ',' ) AS product_sku_name
|
||||
FROM
|
||||
tb_order_detail d
|
||||
WHERE
|
||||
d.order_id = #{orderId}
|
||||
GROUP BY
|
||||
d.order_id
|
||||
</select>
|
||||
</mapper>
|
||||
69
src/main/resources/mapper/TbOrderOutNumberMapper.xml
Normal file
69
src/main/resources/mapper/TbOrderOutNumberMapper.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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.TbOrderOutNumberMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbOrderOutNumber">
|
||||
<result column="out_code" jdbcType="VARCHAR" property="outCode" />
|
||||
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
|
||||
|
||||
<result column="product_name" jdbcType="VARCHAR" property="productName" />
|
||||
<result column="product_sku" jdbcType="VARCHAR" property="productSku" />
|
||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderOutNumber">
|
||||
insert into tb_order_out_number (out_code,shop_id, product_name, product_sku,
|
||||
status, remark, create_time
|
||||
)
|
||||
values (#{outCode,jdbcType=VARCHAR},#{shopId,jdbcType=VARCHAR} ,#{productName,jdbcType=VARCHAR}, #{productSku,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderOutNumber">
|
||||
insert into tb_order_out_number
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="outCode != null">
|
||||
out_code,
|
||||
</if>
|
||||
<if test="productName != null">
|
||||
product_name,
|
||||
</if>
|
||||
<if test="productSku != null">
|
||||
product_sku,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="outCode != null">
|
||||
#{outCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="productName != null">
|
||||
#{productName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="productSku != null">
|
||||
#{productSku,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
#{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select * from tb_order_out_number where shop_id=#{shopId} order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -9,12 +9,13 @@
|
||||
<result column="biz_code" jdbcType="VARCHAR" property="bizCode" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, shop_user_id, amount, balance, biz_code, biz_name, create_time
|
||||
id, shop_user_id, amount, balance, biz_code, biz_name, create_time, type
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_shop_user_flow
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
@@ -24,12 +25,12 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||
insert into tb_shop_user_flow (id, shop_user_id, amount,
|
||||
balance, biz_code, biz_name,
|
||||
create_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{shopUserId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL},
|
||||
#{balance,jdbcType=DECIMAL}, #{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP})
|
||||
insert into tb_shop_user_flow (id, shop_user_id, amount,
|
||||
balance, biz_code, biz_name,
|
||||
create_time, type)
|
||||
values (#{id,jdbcType=INTEGER}, #{shopUserId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL},
|
||||
#{balance,jdbcType=DECIMAL}, #{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||
insert into tb_shop_user_flow
|
||||
@@ -55,6 +56,9 @@
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
@@ -78,6 +82,9 @@
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||
@@ -101,31 +108,37 @@
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||
update tb_shop_user_flow
|
||||
set shop_user_id = #{shopUserId,jdbcType=INTEGER},
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
balance = #{balance,jdbcType=DECIMAL},
|
||||
biz_code = #{bizCode,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
balance = #{balance,jdbcType=DECIMAL},
|
||||
biz_code = #{bizCode,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
type = #{type,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectByMemberAccountFlow" resultType="java.util.Map">
|
||||
|
||||
SELECT
|
||||
f.*,
|
||||
u.`name`
|
||||
f.*,
|
||||
u.`name`
|
||||
FROM
|
||||
tb_shop_user_flow f
|
||||
LEFT JOIN tb_shop_user u ON f.shop_user_id = u.id
|
||||
tb_shop_user_flow f
|
||||
LEFT JOIN tb_shop_user u ON f.shop_user_id = u.id
|
||||
where 1=1
|
||||
<if test="memberId != null and memberId!=''">
|
||||
and u.id = #{memberId}
|
||||
</if>
|
||||
order by f.id desc
|
||||
</select>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user