|
|
@@ -186,14 +186,11 @@
|
|
|
|
|
|
<select id="selectNewShopCount" resultType="int">
|
|
|
select count(*) from goods_shop where 1 = 1
|
|
|
- <if test="dateType=='day'">
|
|
|
- and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
+ <if test="query.startTime != null and query.startTime != ''">
|
|
|
+ and create_time >= #{query.startTime}
|
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
- and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
- </if>
|
|
|
- <if test="dateType=='year'">
|
|
|
- and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
|
+ <if test="query.endTime != null and query.endTime != ''">
|
|
|
+ and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
@@ -203,17 +200,18 @@
|
|
|
@rank_num := @rank_num + 1 AS rankNum
|
|
|
FROM
|
|
|
( SELECT @rank_num := 0 ) r,
|
|
|
- ( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name
|
|
|
+ ( SELECT ifnull( sum( pay_money ), 0 ) AS shopMoney, tor.shop_id , u.shop_name,gp.id as shopType,gp.shop_type_name as shopTypeName
|
|
|
FROM tb_order tor left join goods_shop u on tor.shop_id = u.shop_id
|
|
|
+ left join shop_type gp on gp.id=u.shop_type_id
|
|
|
WHERE tor.shop_id IS NOT NULL and tor.status = 4
|
|
|
- <if test="dateType=='day'">
|
|
|
- and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
+ <if test="query.startTime != null and query.startTime !=''">
|
|
|
+ and tor.pay_time >= #{query.startTime}
|
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
- and date_format(tor.pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
+ <if test="query.endTime != null and query.endTime != ''">
|
|
|
+ and tor.pay_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
- and date_format(tor.pay_time,'%Y')=date_format(#{date},'%Y')
|
|
|
+ <if test="query.shopType != null and query.shopType != '' ">
|
|
|
+ and gp.id = #{query.shopType}
|
|
|
</if>
|
|
|
GROUP BY tor.shop_id ) a
|
|
|
ORDER BY shopMoney DESC
|