|
@@ -0,0 +1,134 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
+<mapper namespace="correlationSqlMapper">
|
|
|
+ <select id="findAllCorrelation" resultType="com.cloudcross.ssp.model.Correlation">
|
|
|
+ select t_adv_agent.operator_id as operatorId
|
|
|
+ ,t_adv_agent.id as agentId
|
|
|
+ ,t_adv_agent.name as agentName
|
|
|
+ , t_operator.company_name
|
|
|
+ from t_adv_agent,t_operator
|
|
|
+ where operator_id !=0 and t_operator.id = t_adv_agent.operator_id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findCorrelationByOperatorId" resultType="com.cloudcross.ssp.model.Correlation" parameterType="Long">
|
|
|
+ select t_adv_agent.operator_id as operatorId
|
|
|
+ ,t_adv_agent.id as agentId
|
|
|
+ ,t_adv_agent.name as agentName
|
|
|
+ , t_operator.company_name
|
|
|
+ from t_adv_agent,t_operator
|
|
|
+ where operator_id = #{operatorId} and t_operator.id = t_adv_agent.operator_id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <update id="addCorrelation1" parameterType="com.cloudcross.ssp.model.Correlation">
|
|
|
+ update
|
|
|
+ t_account,
|
|
|
+ t_adv_agent a,
|
|
|
+ t_advertiser b,
|
|
|
+ t_order c,
|
|
|
+ t_campaign d,
|
|
|
+ t_adgroup e
|
|
|
+
|
|
|
+ set
|
|
|
+ t_account.operator_id= #{operatorId},
|
|
|
+ a.operator_id=#{operatorId},
|
|
|
+ b.operator_id=#{operatorId},b.updated = NOW(),
|
|
|
+ c.operator_id=#{operatorId},c.updated = NOW(),
|
|
|
+ d.operator_id=#{operatorId},d.updated = NOW(),
|
|
|
+ e.operator_id=#{operatorId},e.updated = NOW()
|
|
|
+
|
|
|
+ where
|
|
|
+ t_account.agent_id = #{agentId}
|
|
|
+ and a.id = #{agentId}
|
|
|
+ and b.agent_id = #{agentId}
|
|
|
+ and c.agent_id = #{agentId}
|
|
|
+ and d.agent_id = #{agentId}
|
|
|
+ and e.agent_id = #{agentId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="addCorrelation2" parameterType="com.cloudcross.ssp.model.Correlation">
|
|
|
+ update
|
|
|
+ t_rpt_adv_banner f,
|
|
|
+ t_rpt_adv_location g,
|
|
|
+ t_rpt_adv_os h,
|
|
|
+ t_rpt_adv_place i,
|
|
|
+ t_rpt_adv_schema j,
|
|
|
+ t_rpt_advertiser k,
|
|
|
+ t_rpt_advertiser_hour l
|
|
|
+
|
|
|
+ set
|
|
|
+ f.operator_id=#{operatorId},
|
|
|
+ g.operator_id=#{operatorId},
|
|
|
+ h.operator_id=#{operatorId},
|
|
|
+ i.operator_id=#{operatorId},
|
|
|
+ j.operator_id=#{operatorId},
|
|
|
+ k.operator_id=#{operatorId},
|
|
|
+ l.operator_id=#{operatorId}
|
|
|
+
|
|
|
+ where
|
|
|
+ and f.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and g.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and h.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and i.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and j.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and k.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and l.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteCorrelation1" parameterType="com.cloudcross.ssp.model.Correlation">
|
|
|
+ update
|
|
|
+ t_account,
|
|
|
+ t_adv_agent a,
|
|
|
+ t_advertiser b,
|
|
|
+ t_order c,
|
|
|
+ t_campaign d,
|
|
|
+ t_adgroup e
|
|
|
+
|
|
|
+ set
|
|
|
+ t_account.operator_id= 0,
|
|
|
+ a.operator_id=0,
|
|
|
+ b.operator_id=0,b.updated = NOW(),
|
|
|
+ c.operator_id=0,c.updated = NOW(),
|
|
|
+ d.operator_id=0,d.updated = NOW(),
|
|
|
+ e.operator_id=0,e.updated = NOW()
|
|
|
+
|
|
|
+ where
|
|
|
+ t_account.agent_id = #{agentId}
|
|
|
+ and a.id = #{agentId}
|
|
|
+ and b.agent_id = #{agentId}
|
|
|
+ and c.agent_id = #{agentId}
|
|
|
+ and d.agent_id = #{agentId}
|
|
|
+ and e.agent_id = #{agentId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteCorrelation2" parameterType="com.cloudcross.ssp.model.Correlation">
|
|
|
+ update
|
|
|
+ t_rpt_adv_banner f,
|
|
|
+ t_rpt_adv_location g,
|
|
|
+ t_rpt_adv_os h,
|
|
|
+ t_rpt_adv_place i,
|
|
|
+ t_rpt_adv_schema j,
|
|
|
+ t_rpt_advertiser k,
|
|
|
+ t_rpt_advertiser_hour l
|
|
|
+
|
|
|
+ set
|
|
|
+ f.operator_id=0,
|
|
|
+ g.operator_id=0,
|
|
|
+ h.operator_id=0,
|
|
|
+ i.operator_id=0,
|
|
|
+ j.operator_id=0,
|
|
|
+ k.operator_id=0,
|
|
|
+ l.operator_id=0
|
|
|
+
|
|
|
+ where
|
|
|
+ and f.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and g.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and h.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and i.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and j.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and k.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+ and l.advertiser_id in (select id from t_advertiser where agent_id = #{agent_id})
|
|
|
+
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|