mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-04 21:34:08 +08:00
修改:CRM 商业智能,合并模块到 crm,优化查询
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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="cn.iocoder.yudao.module.crm.dal.mysql.bi.BiRankingMapper">
|
||||
|
||||
|
||||
<select id="contractRanKing"
|
||||
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.BiRanKingRespVO">
|
||||
SELECT IFNULL(SUM(t.price), 0) AS price, t.owner_user_id
|
||||
FROM crm_contract t
|
||||
WHERE t.deleted = 0
|
||||
AND t.audit_status = 20
|
||||
and t.owner_user_id in
|
||||
<foreach collection="userIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND t.order_date between #{startTime} and #{endTime}
|
||||
GROUP BY t.owner_user_id
|
||||
ORDER BY price DESC
|
||||
</select>
|
||||
|
||||
<select id="receivablesRanKing"
|
||||
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.BiRanKingRespVO">
|
||||
SELECT IFNULL(SUM(t.price), 0) AS price, t.owner_user_id
|
||||
FROM crm_receivable t
|
||||
WHERE t.deleted = 0
|
||||
AND t.audit_status = 20
|
||||
and t.owner_user_id in
|
||||
<foreach collection="userIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND t.return_time between #{startTime} and #{endTime}
|
||||
GROUP BY t.owner_user_id
|
||||
ORDER BY price DESC
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user