|
|
@@ -12,6 +12,7 @@
|
|
|
login_days,
|
|
|
total_video,
|
|
|
total_income,
|
|
|
+ nearly_income,
|
|
|
red_packet_balance,
|
|
|
red_packet_amount,
|
|
|
points_balance,
|
|
|
@@ -37,6 +38,7 @@
|
|
|
#{loginDays},
|
|
|
#{totalVideo},
|
|
|
#{totalIncome},
|
|
|
+ #{nearlyIncome},
|
|
|
#{redPacketBalance},
|
|
|
#{redPacketAmount},
|
|
|
#{pointsBalance},
|
|
|
@@ -162,7 +164,10 @@
|
|
|
start_wait_time = #{startWaitTime},
|
|
|
</if>
|
|
|
<if test="canCacheVideo != null">
|
|
|
- can_cache_video = #{canCacheVideo}
|
|
|
+ can_cache_video = #{canCacheVideo},
|
|
|
+ </if>
|
|
|
+ <if test="canAllowAutoRefresh != null">
|
|
|
+ can_allow_auto_refresh = #{canAllowAutoRefresh}
|
|
|
</if>
|
|
|
</set>
|
|
|
where app_id = #{appId}
|
|
|
@@ -206,6 +211,9 @@
|
|
|
<if test="totalIncome != null">
|
|
|
total_income = #{totalIncome},
|
|
|
</if>
|
|
|
+ <if test="nearlyIncome != null">
|
|
|
+ nearly_income = #{nearlyIncome},
|
|
|
+ </if>
|
|
|
<if test="redPacketBalance != null">
|
|
|
red_packet_balance = #{redPacketBalance},
|
|
|
</if>
|
|
|
@@ -247,14 +255,20 @@
|
|
|
</delete>
|
|
|
<select id="getYtAppUser" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id, app_id,phone,device_id, ditch_id, nick_name,head_img, power, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, platform_id
|
|
|
+ user_id, app_id,phone,device_id, ditch_id, nick_name,head_img, power,
|
|
|
+ registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, nearly_income,
|
|
|
+ red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total,
|
|
|
+ sign_days, user_status, risk_reason, wx_open_id, platform_id
|
|
|
from yt_dyz_user
|
|
|
where wx_open_id = #{openid}
|
|
|
and ditch_id = #{ditchId}
|
|
|
</select>
|
|
|
<select id="queryAll" resultType="com.ytpm.app.view.YtAppUserListView">
|
|
|
select
|
|
|
- user_id,app_id,phone,device_id, ditch_id, nick_name,head_img, power, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, platform_id
|
|
|
+ user_id,app_id,phone,device_id, ditch_id, nick_name,head_img, power,
|
|
|
+ registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, nearly_income,
|
|
|
+ red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total,
|
|
|
+ sign_days, user_status, risk_reason, wx_open_id, platform_id
|
|
|
from yt_dyz_user
|
|
|
where 1 = 1
|
|
|
<if test="userId != null and userId !=''">
|
|
|
@@ -291,7 +305,9 @@
|
|
|
</select>
|
|
|
<select id="selectPrimaryKey" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id,app_id,phone,device_id, ditch_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, platform_id, power
|
|
|
+ user_id,app_id,phone,device_id, ditch_id, head_img, nick_name, registry_time, last_login_time, last_login_ip,
|
|
|
+ login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total,
|
|
|
+ withdraw_total, sign_days, user_status, risk_reason, wx_open_id, platform_id, power, nearly_income
|
|
|
from yt_dyz_user
|
|
|
where user_id = #{userId}
|
|
|
</select>
|
|
|
@@ -307,6 +323,7 @@
|
|
|
<result column="login_days" property="loginDays" />
|
|
|
<result column="total_video" property="totalVideo" />
|
|
|
<result column="total_income" property="totalIncome" />
|
|
|
+ <result column="nearly_income" property="nearlyIncome" />
|
|
|
<result column="red_packet_balance" property="redPacketBalance" />
|
|
|
<result column="red_packet_amount" property="redPacketAmount" />
|
|
|
<result column="points_balance" property="pointsBalance" />
|
|
|
@@ -344,6 +361,7 @@
|
|
|
du.login_days,
|
|
|
du.total_video,
|
|
|
du.total_income,
|
|
|
+ du.nearly_income,
|
|
|
du.red_packet_balance,
|
|
|
du.red_packet_amount,
|
|
|
du.points_balance,
|
|
|
@@ -385,11 +403,10 @@
|
|
|
|
|
|
<select id="queryAllByTime" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
SELECT
|
|
|
- user_id,app_id,phone,device_id, nick_name, head_img, power, registry_time,
|
|
|
- last_login_time, last_login_ip, login_days, total_video,
|
|
|
- total_income, red_packet_balance, red_packet_amount,
|
|
|
- points_balance, points_total, withdraw_total, sign_days,
|
|
|
- user_status, risk_reason, wx_open_id, platform_id
|
|
|
+ user_id,app_id,phone,device_id, nick_name, head_img, power,
|
|
|
+ registry_time,last_login_time, last_login_ip, login_days, total_video, total_income, nearly_income,
|
|
|
+ red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total,
|
|
|
+ sign_days, user_status, risk_reason, wx_open_id, platform_id
|
|
|
FROM yt_dyz_user
|
|
|
<where>
|
|
|
<if test="startTime != null">
|
|
|
@@ -448,7 +465,8 @@
|
|
|
taku_app_id, taku_key, taku_banner_pid, taku_native_pid, taku_reward_pid, taku_interstitial_pid,
|
|
|
can_use_root, can_use_adb, can_use_float, can_accumulation,
|
|
|
ditch_id, power_wait_time, interstitial_interval_time,
|
|
|
- low_value_tip, brush_tip,flow_interval_time,task_limit_tip,start_wait_time,can_cache_video
|
|
|
+ low_value_tip, brush_tip,flow_interval_time,task_limit_tip,start_wait_time,
|
|
|
+ can_cache_video,can_allow_auto_refresh
|
|
|
from yt_app_default_config
|
|
|
where app_type = #{appType}
|
|
|
</select>
|
|
|
@@ -458,7 +476,8 @@
|
|
|
answer_path,power_path,can_simulator, taku_app_id, taku_key, taku_banner_pid, taku_native_pid,
|
|
|
taku_reward_pid, taku_interstitial_pid, can_use_root, can_use_adb, can_use_float, can_accumulation,
|
|
|
ditch_id, power_wait_time, interstitial_interval_time,
|
|
|
- low_value_tip, brush_tip,flow_interval_time,task_limit_tip,start_wait_time,can_cache_video
|
|
|
+ low_value_tip, brush_tip,flow_interval_time,task_limit_tip,start_wait_time,
|
|
|
+ can_cache_video,can_allow_auto_refresh
|
|
|
from yt_app_default_config
|
|
|
where app_id = #{appId}
|
|
|
</select>
|
|
|
@@ -468,22 +487,23 @@
|
|
|
answer_path,power_path,can_simulator, taku_app_id, taku_key, taku_banner_pid, taku_native_pid,
|
|
|
taku_reward_pid, taku_interstitial_pid, can_use_root, can_use_adb, can_use_float, can_accumulation,
|
|
|
ditch_id, power_wait_time, interstitial_interval_time,
|
|
|
- low_value_tip, brush_tip, flow_interval_time,task_limit_tip,start_wait_time,can_cache_video
|
|
|
+ low_value_tip, brush_tip, flow_interval_time,task_limit_tip,start_wait_time,
|
|
|
+ can_cache_video,can_allow_auto_refresh
|
|
|
from yt_app_default_config
|
|
|
where app_id = #{appId}
|
|
|
</select>
|
|
|
<select id="queryByOpenid" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id,phone,device_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id, power
|
|
|
+ user_id,phone,device_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days,
|
|
|
+ total_video, total_income, nearly_income, red_packet_balance, red_packet_amount, points_balance, points_total,
|
|
|
+ withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id, power
|
|
|
from yt_dyz_user
|
|
|
where wx_open_id = #{openid}
|
|
|
</select>
|
|
|
<select id="getByDeviceId" resultType="java.lang.String">
|
|
|
- select
|
|
|
- platform_id
|
|
|
+ select platform_id
|
|
|
from yt_dyz_user
|
|
|
- where device_id = #{deviceId}
|
|
|
- and wx_open_id = #{openid}
|
|
|
+ where device_id = #{deviceId} and wx_open_id = #{openid}
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getConfigByIds" resultType="com.ytpm.app.view.WxDefaultConfig">
|
|
|
@@ -500,8 +520,7 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="getAdCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
- sum(total_video)
|
|
|
+ select sum(total_video)
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -509,8 +528,7 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="getRevenueCount" resultType="java.math.BigDecimal">
|
|
|
- select
|
|
|
- sum(total_income)
|
|
|
+ select sum(total_income)
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -721,7 +739,10 @@
|
|
|
</select>
|
|
|
<select id="getMonthRegistryUser" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id, power, phone, device_id
|
|
|
+ user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days,
|
|
|
+ total_video, total_income, nearly_income, red_packet_balance, red_packet_amount, points_balance, points_total,
|
|
|
+ withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id,
|
|
|
+ power, phone, device_id
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -750,20 +771,25 @@
|
|
|
</select>
|
|
|
<select id="getLastRegistryUser" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id, power, phone, device_id, phone_json
|
|
|
+ user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days,
|
|
|
+ total_video, total_income, nearly_income, red_packet_balance, red_packet_amount, points_balance, points_total,
|
|
|
+ withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id,
|
|
|
+ power, phone, device_id, phone_json
|
|
|
from yt_dyz_user
|
|
|
where device_id = #{deviceId}
|
|
|
</select>
|
|
|
|
|
|
<select id="getByDeviceAndDitch" resultType="com.ytpm.app.model.YtDyzUser">
|
|
|
select
|
|
|
- user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days, total_video, total_income, red_packet_balance, red_packet_amount, points_balance, points_total, withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id, power, phone, device_id, phone_json
|
|
|
+ user_id, head_img, nick_name, registry_time, last_login_time, last_login_ip, login_days,
|
|
|
+ total_video, total_income, nearly_income, red_packet_balance, red_packet_amount, points_balance, points_total,
|
|
|
+ withdraw_total, sign_days, user_status, risk_reason, wx_open_id, ditch_id, app_id, platform_id,
|
|
|
+ power, phone, device_id, phone_json
|
|
|
from yt_dyz_user
|
|
|
where device_id = #{deviceId} and ditch_id = #{ditchId} limit 1
|
|
|
</select>
|
|
|
<select id="getPlatformByDeviceId" resultType="java.lang.String">
|
|
|
- select
|
|
|
- platform_id
|
|
|
+ select platform_id
|
|
|
from yt_dyz_user
|
|
|
where device_id = #{deviceId}
|
|
|
limit 1
|
|
|
@@ -779,8 +805,15 @@
|
|
|
</update>
|
|
|
<update id="updateTotal">
|
|
|
UPDATE yt_dyz_user
|
|
|
- SET total_video = COALESCE(total_video, 0) + #{videoCount},
|
|
|
- total_income = COALESCE(total_income, 0) + #{revenue}
|
|
|
+ SET nearly_income = 0, nearly_begin_time = NOW()
|
|
|
WHERE user_id = #{userId}
|
|
|
+ AND last_login_time <![CDATA[ < ]]> DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
+ AND IFNULL(nearly_begin_time, NOW()) <![CDATA[ < ]]> DATE_SUB(NOW(), INTERVAL 3 DAY);
|
|
|
+ UPDATE yt_dyz_user SET nearly_begin_time = NOW() WHERE user_id = #{userId} AND nearly_begin_time IS NULL;
|
|
|
+ UPDATE yt_dyz_user
|
|
|
+ SET total_video = COALESCE(total_video, 0) + #{videoCount},
|
|
|
+ total_income = COALESCE(total_income, 0) + #{revenue},
|
|
|
+ nearly_income = COALESCE(nearly_income, 0) + #{revenue}
|
|
|
+ WHERE user_id = #{userId};
|
|
|
</update>
|
|
|
</mapper>
|