|
@@ -3,75 +3,90 @@
|
|
<mapper namespace="org.jeecg.modules.bytedance.advertise.mapper.MonitorBytedanceActionTrackUrlMapper">
|
|
<mapper namespace="org.jeecg.modules.bytedance.advertise.mapper.MonitorBytedanceActionTrackUrlMapper">
|
|
|
|
|
|
|
|
|
|
-<!-- 获取头条自动配置中的账户 以及 点击监测链接-->
|
|
|
|
- <select id="getBytedancStrategyAcctionId" resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
|
|
|
|
+ <!-- 获取头条自动配置中的账户 以及 点击监测链接-->
|
|
|
|
+ <select id="getBytedancStrategyAcctionId"
|
|
|
|
+ resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
SELECT
|
|
SELECT
|
|
- stra.account_id accountId,
|
|
|
|
- stra.ad_convert_id convertId,
|
|
|
|
- stra.creative_action_track_url actionTrackUrl,
|
|
|
|
- ua.auth_name accountName,
|
|
|
|
- ua.user_id operateUserid,
|
|
|
|
- ua.user_name operateUserName
|
|
|
|
|
|
+ stra.account_id accountId,
|
|
|
|
+ stra.ad_convert_id convertId,
|
|
|
|
+ stra.creative_action_track_url actionTrackUrl,
|
|
|
|
+ ua.auth_name accountName,
|
|
|
|
+ ua.user_id operateUserid,
|
|
|
|
+ ua.user_name operateUserName
|
|
FROM
|
|
FROM
|
|
- ctop_ai_bytedance_advertiser_strategy stra
|
|
|
|
- LEFT JOIN ctop_user_allocation ua on stra.account_id = ua.account_id
|
|
|
|
|
|
+ ctop_ai_bytedance_advertiser_strategy stra
|
|
|
|
+ LEFT JOIN ctop_user_allocation ua on stra.account_id = ua.account_id
|
|
WHERE
|
|
WHERE
|
|
- stra.status = 0
|
|
|
|
|
|
+ stra.status = 0
|
|
<if test="accountId !=null and accountId != ''">
|
|
<if test="accountId !=null and accountId != ''">
|
|
AND stra.account_id = #{accountId}
|
|
AND stra.account_id = #{accountId}
|
|
</if>
|
|
</if>
|
|
GROUP BY stra.account_id
|
|
GROUP BY stra.account_id
|
|
ORDER BY
|
|
ORDER BY
|
|
- stra.create_time DESC
|
|
|
|
|
|
+ stra.create_time DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- 根据账户id 查询该账户下的计划中的 点击监测链接 -->
|
|
<!-- 根据账户id 查询该账户下的计划中的 点击监测链接 -->
|
|
- <select id="getBytedancPlanActionTrackUrl" resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
|
|
- SELECT
|
|
|
|
- DISTINCT
|
|
|
|
- action_track_url actionTrackUrl,
|
|
|
|
- id as planId,
|
|
|
|
- account_id
|
|
|
|
- FROM
|
|
|
|
- ctop_bytedance_advertise_plan
|
|
|
|
|
|
+ <select id="getBytedancPlanActionTrackUrl"
|
|
|
|
+ resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
|
|
+ SELECT DISTINCT action_track_url actionTrackUrl,
|
|
|
|
+ id as planId,
|
|
|
|
+ account_id
|
|
|
|
+ FROM ctop_bytedance_advertise_plan
|
|
WHERE action_track_url is NOT NULL
|
|
WHERE action_track_url is NOT NULL
|
|
- and opt_status = 'AD_STATUS_ENABLE'
|
|
|
|
- and account_id = #{accountId}
|
|
|
|
- and DATE_FORMAT(start_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
|
|
|
|
|
|
+ and opt_status = 'AD_STATUS_ENABLE'
|
|
|
|
+ and account_id = #{accountId}
|
|
|
|
+ and DATE_FORMAT(start_time, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!-- 获取用户微信id -->
|
|
<!-- 获取用户微信id -->
|
|
<select id="getWChatIdByUserId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getWChatIdByUserId" resultType="com.alibaba.fastjson.JSONObject">
|
|
- select t1.wexin_id,corp_id
|
|
|
|
|
|
+ select t1.wexin_id, corp_id
|
|
from ctop_corp_wexin_user t1
|
|
from ctop_corp_wexin_user t1
|
|
- left join sys_user t2
|
|
|
|
- on t1.user_id = t2.id
|
|
|
|
- where t1.user_id = #{userId}
|
|
|
|
|
|
+ left join sys_user t2
|
|
|
|
+ on t1.user_id = t2.id
|
|
|
|
+ where t1.user_id = #{userId}
|
|
and t2.`status` = 1
|
|
and t2.`status` = 1
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
+ <!-- 获取用户微信id -->
|
|
|
|
+ <select id="getWChatIdsByAccountId" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ select wexin_id, corp_id, wexin_name
|
|
|
|
+ from ctop_corp_wexin_user
|
|
|
|
+ where user_id = (select ctop_user_allocation.user_id
|
|
|
|
+ from ctop_user_allocation
|
|
|
|
+ where account_id = #{accountId} limit 1)
|
|
|
|
+ union all
|
|
|
|
+ select wexin_id, corp_id, wexin_name
|
|
|
|
+ from ctop_corp_wexin_user
|
|
|
|
+ where user_id = (select leader_id
|
|
|
|
+ from sys_user
|
|
|
|
+ where id = (SELECT ctop_user_allocation.user_id
|
|
|
|
+ FROM ctop_user_allocation
|
|
|
|
+ WHERE account_id = #{accountId}
|
|
|
|
+ LIMIT 1))
|
|
|
|
+ union all
|
|
|
|
+ select wexin_id, corp_id, wexin_name
|
|
|
|
+ from ctop_corp_wexin_user
|
|
|
|
+ where user_id = '461857c245f54ba5813bcb5900a23092';
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
|
|
<!-- 新增第三方监测连接 -->
|
|
<!-- 新增第三方监测连接 -->
|
|
<insert id="insertAccountTrackUrl">
|
|
<insert id="insertAccountTrackUrl">
|
|
- INSERT INTO ctop_ai_bytedance_advertiser_strategy_action_track_url (
|
|
|
|
- `account_id`,
|
|
|
|
- `action_track_url`,
|
|
|
|
- `warning_flag`,
|
|
|
|
- `create_user_id`,
|
|
|
|
- `create_time`
|
|
|
|
- )
|
|
|
|
- VALUES
|
|
|
|
- ( #{accountId}, #{actionTrackUrl}, 1, #{createUserId}, NOW());
|
|
|
|
|
|
+ INSERT INTO ctop_ai_bytedance_advertiser_strategy_action_track_url (`account_id`,
|
|
|
|
+ `action_track_url`,
|
|
|
|
+ `warning_flag`,
|
|
|
|
+ `create_user_id`,
|
|
|
|
+ `create_time`)
|
|
|
|
+ VALUES (#{accountId}, #{actionTrackUrl}, 1, #{createUserId}, NOW());
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
<!-- 查询 监测链接 -->
|
|
<!-- 查询 监测链接 -->
|
|
<select id="getAccountActionTrackUrl" resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
<select id="getAccountActionTrackUrl" resultType="org.jeecg.modules.bytedance.advertise.vo.MonitorBytedanceAdVo">
|
|
SELECT
|
|
SELECT
|
|
@@ -89,18 +104,18 @@
|
|
ctop_ai_bytedance_advertiser_strategy_action_track_url u
|
|
ctop_ai_bytedance_advertiser_strategy_action_track_url u
|
|
LEFT JOIN ctop_user_allocation a on u.account_id = a.account_id
|
|
LEFT JOIN ctop_user_allocation a on u.account_id = a.account_id
|
|
<where>
|
|
<where>
|
|
- <if test="accountId !=null and accountId != ''">
|
|
|
|
- AND u.account_id = #{accountId}
|
|
|
|
- </if>
|
|
|
|
- <if test="warningFlag !=null and warningFlag != ''">
|
|
|
|
- AND u.warning_flag = #{warningFlag}
|
|
|
|
- </if>
|
|
|
|
- <if test="operateUserIds != null and operateUserIds.size > 0">
|
|
|
|
- AND a.user_id in
|
|
|
|
- <foreach item="userId" index="index" collection="operateUserIds" open="(" separator="," close=")">
|
|
|
|
- #{userId}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
|
|
+ <if test="accountId !=null and accountId != ''">
|
|
|
|
+ AND u.account_id = #{accountId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="warningFlag !=null and warningFlag != ''">
|
|
|
|
+ AND u.warning_flag = #{warningFlag}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="operateUserIds != null and operateUserIds.size > 0">
|
|
|
|
+ AND a.user_id in
|
|
|
|
+ <foreach item="userId" index="index" collection="operateUserIds" open="(" separator="," close=")">
|
|
|
|
+ #{userId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -118,7 +133,7 @@
|
|
<if test="createUserId != null and createUserId !=''">
|
|
<if test="createUserId != null and createUserId !=''">
|
|
create_user_id =#{createUserId},
|
|
create_user_id =#{createUserId},
|
|
</if>
|
|
</if>
|
|
- update_time = NOW()
|
|
|
|
|
|
+ update_time = NOW()
|
|
WHERE account_id = #{accountId};
|
|
WHERE account_id = #{accountId};
|
|
</update>
|
|
</update>
|
|
|
|
|