商品校验调整
This commit is contained in:
@@ -1,45 +1,59 @@
|
||||
<?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.TbProductMapper">
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbProduct" id="BaseResultMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
|
||||
<result property="specId" column="spec_id" jdbcType="INTEGER"/>
|
||||
<result property="merchantId" column="merchant_id" jdbcType="VARCHAR"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="shortTitle" column="short_title" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
<result property="packFee" column="pack_fee" jdbcType="DECIMAL"/>
|
||||
<result property="lowPrice" column="low_price" jdbcType="DECIMAL"/>
|
||||
<result property="lowMemberPrice" column="low_member_price" jdbcType="DECIMAL"/>
|
||||
<result property="unitId" column="unit_id" jdbcType="INTEGER"/>
|
||||
<result property="coverImg" column="cover_img" jdbcType="VARCHAR"/>
|
||||
<result property="images" column="images" jdbcType="VARCHAR"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="failMsg" column="fail_msg" jdbcType="VARCHAR"/>
|
||||
<result property="isHot" column="is_hot" jdbcType="INTEGER"/>
|
||||
<result property="typeEnum" column="type_enum" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
||||
<result property="isStock" column="is_stock" jdbcType="INTEGER"/>
|
||||
<result property="isPauseSale" column="is_pause_sale" jdbcType="INTEGER"/>
|
||||
<result property="createdAt" column="created_at" jdbcType="INTEGER"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="INTEGER"/>
|
||||
<result property="specTableHeaders" column="spec_table_headers" jdbcType="VARCHAR"/>
|
||||
<result property="realSalesNumber" column="real_sales_number" jdbcType="INTEGER"/>
|
||||
<result property="stockNumber" column="stock_number" jdbcType="INTEGER"/>
|
||||
<result property="isGrounding" column="is_grounding" jdbcType="INTEGER"/>
|
||||
<result property="isRefundStock" column="is_refund_stock" jdbcType="INTEGER"/>
|
||||
<result property="warnLine" column="warn_line" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, category_id, spec_id, merchant_id, shop_id, name, short_title, type, pack_fee, low_price, low_member_price,
|
||||
unit_id, cover_img, images, sort, status, fail_msg, is_hot, type_enum, is_del, is_stock, is_pause_sale,
|
||||
created_at, updated_at, group_snap, spec_info, select_spec,
|
||||
spec_table_headers, group_category_id, real_sales_number, stock_number, is_grounding, is_refund_stock, warn_line </sql>
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbProduct" id="BaseResultMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
|
||||
<result property="specId" column="spec_id" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="shortTitle" column="short_title" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
<result property="packFee" column="pack_fee" jdbcType="NUMERIC"/>
|
||||
<result property="lowPrice" column="low_price" jdbcType="NUMERIC"/>
|
||||
<result property="unitId" column="unit_id" jdbcType="INTEGER"/>
|
||||
<result property="coverImg" column="cover_img" jdbcType="VARCHAR"/>
|
||||
<result property="images" column="images" jdbcType="VARCHAR"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="isHot" column="is_hot" jdbcType="INTEGER"/>
|
||||
<result property="typeEnum" column="type_enum" jdbcType="VARCHAR"/>
|
||||
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
||||
<result property="isStock" column="is_stock" jdbcType="INTEGER"/>
|
||||
<result property="isPauseSale" column="is_pause_sale" jdbcType="INTEGER"/>
|
||||
<result property="createdAt" column="created_at" jdbcType="INTEGER"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="INTEGER"/>
|
||||
<result property="groupType" column="group_type" jdbcType="INTEGER"/>
|
||||
<result property="groupSnap" column="group_snap" jdbcType="VARCHAR"/>
|
||||
<result property="specInfo" column="spec_info" jdbcType="VARCHAR"/>
|
||||
<result property="selectSpec" column="select_spec" jdbcType="VARCHAR"/>
|
||||
<result property="specTableHeaders" column="spec_table_headers" jdbcType="VARCHAR"/>
|
||||
<result property="groupCategoryId" column="group_category_id" jdbcType="VARCHAR"/>
|
||||
<result property="realSalesNumber" column="real_sales_number" jdbcType="INTEGER"/>
|
||||
<result property="stockNumber" column="stock_number" jdbcType="INTEGER"/>
|
||||
<result property="isGrounding" column="is_grounding" jdbcType="INTEGER"/>
|
||||
<result property="isRefundStock" column="is_refund_stock" jdbcType="INTEGER"/>
|
||||
<result property="warnLine" column="warn_line" jdbcType="INTEGER"/>
|
||||
<result property="showType" column="show_type" jdbcType="VARCHAR"/>
|
||||
<result property="weight" column="weight" jdbcType="NUMERIC"/>
|
||||
<result property="isTempPrice" column="is_temp_price" jdbcType="INTEGER"/>
|
||||
<result property="dayLimit" column="day_limit" jdbcType="INTEGER"/>
|
||||
<result property="singleOrderLimit" column="single_order_limit" jdbcType="INTEGER"/>
|
||||
<result property="singlePeopleLimit" column="single_people_limit" jdbcType="INTEGER"/>
|
||||
<result property="days" column="days" jdbcType="VARCHAR"/>
|
||||
<result property="startTime" column="start_time" jdbcType="VARCHAR"/>
|
||||
<result property="endTime" column="end_time" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, category_id, spec_id, merchant_id, shop_id, name, short_title,
|
||||
type, pack_fee, low_price, unit_id, cover_img, images, sort, status,
|
||||
is_hot, type_enum, is_del, is_stock, is_pause_sale, created_at, updated_at,
|
||||
group_type, group_snap, spec_info, select_spec, spec_table_headers,
|
||||
group_category_id, real_sales_number, stock_number, is_grounding,
|
||||
is_refund_stock, warn_line, show_type, weight, is_temp_price,
|
||||
day_limit, single_order_limit, single_people_limit, days, start_time, end_time </sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -49,28 +63,30 @@
|
||||
</select>
|
||||
|
||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
||||
select * from tb_product where shop_id=#{shopId} and status=1 and is_del = 0 and is_grounding = 1 and type_enum in ('normal','sku','currentPrice','weight')
|
||||
select * from tb_product where shop_id=#{shopId} and status=1 and is_del = 0 and is_grounding = 1 and type != 'coupon'
|
||||
<if test="commdityName != null and commdityName!='' ">
|
||||
and name like CONCAT('%',#{commdityName},'%')
|
||||
</if>
|
||||
order by `sort` asc
|
||||
|
||||
</select>
|
||||
</select>
|
||||
<select id="selectByShopIdAndCheckGrounding" resultMap="BaseResultMap">
|
||||
select a.* from tb_product as a
|
||||
left join tb_product_sku as b on a.id = b.product_id
|
||||
where a.shop_id=#{shopId} and a.status=1 and a.is_del = 0 and a.is_grounding = 1 and a.type_enum in ('normal','sku','currentPrice','weight')
|
||||
left join tb_product_sku as b on a.id = b.product_id and b.is_grounding=1 and b.is_del=0
|
||||
where a.shop_id=#{shopId} and a.status = 1 and a.is_grounding = 1
|
||||
and a.type != 'coupon' and a.is_del = 0
|
||||
and a.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and a.start_time <= CURRENT_TIMESTAMP and a.end_time >= CURRENT_TIMESTAMP
|
||||
<if test="commdityName != null and commdityName!='' ">
|
||||
and a.name like CONCAT('%',#{commdityName},'%')
|
||||
</if>
|
||||
and b.is_grounding=1 GROUP BY a.id ORDER BY a.`sort`
|
||||
GROUP BY a.id ORDER BY a.`sort`
|
||||
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<select id="selectByShopIdAndShopType" resultMap="BaseResultMap">
|
||||
|
||||
select * from tb_product where shop_id=#{shopId} and status=1 and category_id=#{categoryId} and is_del = 0 and is_grounding = 1 and type_enum in ('normal','sku','currentPrice','weight')
|
||||
select * from tb_product where shop_id=#{shopId} and status=1 and category_id=#{categoryId} and is_del = 0 and is_grounding = 1 and type != 'coupon'
|
||||
|
||||
<if test="commdityName != null and commdityName!='' ">
|
||||
and name like CONCAT('%',#{commdityName},'%')
|
||||
@@ -84,7 +100,9 @@
|
||||
|
||||
select a.* from tb_product as a
|
||||
left join tb_product_sku as b on a.id = b.product_id
|
||||
where a.shop_id=#{shopId} and a.status=1 and a.category_id=#{categoryId} and a.is_del = 0 and a.is_grounding = 1 and a.type_enum in ('normal','sku','currentPrice','weight')
|
||||
where a.shop_id=#{shopId} and a.status=1 and a.category_id=#{categoryId} and a.is_grounding = 1
|
||||
and a.type != 'coupon' and a.is_del = 0
|
||||
and a.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and a.start_time <= CURRENT_TIMESTAMP and a.end_time >= CURRENT_TIMESTAMP
|
||||
|
||||
<if test="commdityName != null and commdityName!='' ">
|
||||
and a.name like CONCAT('%',#{commdityName},'%')
|
||||
@@ -96,18 +114,22 @@
|
||||
|
||||
select a.* from tb_product as a
|
||||
left join tb_product_sku as b on a.id = b.product_id
|
||||
where a.shop_id=#{shopId} and a.status=1 and a.is_del = 0 and a.is_grounding = 1 and a.type_enum in ('normal','sku','currentPrice','weight')
|
||||
where a.shop_id=#{shopId} and a.status=1 and a.is_grounding = 0
|
||||
and a.type != 'coupon' and a.is_del = 0
|
||||
and a.days LIKE concat('%',DAYNAME(CURRENT_DATE),'%') and a.start_time <= CURRENT_TIMESTAMP and a.end_time >= CURRENT_TIMESTAMP
|
||||
|
||||
<if test="commdityName != null and commdityName!='' ">
|
||||
and a.name like CONCAT('%',#{commdityName},'%')
|
||||
</if>
|
||||
and b.is_grounding=0 GROUP BY a.id ORDER BY a.`sort`
|
||||
GROUP BY a.id ORDER BY a.`sort`
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="countOrderByshopIdAndProductId" resultType="INTEGER">
|
||||
SELECT
|
||||
IFNULL(sum( number ) ,0)
|
||||
IFNULL(sum( number ) ,0)
|
||||
FROM
|
||||
tb_cashier_cart
|
||||
WHERE
|
||||
@@ -117,7 +139,7 @@
|
||||
and master_id = #{masterId}
|
||||
and table_id = #{tableId}
|
||||
and trade_day = #{day}
|
||||
group by shop_id,product_id
|
||||
group by shop_id,product_id
|
||||
</select>
|
||||
|
||||
<select id="selectBySkuId" resultType="com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo">
|
||||
@@ -143,5 +165,5 @@
|
||||
and c.product_sku_id=#{skuId}
|
||||
group by i.id
|
||||
order by i.id
|
||||
</select>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user