|
|
@@ -186,12 +186,21 @@
|
|
|
|
|
|
<select id="selectNewShopCount" resultType="int">
|
|
|
select count(*) from goods_shop where 1 = 1
|
|
|
- <if test="query.startTime != null and query.startTime != ''">
|
|
|
- and create_time >= #{query.startTime}
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
+ and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
+ and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
+ </if>
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
+ and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
</if>
|
|
|
<if test="query.endTime != null and query.endTime != ''">
|
|
|
and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
|
+ <if test="query.startTime != null and query.startTime != ''">
|
|
|
+ and create_time >= #{query.startTime}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectRankingList" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
|
@@ -213,6 +222,15 @@
|
|
|
<if test="query.shopType != null and query.shopType != '' ">
|
|
|
and gp.id = #{query.shopType}
|
|
|
</if>
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
+ and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
+ and date_format(tor.pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
+ </if>
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
+ and date_format(tor.pay_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
+ </if>
|
|
|
GROUP BY tor.shop_id ) a
|
|
|
ORDER BY shopMoney DESC
|
|
|
</select>
|
|
|
@@ -220,7 +238,7 @@
|
|
|
<select id="excelShopCenter" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
|
SELECT
|
|
|
*,
|
|
|
- @rank_num := @rank_num + 1 AS rankNum
|
|
|
+ @rank_num := @rank_num + 1 AS Rank
|
|
|
FROM
|
|
|
( SELECT @rank_num := 0 ) r,
|
|
|
( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name,gp.id as shopType,gp.shop_type_name as shopTypeName
|