[fix]显示总商户数,包括禁用的

master
hellolujian 6 years ago
parent 7ff09c78cb
commit 158276ecff

@ -102,7 +102,10 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
}
JSONObject res = new JSONObject();
res.put("new_partners", clientAnalysisMapper.countNewClients(params));
res.put("total_partners", clientAnalysisMapper.countClients(params));
//res.put("total_partners", clientAnalysisMapper.countClients(params));
// 统计所有的商户,包括禁用的
res.put("total_partners", clientAnalysisMapper.countClientsAll(params));
stringRedisTemplate.boundValueOps("org_commonAnalysis3"+params.getString("org_id")+params.getString("begin")).set(res.toJSONString(), 5, TimeUnit.MINUTES);
return res;
}

@ -22,6 +22,9 @@ public interface ClientAnalysisMapper {
int countClients(JSONObject params);
// 统计所有的商户,包括禁用的
int countClientsAll(JSONObject params);
@AutoSql(type = SqlType.COUNT)
@AdvanceSelect(addonWhereClause = "sub_merchant_id is not null")
int countTotalPartners();

@ -40,6 +40,19 @@
</if>
GROUP BY a.datelist
</select>
<!--显示所有的商户,包括禁用的-->
<select id="countClientsAll" resultType="java.lang.Integer">
<![CDATA[
SELECT count(client_id)
FROM sys_clients
WHERE
create_time <= #{end} and (approve_result is null or approve_result !=0)
]]>
<if test="org_id!=null and org_ids==null">and org_id=#{org_id}</if>
<if test="org_ids!=null">and org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</select>
<select id="countClients" resultType="java.lang.Integer">
<![CDATA[
SELECT count(client_id)

Loading…
Cancel
Save