From d19501aebadf4c61a1727178b943e362a18c82f6 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Tue, 16 Mar 2021 16:55:18 +0800
Subject: [PATCH] 新增配置查询2
---
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml | 75 +++++++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
index ead840d..34510ff 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
@@ -64,4 +64,79 @@
</select>
+ <select id="selectFenxiaoOrderBasicByCompanyId" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo">
+ SELECT
+ COUNT(*) num,
+ (SELECT IFNULL(sum(IFNULL(amount, 0)), 0)
+ FROM shop_salesman_order
+ WHERE order_status = 1 and company_id=#{companyId}) balance,
+ (SELECT COUNT(*) FROM
+ (SELECT DISTINCT user_id
+ FROM shop_salesman_order
+ WHERE order_status = 1 and company_id=#{companyId} ) a) waitNum,
+ (SELECT COUNT(*)
+ FROM shop_salesman_order
+ WHERE order_status = 1 and company_id=#{companyId}) waitOrderNum
+ FROM
+ shop_salesman_order
+ where company_id=#{companyId}
+ </select>
+
+ <select id="findFenxiaoOrderList" resultType="com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo">
+ SELECT
+ a.id id,
+ (select order_no from shop_order where id = a.order_id) orderNo,
+ (select order_money from shop_order where id = a.order_id) actualBalance,
+ (select store_name from shop_store where store_id = (select store_id from shop_order where id = a.order_id)) address,
+ b.nick_name custom,
+ b.open_id customUserId,
+ (select nick_name from biz_user where open_id = b.parent_open_id) parentSale,
+ a.revenue_type profitType,
+ a.amount profitBalance,
+ a.order_status settleType,
+ c.order_no settleNo,
+ c.create_time settleTime,
+ (select nick_name from biz_user where c.user_id = open_id) settler
+ FROM
+ shop_salesman_order a
+ LEFT JOIN biz_user b on a.user_id = b.open_id
+ LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id
+ <where>
+ a.company_id = #{record.companyId}
+ <if test="record.userName != null and record.userName != ''">
+ and b.nick_name like concat('%',#{record.userName},'%')
+ </if>
+ </where>
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
+ <select id="findSetOrderList" resultType="com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo">
+ select
+ a.id id,
+ a.order_no orderNo,
+ a.amount actualBalance,
+ a.order_count setNum,
+ a.man_count setManNum,
+ a.create_time setTime,
+ b.nick_name setMan,
+ a.settlement_way settlementWay,
+ a.remark remark
+ from
+ shop_saleman_settlement a
+ left join biz_user b on a.user_id = b.open_id
+ <where>
+ a.company_id = #{record.companyId}
+ <if test="record.userName != null and record.userName != ''">
+ and b.nick_name like concat('%',#{record.userName},'%')
+ </if>
+ </where>
+ <if test="record.sort !=null">
+ order by
+ a.${record.sort} ${record.order}
+ </if>
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1