|
@@ -4,7 +4,15 @@
|
4
|
4
|
<select id="countShare" resultType="java.lang.Integer">
|
5
|
5
|
select count(1) from ta_share_count t
|
6
|
6
|
left join ta_person a on t.person_id = a.person_id
|
7
|
|
- where t.person_id = #{personId} and a.org_id = #{orgId}
|
|
7
|
+ where
|
|
8
|
+ t.person_id = #{personId}
|
|
9
|
+ and a.org_id = #{orgId}
|
|
10
|
+ <if test="startCreateDate != null and startCreateDate != ''">
|
|
11
|
+ and date_format(t.create_date,'%Y-%m-%d') >= date_format(#{startCreateDate},'%Y-%m-%d')
|
|
12
|
+ </if>
|
|
13
|
+ <if test="endCreateDate != null and endCreateDate != ''">
|
|
14
|
+ and date_format(t.create_date,'%Y-%m-%d') <= date_format(#{endCreateDate},'%Y-%m-%d')
|
|
15
|
+ </if>
|
8
|
16
|
</select>
|
9
|
17
|
<select id="selectListByParams" resultType="com.huiju.estateagents.entity.TaShareCount">
|
10
|
18
|
select
|
|
@@ -21,13 +29,13 @@
|
21
|
29
|
end as shareTitle,t.create_date
|
22
|
30
|
|
23
|
31
|
from ta_share_count t
|
24
|
|
- left join ta_building_dynamic a on t.be_share = a.dynamic_id
|
25
|
|
- left join ta_help_activity b on t.be_share = b.help_activity_id
|
26
|
|
- left join ta_share_activity c on t.be_share = c.share_id
|
27
|
|
- LEFT JOIN ta_drainage d on t.be_share = d.drainage_id
|
28
|
|
- left join ta_building e on t.be_share = e.building_id
|
29
|
|
- LEFT JOIN ta_news f on t.be_share = f.news_id
|
30
|
|
- left JOIN ta_person g on t.be_share = g.person_id
|
|
32
|
+ left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
|
|
33
|
+ left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
|
|
34
|
+ left join ta_share_activity c on t.be_share = c.share_id and t.tagert_type = 'group'
|
|
35
|
+ LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
|
|
36
|
+ left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
|
|
37
|
+ LEFT JOIN ta_news f on t.be_share = f.news_id and t.tagert_type = 'news'
|
|
38
|
+ left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
|
31
|
39
|
where t.person_id = #{personId}
|
32
|
40
|
<if test="shareType != null and shareType != ''">
|
33
|
41
|
and t.tagert_type = #{shareType}
|
|
@@ -66,14 +74,14 @@
|
66
|
74
|
FROM
|
67
|
75
|
ta_share_person_from t
|
68
|
76
|
|
69
|
|
- left join ta_building_dynamic g on t.target_id = g.dynamic_id
|
70
|
|
- left join ta_help_activity b on t.target_id = b.help_activity_id
|
71
|
|
- left join ta_share_activity c on t.target_id = c.group_activity_id
|
72
|
|
- LEFT JOIN ta_drainage d on t.target_id = d.drainage_id
|
73
|
|
- left join ta_building e on t.target_id = e.building_id
|
74
|
|
- LEFT JOIN ta_news f on t.target_id = f.news_id
|
|
77
|
+ left join ta_building_dynamic g on t.target_id = g.dynamic_id and t.target_type = 'dynamic_share'
|
|
78
|
+ left join ta_help_activity b on t.target_id = b.help_activity_id and t.target_type = 'help_share'
|
|
79
|
+ left join ta_share_activity c on t.target_id = c.group_activity_id and t.target_type = 'group_share'
|
|
80
|
+ LEFT JOIN ta_drainage d on t.target_id = d.drainage_id and t.target_type = 'h5_share'
|
|
81
|
+ left join ta_building e on t.target_id = e.building_id and t.target_type = 'building_share'
|
|
82
|
+ LEFT JOIN ta_news f on t.target_id = f.news_id and t.target_type = 'news_share'
|
75
|
83
|
|
76
|
|
- LEFT JOIN ta_person a ON t.person_id = a.person_id
|
|
84
|
+ LEFT JOIN ta_person a ON t.person_id = a.person_id and t.target_type = 'card_share'
|
77
|
85
|
WHERE
|
78
|
86
|
(t.share_person = (select user_id from ta_person where person_id = #{personId}) or t.share_person = #{personId})
|
79
|
87
|
AND t.org_id = #{orgId}
|