修改ec变更逻辑

This commit is contained in:
xiaodong.hu
2023-07-26 21:04:35 +08:00
parent 8f2a50fbe6
commit 15c8b52280
2 changed files with 43 additions and 4 deletions

View File

@@ -54,14 +54,51 @@
</where>
</select>
<select id="selectByHourDate" resultType="com.cool.store.entity.SyncEcCustomerDO" >
SELECT a.id as id, a.username as customername,a.mobile as customermobile,d.`name` as followname,d.mobile as followmobile ,c.channel_id as channelId FROM hy_partner_user_info a LEFT join hy_partner_line_info b on
a.partner_id=b.partner_id LEFT join hy_partner_user_channel c on a.user_channel_id=c.channel_id left join enterprise_user d on b.investment_manager=d.user_id
SELECT
a.id AS id,b.partner_id,
a.username AS customername,
a.mobile AS customermobile,
d.`name` AS followname,
d.mobile AS followmobile,
c.channel_id AS channelId ,ifnull(tl_l.followCount,0) as followCount
FROM
hy_partner_user_info a
LEFT JOIN hy_partner_line_info b ON a.partner_id = b.partner_id and b.deleted=0
LEFT JOIN hy_partner_user_channel c ON a.user_channel_id = c.channel_id
LEFT JOIN enterprise_user d ON b.investment_manager = d.user_id and d.deleted=0
LEFT JOIN (
SELECT
partner_id,
IFNULL( COUNT( 1 ), 0 ) AS followCount
FROM
hy_partner_line_info
WHERE
( deleted = 1 OR ( deleted = 0 AND line_status IN ( 0, 3 ) AND close_time IS NOT NULL ) )
AND investment_manager IS NOT NULL
GROUP BY
partner_id ) tl_l on b.partner_id=tl_l.partner_id
WHERE ( a.create_time BETWEEN #{selectTime} and #{now} or
a.update_time BETWEEN #{selectTime} and #{now} ) order by a.id Limit #{limit1},#{limit2}
</select>
<select id="selectByHourDateCount" resultType="java.lang.Integer">
SELECT count(*) FROM hy_partner_user_info a LEFT join hy_partner_line_info b on
a.partner_id=b.partner_id LEFT join hy_partner_user_channel c on a.user_channel_id=c.channel_id left join enterprise_user d on b.investment_manager=d.user_id
SELECT
count(*)
FROM
hy_partner_user_info a
LEFT JOIN hy_partner_line_info b ON a.partner_id = b.partner_id and b.deleted=0
LEFT JOIN hy_partner_user_channel c ON a.user_channel_id = c.channel_id
LEFT JOIN enterprise_user d ON b.investment_manager = d.user_id and d.deleted=0
LEFT JOIN (
SELECT
partner_id,
IFNULL( COUNT( 1 ), 0 ) AS followCount
FROM
hy_partner_line_info
WHERE
( deleted = 1 OR ( deleted = 0 AND line_status IN ( 0, 3 ) AND close_time IS NOT NULL ) )
AND investment_manager IS NOT NULL
GROUP BY
partner_id ) tl_l on b.partner_id=tl_l.partner_id
WHERE (a.create_time BETWEEN #{selectTime} and #{now} or
a.update_time BETWEEN #{selectTime} and #{now} )
</select>

View File

@@ -18,4 +18,6 @@ public class SyncEcCustomerDO {
private String followmobile;
private Integer channelId;
private Integer followCount;
}