|
@@ -53,7 +53,7 @@
|
|
where dir_id = #{id}
|
|
where dir_id = #{id}
|
|
AND rel_type = 'account'
|
|
AND rel_type = 'account'
|
|
<if test=" status!=null">
|
|
<if test=" status!=null">
|
|
- AND t1.data_status = #{status}
|
|
|
|
|
|
+ AND t1.data_status = #{status}
|
|
</if>
|
|
</if>
|
|
<if test="accountIds!=null">
|
|
<if test="accountIds!=null">
|
|
AND rel_id IN
|
|
AND rel_id IN
|
|
@@ -65,34 +65,42 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getAccountByProjectId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="getAccountByProjectId" resultType="com.alibaba.fastjson.JSONObject">
|
|
- SELECT
|
|
|
|
- t1.account_id as 'accountId',
|
|
|
|
- CONCAT(t1.auth_name,'(',t1.account_id,')') as 'authName',
|
|
|
|
- IFNULL(t2.data_status,0) as 'state'
|
|
|
|
- FROM ctop_user_allocation t1
|
|
|
|
- LEFT JOIN (
|
|
|
|
- SELECT rel_id,data_status FROM ctop_kuaishou_directional_package_rel
|
|
|
|
- WHERE project_id = #{projectId}
|
|
|
|
- AND rel_type = 'account'
|
|
|
|
- AND dir_id = #{id}
|
|
|
|
- ) t2 ON t1.account_id = t2.rel_id
|
|
|
|
|
|
+ SELECT t1.account_id as 'accountId', CONCAT(t1.auth_name, '(', t1.account_id, ')') as 'authName', IFNULL(t2.data_status, 0) as 'state'
|
|
|
|
+ FROM ctop_user_allocation t1
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ SELECT rel_id, data_status
|
|
|
|
+ FROM ctop_kuaishou_directional_package_rel
|
|
|
|
+ WHERE project_id = #{projectId}
|
|
|
|
+ AND rel_type = 'account'
|
|
|
|
+ AND dir_id = #{id}
|
|
|
|
+ ) t2 ON t1.account_id = t2.rel_id
|
|
where t1.account_status = 0
|
|
where t1.account_status = 0
|
|
AND t1.project_id = #{projectId}
|
|
AND t1.project_id = #{projectId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryRelId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryRelId" resultType="com.alibaba.fastjson.JSONObject">
|
|
- SELECT rel_id,template_id FROM ctop_kuaishou_directional_package_rel
|
|
|
|
- WHERE project_id = #{projectId}
|
|
|
|
|
|
+ SELECT rel_id, template_id
|
|
|
|
+ FROM ctop_kuaishou_directional_package_rel
|
|
|
|
+ WHERE project_id = #{projectId}
|
|
AND rel_type = #{type}
|
|
AND rel_type = #{type}
|
|
AND dir_id = #{id}
|
|
AND dir_id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryUnitIdByAccountId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryUnitIdByAccountId" resultType="com.alibaba.fastjson.JSONObject">
|
|
- SELECT rel_id,template_id FROM(
|
|
|
|
- SELECT DISTINCT unit_id FROM ctop_kuaishou_group
|
|
|
|
- where account_id = #{accountId} ) t1
|
|
|
|
- INNER JOIN ctop_kuaishou_directional_package_rel t2 ON t1.unit_id = t2.rel_id
|
|
|
|
- WHERE t2.rel_type = 'unit' AND t2.dir_id = #{id}
|
|
|
|
|
|
+ SELECT rel_id, template_id
|
|
|
|
+ FROM (
|
|
|
|
+ SELECT DISTINCT unit_id
|
|
|
|
+ FROM ctop_kuaishou_group
|
|
|
|
+ where account_id = #{accountId}) t1
|
|
|
|
+ INNER JOIN ctop_kuaishou_directional_package_rel t2 ON t1.unit_id = t2.rel_id
|
|
|
|
+ WHERE t2.rel_type = 'unit'
|
|
|
|
+ AND t2.dir_id = #{id}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <update id="updateTemName">
|
|
|
|
+ update
|
|
|
|
+ ctop_kuaishou_directional_package_rel
|
|
|
|
+ set template_name = #{templateName}
|
|
|
|
+ where dir_id = #{id}
|
|
|
|
+ </update>
|
|
</mapper>
|
|
</mapper>
|