|
@@ -18,8 +18,8 @@
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.model.Finance">
|
|
<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.model.Finance">
|
|
- select a.id as id, a.name as advertiserName, (ifnull(sum(b.allocate), 0) - ifnull(sum(b.consume), 0)) as adBalance, ifnull(sum(b.allocate), 0) as sumAllocation, max(b.act_time) as upDated from t_adv_balance b,t_advertiser a
|
|
|
|
- where a.id = b.advertiser_id
|
|
|
|
|
|
+ select a.id as id, a.name as advertiserName, (ifnull(sum(b.allocate), 0) - ifnull(sum(b.consume), 0)) as adBalance, ifnull(sum(b.allocate), 0) as sumAllocation, max(b.act_time) as upDated from t_advertiser a left join t_adv_balance b
|
|
|
|
+ on a.id = b.advertiser_id
|
|
<if test="agentId != null">
|
|
<if test="agentId != null">
|
|
and a.agent_id = #{agentId}
|
|
and a.agent_id = #{agentId}
|
|
</if>
|
|
</if>
|