|
@@ -3,13 +3,13 @@
|
|
|
<mapper namespace="advBalanceSqlMapper">
|
|
|
|
|
|
<sql id="base_column">
|
|
|
- id,
|
|
|
+ t_adv_balance.id as id,
|
|
|
account_id as accountId,
|
|
|
- t_agent_id as agentId,
|
|
|
+ agent_id as agentId,
|
|
|
advertiser_id as advertiserId,
|
|
|
act_time as actTime,
|
|
|
num,
|
|
|
- type,
|
|
|
+ <!-- type, -->
|
|
|
charge,
|
|
|
allocate,
|
|
|
consume,
|
|
@@ -18,7 +18,20 @@
|
|
|
balance,
|
|
|
memo
|
|
|
</sql>
|
|
|
-
|
|
|
+ <sql id="base_column2">
|
|
|
+ t_adv_balance.id as id,
|
|
|
+ t_adv_balance.account_id as accountId,
|
|
|
+ t_adv_balance.agent_id as agentId,
|
|
|
+ t_adv_balance.advertiser_id as advertiserId,
|
|
|
+ t_adv_balance.act_time as actTime,
|
|
|
+ t_adv_balance.num as num,
|
|
|
+ t_adv_balance.charge as charge,
|
|
|
+ t_adv_balance.allocate as allocate,
|
|
|
+ t_adv_balance.memo as memo,
|
|
|
+ t_adv_balance.consume as consume,
|
|
|
+ t_adv_balance.balance as balance,
|
|
|
+ t_adv_balance.status as status
|
|
|
+ </sql>
|
|
|
<select id="findAdvBalance" parameterType="int" resultType="com.cloudcross.ssp.model.AdvBalance">
|
|
|
select * from t_adv_balance where id=#{advBalanceId}
|
|
|
</select>
|
|
@@ -161,7 +174,7 @@
|
|
|
|
|
|
<select id="selectById" parameterType="int" resultType="com.cloudcross.ssp.model.AdvBalance">
|
|
|
select
|
|
|
- <include refid="base_column" />
|
|
|
+ <include refid="base_column2" />
|
|
|
from t_adv_balance
|
|
|
<where>
|
|
|
id = #{id}
|
|
@@ -180,7 +193,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParamsBack" parameterType="map" resultType="com.cloudcross.ssp.model.AdvBalance">
|
|
|
- select <include refid="base_column"/>, name as agentName from t_adv_balance left join
|
|
|
+ select <include refid="base_column2"/>, name as agentName from t_adv_balance left join
|
|
|
t_adv_agent on t_adv_balance.agent_id = t_adv_agent.id
|
|
|
<where>
|
|
|
t_adv_balance.advertiser_id = 0 and t_adv_balance.agent_id != 0 and t_adv_balance.status != -1
|
|
@@ -193,7 +206,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParams1Back" parameterType="map" resultType="com.cloudcross.ssp.model.AdvBalance">
|
|
|
- select <include refid="base_column"/>, name as agentName from t_adv_balance left join
|
|
|
+ select <include refid="base_column2"/>, name as agentName from t_adv_balance left join
|
|
|
t_adv_agent on t_adv_balance.agent_id = t_adv_agent.id
|
|
|
<where>
|
|
|
t_adv_balance.advertiser_id = 0 and t_adv_balance.agent_id != 0 and t_adv_balance.status != -1
|
|
@@ -204,7 +217,7 @@
|
|
|
order by act_time desc
|
|
|
</select>
|
|
|
|
|
|
- <select id="findBalanceByAgentIdBack" parameterType="long" resultType="float">
|
|
|
+ <select id="findBalanceByAgentIdBack" parameterType="long" resultType="double">
|
|
|
select balance from t_adv_balance where agent_id = #{agentId} and status != -1 order by id desc limit 1
|
|
|
</select>
|
|
|
|
|
@@ -215,7 +228,7 @@
|
|
|
</insert>
|
|
|
|
|
|
<select id="findByIdBack" parameterType="long" resultType="com.cloudcross.ssp.model.AdvBalance">
|
|
|
- select <include refid="base_column"/> from t_adv_balance
|
|
|
+ select <include refid="base_column2"/> from t_adv_balance
|
|
|
where id = #{id} and status != -1
|
|
|
</select>
|
|
|
|