Merge remote-tracking branch 'origin/test' into hph
# Conflicts: # src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUser.java
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
<result column="detail" jdbcType="VARCHAR" property="detail" />
|
||||
<result column="style" jdbcType="VARCHAR" property="style" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="use_time" jdbcType="INTEGER" property="useTime" />
|
||||
<result column="sale_start_time" jdbcType="INTEGER" property="saleStartTime" />
|
||||
<result column="sale_end_time" jdbcType="INTEGER" property="saleEndTime" />
|
||||
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
||||
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
||||
</resultMap>
|
||||
@@ -18,7 +21,7 @@
|
||||
<result column="product_ids" jdbcType="LONGVARCHAR" property="productIds" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, merchant_id, shop_id, pic, is_show, detail, style, sort, created_at, updated_at
|
||||
id, name, merchant_id, shop_id, pic, is_show, detail, style, sort, created_at, updated_at , use_time, sale_start_time, sale_end_time
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
product_ids
|
||||
@@ -229,9 +232,14 @@
|
||||
FROM
|
||||
tb_product_group
|
||||
where shop_id=#{shopId} and is_show=1
|
||||
<if test="groupId != null">
|
||||
<if test="groupId != null and groupId != ''">
|
||||
and id = #{groupId}
|
||||
</if>
|
||||
order by g.sort asc
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectByProductId" resultMap="BaseResultMap">
|
||||
SELECT * FROM tb_product_group WHERE `shop_id` = #{shopId,jdbcType=VARCHAR} AND is_show = 1
|
||||
AND `product_ids` LIKE concat('%',#{productId,jdbcType=VARCHAR},'%')
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -932,11 +932,47 @@
|
||||
select min( sku.suit ) as suit,tb.*
|
||||
from tb_product tb
|
||||
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id
|
||||
where tb.id in (${ids}) and is_show_mall =1 and sku.is_del = 0 and sku.is_grounding=1
|
||||
where tb.id in (${ids}) and is_show_mall =1 and sku.is_del = 0 and sku.is_grounding=1 and tb.type_enum!='group' and tb.status = 1
|
||||
group by tb.id
|
||||
order by tb.sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectHot" resultMap="BaseResultMap">
|
||||
select min(sku.suit) as suit, tb.*
|
||||
from tb_product tb
|
||||
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id
|
||||
JOIN (SELECT product_id
|
||||
FROM tb_product_sku
|
||||
WHERE shop_id = #{shopId}
|
||||
GROUP BY product_id
|
||||
ORDER BY SUM(real_sales_number) DESC LIMIT 3) AS top_products ON tb.id = top_products.product_id
|
||||
where is_show_mall = 1
|
||||
and tb.status = 1
|
||||
and tb.type_enum != 'group'
|
||||
and sku.is_del = 0
|
||||
and sku.is_grounding = 1
|
||||
group by tb.id
|
||||
order by tb.sort asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectIsSpecialty" resultMap="BaseResultMap">
|
||||
select min(sku.suit) as suit, tb.*
|
||||
from tb_product tb
|
||||
LEFT JOIN tb_product_sku sku ON tb.id = sku.product_id
|
||||
where is_hot = 1
|
||||
and is_show_mall = 1
|
||||
and tb.shop_id = #{shopId}
|
||||
and tb.status = 1
|
||||
and sku.is_del = 0
|
||||
and sku.is_grounding = 1
|
||||
and tb.type_enum != 'group'
|
||||
group by tb.id
|
||||
order by tb.sort asc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- <select id="selectByIdIn" resultMap="BaseResultMap">-->
|
||||
<!-- select *-->
|
||||
<!-- from tb_product-->
|
||||
@@ -963,6 +999,17 @@
|
||||
t.shop_id,
|
||||
t.product_id
|
||||
</select>
|
||||
<select id="selectByCodeAndSkuId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL(t.number, 0 )
|
||||
FROM
|
||||
tb_cashier_cart t
|
||||
WHERE
|
||||
t.shop_id = #{shopId}
|
||||
AND t.sku_id = #{skuId}
|
||||
AND t.`status` = 'create'
|
||||
AND t.table_id = #{code}
|
||||
</select>
|
||||
<select id="selectByNewQcode" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
IFNULL( sum( t.number ), 0 )
|
||||
|
||||
@@ -362,11 +362,11 @@
|
||||
</update>
|
||||
|
||||
<select id="selectByShopIdAndProductIdAndSpec" resultMap="ResultMapWithBLOBs">
|
||||
select * from tb_product_sku where shop_id=#{shopId} and product_id=#{productId} and is_del = 0
|
||||
|
||||
select * from tb_product_sku where shop_id=#{shopId} and product_id=#{productId} and is_del = 0 and is_grounding=1
|
||||
<if test="spec != null and spec !=''">
|
||||
and spec_snap = #{spec}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectAll" resultType="com.chaozhanggui.system.cashierservice.entity.TbProductSku">
|
||||
select * from tb_product_sku
|
||||
|
||||
22
src/main/resources/mapper/TbShopAdDao.xml
Normal file
22
src/main/resources/mapper/TbShopAdDao.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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.TbShopAdDao">
|
||||
|
||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbShopAd" id="TbShopAdMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="imgUrl" column="img_url" jdbcType="VARCHAR"/>
|
||||
<result property="linkPath" column="link_path" jdbcType="VARCHAR"/>
|
||||
<result property="borderRadius" column="border_radius" jdbcType="INTEGER"/>
|
||||
<result property="showPosition" column="show_position" jdbcType="VARCHAR"/>
|
||||
<result property="frequency" column="frequency" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
91
src/main/resources/mapper/TbShopMsgStateMapper.xml
Normal file
91
src/main/resources/mapper/TbShopMsgStateMapper.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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.mapper.TbShopMsgStateMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopMsgState">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,type,
|
||||
state,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from tb_shop_msg_state
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from tb_shop_msg_state
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopMsgState" useGeneratedKeys="true">
|
||||
insert into tb_shop_msg_state
|
||||
( id,shop_id,type
|
||||
,state,create_time,update_time
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER},#{shopId,jdbcType=INTEGER},#{type,jdbcType=INTEGER}
|
||||
,#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopMsgState" useGeneratedKeys="true">
|
||||
insert into tb_shop_msg_state
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="shopId != null">shop_id,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id,jdbcType=INTEGER},</if>
|
||||
<if test="shopId != null">#{shopId,jdbcType=INTEGER},</if>
|
||||
<if test="type != null">#{type,jdbcType=INTEGER},</if>
|
||||
<if test="state != null">#{state,jdbcType=INTEGER},</if>
|
||||
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
||||
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopMsgState">
|
||||
update tb_shop_msg_state
|
||||
<set>
|
||||
<if test="shopId != null">
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopMsgState">
|
||||
update tb_shop_msg_state
|
||||
set
|
||||
shop_id = #{shopId,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=INTEGER},
|
||||
state = #{state,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -41,10 +41,10 @@
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopOpenId" useGeneratedKeys="true">
|
||||
insert into tb_shop_open_id
|
||||
( id,shop_id,open_id
|
||||
,status,create_time,update_time
|
||||
,status,create_time,update_time, type, nickname, avatar
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER},#{shopId,jdbcType=INTEGER},#{openId,jdbcType=VARCHAR}
|
||||
,#{status,jdbcType=TINYINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}
|
||||
,#{status,jdbcType=TINYINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopOpenId" useGeneratedKeys="true">
|
||||
@@ -84,6 +84,15 @@
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="nickname != null">
|
||||
`nickname` = #{nickname,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="avatar != null">
|
||||
`avatar` = #{avatar,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
|
||||
SELECT
|
||||
f.*,
|
||||
u.`head_img`,
|
||||
u.`name`
|
||||
FROM
|
||||
tb_shop_user_flow f
|
||||
|
||||
Reference in New Issue
Block a user