修改ec变更逻辑
This commit is contained in:
@@ -54,14 +54,51 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByHourDate" resultType="com.cool.store.entity.SyncEcCustomerDO" >
|
<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
|
SELECT
|
||||||
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
|
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
|
WHERE ( a.create_time BETWEEN #{selectTime} and #{now} or
|
||||||
a.update_time BETWEEN #{selectTime} and #{now} ) order by a.id Limit #{limit1},#{limit2}
|
a.update_time BETWEEN #{selectTime} and #{now} ) order by a.id Limit #{limit1},#{limit2}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByHourDateCount" resultType="java.lang.Integer">
|
<select id="selectByHourDateCount" resultType="java.lang.Integer">
|
||||||
SELECT count(*) FROM hy_partner_user_info a LEFT join hy_partner_line_info b on
|
SELECT
|
||||||
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
|
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
|
WHERE (a.create_time BETWEEN #{selectTime} and #{now} or
|
||||||
a.update_time BETWEEN #{selectTime} and #{now} )
|
a.update_time BETWEEN #{selectTime} and #{now} )
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ public class SyncEcCustomerDO {
|
|||||||
private String followmobile;
|
private String followmobile;
|
||||||
|
|
||||||
private Integer channelId;
|
private Integer channelId;
|
||||||
|
|
||||||
|
private Integer followCount;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user