|
|
@@ -4,70 +4,70 @@
|
|
|
<insert id="addOne" parameterType="com.ytpm.app.model.YtDyzUser">
|
|
|
insert into yt_dyz_user
|
|
|
(
|
|
|
- user_id,
|
|
|
- nick_name,
|
|
|
- head_img,
|
|
|
- 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,
|
|
|
- platform_id,
|
|
|
- app_id,
|
|
|
- power,
|
|
|
- phone,
|
|
|
- phone_json,
|
|
|
- device_id
|
|
|
+ user_id,
|
|
|
+ nick_name,
|
|
|
+ head_img,
|
|
|
+ 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,
|
|
|
+ platform_id,
|
|
|
+ app_id,
|
|
|
+ power,
|
|
|
+ phone,
|
|
|
+ phone_json,
|
|
|
+ device_id
|
|
|
)
|
|
|
values
|
|
|
- (
|
|
|
- #{userId},
|
|
|
- #{nickName},
|
|
|
- #{headImg},
|
|
|
- #{registryTime},
|
|
|
- #{lastLoginTime},
|
|
|
- #{lastLoginIp},
|
|
|
- #{loginDays},
|
|
|
- #{totalVideo},
|
|
|
- #{totalIncome},
|
|
|
- #{redPacketBalance},
|
|
|
- #{redPacketAmount},
|
|
|
- #{pointsBalance},
|
|
|
- #{pointsTotal},
|
|
|
- #{withdrawTotal},
|
|
|
- #{signDays},
|
|
|
- #{userStatus},
|
|
|
- #{riskReason},
|
|
|
- #{wxOpenId},
|
|
|
- #{ditchId},
|
|
|
- #{platformId},
|
|
|
- #{appId},
|
|
|
- #{power},
|
|
|
- #{phone},
|
|
|
- #{phoneJson},
|
|
|
- #{deviceId}
|
|
|
- )
|
|
|
+ (
|
|
|
+ #{userId},
|
|
|
+ #{nickName},
|
|
|
+ #{headImg},
|
|
|
+ #{registryTime},
|
|
|
+ #{lastLoginTime},
|
|
|
+ #{lastLoginIp},
|
|
|
+ #{loginDays},
|
|
|
+ #{totalVideo},
|
|
|
+ #{totalIncome},
|
|
|
+ #{redPacketBalance},
|
|
|
+ #{redPacketAmount},
|
|
|
+ #{pointsBalance},
|
|
|
+ #{pointsTotal},
|
|
|
+ #{withdrawTotal},
|
|
|
+ #{signDays},
|
|
|
+ #{userStatus},
|
|
|
+ #{riskReason},
|
|
|
+ #{wxOpenId},
|
|
|
+ #{ditchId},
|
|
|
+ #{platformId},
|
|
|
+ #{appId},
|
|
|
+ #{power},
|
|
|
+ #{phone},
|
|
|
+ #{phoneJson},
|
|
|
+ #{deviceId}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="addPowerRecord">
|
|
|
insert into yt_dyz_power_record
|
|
|
(
|
|
|
- record_id, user_id, type, remark, add_time
|
|
|
+ record_id, user_id, type, remark, add_time
|
|
|
)
|
|
|
values
|
|
|
- (
|
|
|
- #{recordId},#{userId},#{type},#{remark},#{addTime}
|
|
|
- )
|
|
|
+ (
|
|
|
+ #{recordId},#{userId},#{type},#{remark},#{addTime}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="saveAppConfig">
|
|
|
insert into yt_app_default_config
|
|
|
@@ -151,6 +151,24 @@
|
|
|
<if test="interstitialIntervalTime != null">
|
|
|
interstitial_interval_time = #{interstitialIntervalTime}
|
|
|
</if>
|
|
|
+ <if test="flowIntervalTime != null">
|
|
|
+ flow_interval_time = #{flowIntervalTime}
|
|
|
+ </if>
|
|
|
+ <if test="taskLimitTip != null">
|
|
|
+ task_limit_tip = #{taskLimitTip}
|
|
|
+ </if>
|
|
|
+ <if test="lowValueTip != null">
|
|
|
+ low_value_tip = #{lowValueTip}
|
|
|
+ </if>
|
|
|
+ <if test="brushTip != null">
|
|
|
+ brush_tip = #{brushTip}
|
|
|
+ </if>
|
|
|
+ <if test="startWaitTime != null">
|
|
|
+ start_wait_time = #{startWaitTime}
|
|
|
+ </if>
|
|
|
+ <if test="canCacheVideo != null">
|
|
|
+ can_cache_video = #{canCacheVideo}
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where app_id = #{appId}
|
|
|
</update>
|
|
|
@@ -220,6 +238,9 @@
|
|
|
<if test="wxOpenId != null">
|
|
|
wx_open_id = #{wxOpenId},
|
|
|
</if>
|
|
|
+ <if test="phoneJson != null">
|
|
|
+ phone_json = #{phoneJson},
|
|
|
+ </if>
|
|
|
<if test="platformId != null">
|
|
|
platform_id = #{platformId}
|
|
|
</if>
|
|
|
@@ -231,14 +252,14 @@
|
|
|
</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, 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}
|
|
|
+ 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, 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 !=''">
|
|
|
@@ -267,9 +288,9 @@
|
|
|
</if>
|
|
|
<if test="appIds != null and appIds != ''">
|
|
|
and app_id in
|
|
|
- <foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
order by user_id desc
|
|
|
</select>
|
|
|
@@ -317,37 +338,37 @@
|
|
|
</resultMap>
|
|
|
<select id="getUserList" resultMap="UserMap">
|
|
|
select
|
|
|
- du.user_id,
|
|
|
- du.head_img,
|
|
|
- du.nick_name,
|
|
|
- du.phone,
|
|
|
- du.device_id,
|
|
|
- du.registry_time,
|
|
|
- du.last_login_time,
|
|
|
- du.last_login_ip,
|
|
|
- du.login_days,
|
|
|
- du.total_video,
|
|
|
- du.total_income,
|
|
|
- du.red_packet_balance,
|
|
|
- du.red_packet_amount,
|
|
|
- du.points_balance,
|
|
|
- du.points_total,
|
|
|
- du.withdraw_total,
|
|
|
- du.sign_days,
|
|
|
- du.user_status,
|
|
|
- du.risk_reason,
|
|
|
- du.wx_open_id,
|
|
|
- du.ditch_id,
|
|
|
- du.app_id,
|
|
|
- du.platform_id,
|
|
|
- du.power,
|
|
|
- lr.record_id,
|
|
|
- lr.login_time,
|
|
|
- lr.device_brand,
|
|
|
- lr. device_model,
|
|
|
- lr.login_ip,
|
|
|
- lr.operator,
|
|
|
- lr.ip_addr
|
|
|
+ du.user_id,
|
|
|
+ du.head_img,
|
|
|
+ du.nick_name,
|
|
|
+ du.phone,
|
|
|
+ du.device_id,
|
|
|
+ du.registry_time,
|
|
|
+ du.last_login_time,
|
|
|
+ du.last_login_ip,
|
|
|
+ du.login_days,
|
|
|
+ du.total_video,
|
|
|
+ du.total_income,
|
|
|
+ du.red_packet_balance,
|
|
|
+ du.red_packet_amount,
|
|
|
+ du.points_balance,
|
|
|
+ du.points_total,
|
|
|
+ du.withdraw_total,
|
|
|
+ du.sign_days,
|
|
|
+ du.user_status,
|
|
|
+ du.risk_reason,
|
|
|
+ du.wx_open_id,
|
|
|
+ du.ditch_id,
|
|
|
+ du.app_id,
|
|
|
+ du.platform_id,
|
|
|
+ du.power,
|
|
|
+ lr.record_id,
|
|
|
+ lr.login_time,
|
|
|
+ lr.device_brand,
|
|
|
+ lr. device_model,
|
|
|
+ lr.login_ip,
|
|
|
+ lr.operator,
|
|
|
+ lr.ip_addr
|
|
|
from yt_dyz_user du
|
|
|
left join yt_dyz_login_record lr on du.user_id = lr.user_id
|
|
|
<where>
|
|
|
@@ -427,14 +448,32 @@
|
|
|
</select>
|
|
|
<select id="getDefaultConfig" resultType="com.ytpm.app.view.WxDefaultConfig">
|
|
|
select
|
|
|
- config_id, config_name, open_id appId, secret, app_id platformAppId, app_key platformAppSecret, app_type,user_path,login_path,ad_path,answer_path,power_path
|
|
|
- ,can_simulator,taku_app_id,taku_key,taku_banner_pid,taku_interstitial_pid,taku_reward_pid,taku_native_pid,can_use_adb,can_accumulation,can_use_float,can_use_root,ditch_id,power_wait_time,interstitial_interval_time
|
|
|
+ config_id, config_name, open_id as app_id, secret, app_id as platformAppId, app_key as platformAppSecret,
|
|
|
+ app_type,user_path, login_path,ad_path,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
|
|
|
from yt_app_default_config
|
|
|
where app_type = #{appType}
|
|
|
</select>
|
|
|
+ <select id="getDefaultConfigByAppId" resultType="com.ytpm.app.view.WxDefaultConfig">
|
|
|
+ select
|
|
|
+ config_id, config_name, open_id, secret, app_id, app_key, app_type,user_path,login_path,ad_path,
|
|
|
+ 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
|
|
|
+ from yt_app_default_config
|
|
|
+ where app_id = #{appId}
|
|
|
+ </select>
|
|
|
<select id="getSecretByAppId" resultType="java.lang.String">
|
|
|
select
|
|
|
- secret
|
|
|
+ config_id, config_name, open_id, secret, app_id, app_key, app_type,user_path,login_path,ad_path,
|
|
|
+ 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
|
|
|
from yt_app_default_config
|
|
|
where app_id = #{appId}
|
|
|
</select>
|
|
|
@@ -449,13 +488,16 @@
|
|
|
platform_id
|
|
|
from yt_dyz_user
|
|
|
where device_id = #{deviceId}
|
|
|
- and wx_open_id = #{openid}
|
|
|
+ and wx_open_id = #{openid}
|
|
|
limit 1
|
|
|
</select>
|
|
|
<select id="getConfigByIds" resultType="com.ytpm.app.view.WxDefaultConfig">
|
|
|
select
|
|
|
- config_id, config_name, open_id, secret, app_id, app_key, app_type,user_path,login_path,ad_path,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
|
|
|
+ config_id, config_name, open_id, secret, app_id, app_key, app_type, user_path, login_path, ad_path,
|
|
|
+ answer_path, power_path,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,can_simulator,
|
|
|
+ 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
|
|
|
from yt_app_default_config
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" item="item" separator="," open="(" close=")">
|
|
|
@@ -464,7 +506,7 @@
|
|
|
</select>
|
|
|
<select id="getAdCount" resultType="java.lang.Integer">
|
|
|
select
|
|
|
- sum(total_video)
|
|
|
+ sum(total_video)
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -482,11 +524,11 @@
|
|
|
</select>
|
|
|
<select id="getAppRanking" resultType="com.ytpm.middle.view.AppRankingListVO">
|
|
|
SELECT
|
|
|
- u.app_id,
|
|
|
- sum( ar.revenue ) totalRevenue
|
|
|
+ u.app_id,
|
|
|
+ sum( ar.revenue ) totalRevenue
|
|
|
FROM
|
|
|
- yt_dyz_ad_record ar
|
|
|
- JOIN yt_dyz_user u ON ar.user_id = u.user_id
|
|
|
+ yt_dyz_ad_record ar
|
|
|
+ JOIN yt_dyz_user u ON ar.user_id = u.user_id
|
|
|
<where>
|
|
|
<if test="sortBy != null">
|
|
|
<choose>
|
|
|
@@ -503,21 +545,21 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY
|
|
|
- u.app_id
|
|
|
+ u.app_id
|
|
|
ORDER BY
|
|
|
- sum( ar.revenue ) DESC
|
|
|
+ sum( ar.revenue ) DESC
|
|
|
LIMIT #{limit}
|
|
|
</select>
|
|
|
<select id="getUserRanking" resultType="com.ytpm.middle.view.UserRankingListVO">
|
|
|
SELECT
|
|
|
- u.user_id,
|
|
|
- u.nick_name,
|
|
|
- u.head_img,
|
|
|
- u.total_video,
|
|
|
- sum( ar.revenue ) totalIncome
|
|
|
+ u.user_id,
|
|
|
+ u.nick_name,
|
|
|
+ u.head_img,
|
|
|
+ u.total_video,
|
|
|
+ sum( ar.revenue ) totalIncome
|
|
|
FROM
|
|
|
- yt_dyz_ad_record ar
|
|
|
- JOIN yt_dyz_user u ON ar.user_id = u.user_id
|
|
|
+ yt_dyz_ad_record ar
|
|
|
+ JOIN yt_dyz_user u ON ar.user_id = u.user_id
|
|
|
<where>
|
|
|
<if test="sortBy != null">
|
|
|
<choose>
|
|
|
@@ -535,12 +577,12 @@
|
|
|
</where>
|
|
|
GROUP BY ar.user_id
|
|
|
ORDER BY
|
|
|
- sum( ar.revenue ) DESC
|
|
|
+ sum( ar.revenue ) DESC
|
|
|
limit #{limit}
|
|
|
</select>
|
|
|
<select id="countUserByAppIds" resultType="java.lang.Integer">
|
|
|
select
|
|
|
- count(user_id)
|
|
|
+ count(user_id)
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -549,7 +591,7 @@
|
|
|
</select>
|
|
|
<select id="countRevenueByAppIds" resultType="java.math.BigDecimal">
|
|
|
select
|
|
|
- sum(total_income)
|
|
|
+ sum(total_income)
|
|
|
from yt_dyz_user
|
|
|
where app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -558,7 +600,7 @@
|
|
|
</select>
|
|
|
<select id="countBannedByAppIds" resultType="java.lang.Integer">
|
|
|
select
|
|
|
- count(user_id)
|
|
|
+ count(user_id)
|
|
|
from yt_dyz_user
|
|
|
where user_status > 1 and app_id in
|
|
|
<foreach collection="appIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -597,8 +639,8 @@
|
|
|
</select>
|
|
|
<select id="countRegistryHour" resultType="com.ytpm.middle.view.AppUserHourVO">
|
|
|
select
|
|
|
- DATE_FORMAT(registry_time,'%Y-%m-%d %H:00:00') as `time`,
|
|
|
- count(user_id) `count`
|
|
|
+ DATE_FORMAT(registry_time,'%Y-%m-%d %H:00:00') as `time`,
|
|
|
+ count(user_id) `count`
|
|
|
from yt_dyz_user
|
|
|
where app_id = #{appId}
|
|
|
<if test="type != null and type ==1">
|
|
|
@@ -631,7 +673,7 @@
|
|
|
</select>
|
|
|
<select id="queryByUserIds" 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, 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 user_id in
|
|
|
<foreach collection="userIds.split(',')" separator="," item="item" open="(" close=")">
|
|
|
@@ -659,21 +701,21 @@
|
|
|
</resultMap>
|
|
|
<select id="queryTodayUserAd" resultMap="UserAdMap">
|
|
|
select
|
|
|
- u.user_id,
|
|
|
- u.app_id,
|
|
|
- u.nick_name,
|
|
|
- ar.record_id,
|
|
|
- ar.placement_id,
|
|
|
- ar.ad_source_id,
|
|
|
- ar.ad_source_type,
|
|
|
- ar.ad_source_index,
|
|
|
- ar.revenue,
|
|
|
- ar.ecpm,
|
|
|
- ar.network_form_id,
|
|
|
- ar.network_name,
|
|
|
- ar.network_placement_id,
|
|
|
- ar.finish_time,
|
|
|
- ar.begin_time
|
|
|
+ u.user_id,
|
|
|
+ u.app_id,
|
|
|
+ u.nick_name,
|
|
|
+ ar.record_id,
|
|
|
+ ar.placement_id,
|
|
|
+ ar.ad_source_id,
|
|
|
+ ar.ad_source_type,
|
|
|
+ ar.ad_source_index,
|
|
|
+ ar.revenue,
|
|
|
+ ar.ecpm,
|
|
|
+ ar.network_form_id,
|
|
|
+ ar.network_name,
|
|
|
+ ar.network_placement_id,
|
|
|
+ ar.finish_time,
|
|
|
+ ar.begin_time
|
|
|
from yt_dyz_ad_record ar
|
|
|
join yt_dyz_user u on ar.user_id = u.user_id
|
|
|
where ar.ad_source_type = #{adSourceType} and ar.app_id = #{appId} and ar.user_id in
|