|
@@ -155,12 +155,12 @@
|
155
|
155
|
<select id="getDrainageVisitRecord" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
|
156
|
156
|
select * from (
|
157
|
157
|
select
|
158
|
|
-<!-- <include refid="columnSql"></include>,-->
|
|
158
|
+ t.share_person as share_person_id,
|
159
|
159
|
t.person_id,
|
160
|
160
|
c.person_type,
|
161
|
161
|
t.create_date as visit_time,
|
162
|
|
- t.tagert_type as event_type,
|
163
|
|
- t.be_share as target_id,
|
|
162
|
+ t.target_type as event_type,
|
|
163
|
+ t.target_id as target_id,
|
164
|
164
|
b.name as drainageName,
|
165
|
165
|
d.building_name as buildingName,
|
166
|
166
|
tn.news_name as newsName,
|
|
@@ -168,26 +168,26 @@
|
168
|
168
|
tsa.activity_name as groupActivityName,
|
169
|
169
|
tbd.title as activityName,
|
170
|
170
|
b.drainage_id
|
171
|
|
- from ta_share t
|
172
|
|
- left join ta_drainage b on t.be_share = b.drainage_id
|
173
|
|
- left join ta_building d on t.be_share = d.building_id
|
174
|
|
- left join ta_news tn on t.be_share = tn.news_id
|
175
|
|
- left join ta_help_activity tha on t.be_share = tha.help_activity_id
|
176
|
|
- left join ta_share_activity tsa on t.be_share = tsa.group_activity_id
|
177
|
|
- left join ta_building_dynamic tbd on t.be_share = tbd.dynamic_id
|
178
|
|
- left join ta_person c on t.person_id = c.person_id
|
|
171
|
+ from ta_share_person_from t
|
|
172
|
+ left join ta_drainage b on t.target_id = b.drainage_id
|
|
173
|
+ left join ta_building d on t.target_id = d.building_id
|
|
174
|
+ left join ta_news tn on t.target_id = tn.news_id
|
|
175
|
+ left join ta_help_activity tha on t.target_id = tha.help_activity_id
|
|
176
|
+ left join ta_share_activity tsa on t.target_id = tsa.group_activity_id
|
|
177
|
+ left join ta_building_dynamic tbd on t.target_id = tbd.dynamic_id
|
|
178
|
+ left join ta_person c on (t.share_person = c.person_id or t.share_person = c.user_id)
|
179
|
179
|
where 1=1
|
180
|
|
- and t.tagert_type != 'consultant'
|
|
180
|
+ and t.target_type in ('h5_share','group_share','help_share','news_share','dynamic_share','building_share')
|
181
|
181
|
<if test="orgId != null and orgId != ''">
|
182
|
182
|
and c.org_id = #{orgId}
|
183
|
183
|
</if>
|
184
|
184
|
<if test="eventType !=null and eventType != ''">
|
185
|
|
- and t.tagert_type = #{eventType}
|
|
185
|
+ and t.target_type = #{eventType}
|
186
|
186
|
</if>
|
187
|
187
|
<if test="activityName !=null and activityName != ''">
|
188
|
188
|
and (
|
189
|
|
- (b.name like concat('%',#{activityName},'%') and t.tagert_type = 'h5')or (d.name like concat('%',#{activityName},'%') and t.tagert_type = 'building') or (tn.news_name like concat('%',#{activityName},'%') and t.tagert_type = 'news')
|
190
|
|
- or (tha.title like concat( '%', #{activityName}, '%' ) and t.tagert_type = 'help') or (tsa.activity_name like concat('%',#{activityName},'%') and t.tagert_type = 'group') or (tbd.title like concat('%',#{activityName},'%') and t.tagert_type = 'activity')
|
|
189
|
+ (b.name like concat('%',#{activityName},'%') and t.target_type = 'h5_share')or (d.name like concat('%',#{activityName},'%') and t.target_type = 'building_share') or (tn.news_name like concat('%',#{activityName},'%') and t.target_type = 'news_share')
|
|
190
|
+ or (tha.title like concat( '%', #{activityName}, '%' ) and t.target_type = 'help_share') or (tsa.activity_name like concat('%',#{activityName},'%') and t.target_type = 'group_share') or (tbd.title like concat('%',#{activityName},'%') and t.target_type = 'dynamic_share')
|
191
|
191
|
)
|
192
|
192
|
</if>
|
193
|
193
|
<if test="shareName !=null and shareName != ''">
|
|
@@ -213,7 +213,7 @@
|
213
|
213
|
</if>
|
214
|
214
|
order by t.create_date desc
|
215
|
215
|
) t
|
216
|
|
- group by t.person_id, t.target_id,t.event_type
|
|
216
|
+ group by t.person_id, t.target_id,t.event_type, t.share_person_id
|
217
|
217
|
order by t.visit_time desc
|
218
|
218
|
</select>
|
219
|
219
|
|