34 lines
1.4 KiB
XML
34 lines
1.4 KiB
XML
<?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.CrmBiRankingMapper">
|
|
|
|
<select id="selectContractPriceRank"
|
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
|
|
SELECT IFNULL(SUM(price), 0) AS count, owner_user_id
|
|
FROM crm_contract
|
|
WHERE deleted = 0
|
|
AND audit_status = 20
|
|
and owner_user_id in
|
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
|
#{userId}
|
|
</foreach>
|
|
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
|
GROUP BY owner_user_id
|
|
</select>
|
|
|
|
<select id="selectReceivablePriceRank"
|
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
|
|
SELECT IFNULL(SUM(price), 0) AS count, owner_user_id
|
|
FROM crm_receivable
|
|
WHERE deleted = 0
|
|
AND audit_status = 20
|
|
and owner_user_id in
|
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
|
#{userId}
|
|
</foreach>
|
|
AND return_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
|
GROUP BY owner_user_id
|
|
</select>
|
|
|
|
</mapper>
|