|
@@ -61,14 +61,20 @@
|
|
|
<select id="selectPayOrderAnalyze" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
<select id="selectPayOrderAnalyze" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
|
select tor.*, gs.shop_name as shopName from tb_order tor left join goods_shop gs on tor.shop_id = gs.shop_id
|
|
select tor.*, gs.shop_name as shopName from tb_order tor left join goods_shop gs on tor.shop_id = gs.shop_id
|
|
|
where tor.is_pay = 1
|
|
where tor.is_pay = 1
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(tor.pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(tor.pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(tor.pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(tor.pay_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(tor.pay_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and tor.pay_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and tor.pay_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
order by tor.pay_time desc
|
|
order by tor.pay_time desc
|
|
|
</select>
|
|
</select>
|
|
@@ -260,27 +266,39 @@
|
|
|
|
|
|
|
|
<select id="allUserCount" resultType="int">
|
|
<select id="allUserCount" resultType="int">
|
|
|
select count(*) from tb_user where status = 1
|
|
select count(*) from tb_user where status = 1
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and create_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="phoneUserCount" resultType="int">
|
|
<select id="phoneUserCount" resultType="int">
|
|
|
select count(*) from tb_user where status = 1 and phone is not null
|
|
select count(*) from tb_user where status = 1 and phone is not null
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and create_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -418,17 +436,23 @@
|
|
|
select count(*) from tb_order
|
|
select count(*) from tb_order
|
|
|
where order_type = #{orderType}
|
|
where order_type = #{orderType}
|
|
|
and is_pay=1 and status in (0,3,4,7,6)
|
|
and is_pay=1 and status in (0,3,4,7,6)
|
|
|
- <if test="shopId!=null">
|
|
|
|
|
- and shop_id = #{shopId}
|
|
|
|
|
|
|
+ <if test="query.shopId!=null">
|
|
|
|
|
+ and shop_id = #{query.shopId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and pay_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and pay_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -436,49 +460,67 @@
|
|
|
select ifnull(sum(pay_money), 0) from tb_order
|
|
select ifnull(sum(pay_money), 0) from tb_order
|
|
|
where order_type = #{orderType}
|
|
where order_type = #{orderType}
|
|
|
and is_pay=1 and status in (0,3,4,7,6)
|
|
and is_pay=1 and status in (0,3,4,7,6)
|
|
|
- <if test="shopId!=null">
|
|
|
|
|
- and shop_id = #{shopId}
|
|
|
|
|
|
|
+ <if test="query.shopId!=null">
|
|
|
|
|
+ and shop_id = #{query.shopId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(pay_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(pay_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(pay_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(pay_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(pay_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(pay_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and pay_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and pay_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="cancelOrderCount" resultType="int">
|
|
<select id="cancelOrderCount" resultType="int">
|
|
|
select count(*) from tb_order where status = 5
|
|
select count(*) from tb_order where status = 5
|
|
|
- <if test="shopId!=null">
|
|
|
|
|
- and shop_id = #{shopId}
|
|
|
|
|
|
|
+ <if test="query.shopId!=null">
|
|
|
|
|
+ and shop_id = #{query.shopId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and create_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="cancelOrderMoney" resultType="java.math.BigDecimal">
|
|
<select id="cancelOrderMoney" resultType="java.math.BigDecimal">
|
|
|
select ifnull(sum(pay_money), 0) from tb_order where status = 5
|
|
select ifnull(sum(pay_money), 0) from tb_order where status = 5
|
|
|
- <if test="shopId!=null">
|
|
|
|
|
- and shop_id = #{shopId}
|
|
|
|
|
|
|
+ <if test="query.shopId!=null">
|
|
|
|
|
+ and shop_id = #{query.shopId}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='day'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
|
|
|
|
|
|
|
+ <if test="query.dateType=='day'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m-%d')=date_format(#{query.date},'%Y-%m-%d')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='month'">
|
|
|
|
|
- and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
|
|
|
+ <if test="query.dateType=='month'">
|
|
|
|
|
+ and date_format(create_time,'%Y-%m')=date_format(#{query.date},'%Y-%m')
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="dateType=='year'">
|
|
|
|
|
- and date_format(create_time,'%Y')=date_format(#{date},'%Y')
|
|
|
|
|
|
|
+ <if test="query.dateType=='year'">
|
|
|
|
|
+ and date_format(create_time,'%Y')=date_format(#{query.date},'%Y')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.startTime!=null and query.startTime!=''">
|
|
|
|
|
+ and create_time>=#{query.startTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.endTime!=null and query.endTime!=''">
|
|
|
|
|
+ and create_time <![CDATA[<=]]> #{query.endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|