|
@@ -451,8 +451,10 @@
|
451
|
451
|
u.be_uv AS building_id
|
452
|
452
|
FROM
|
453
|
453
|
ta_uv u
|
454
|
|
- WHERE
|
|
454
|
+ LEFT JOIN ta_person p ON u.person_id = p.person_id
|
|
455
|
+ WHERE
|
455
|
456
|
u.tagert_type = 'project'
|
|
457
|
+ AND p.org_id = #{orgId}
|
456
|
458
|
<if test="startDate != null">
|
457
|
459
|
and TO_DAYS(u.create_date) >= TO_DAYS(#{startDate})
|
458
|
460
|
</if>
|
|
@@ -631,21 +633,23 @@
|
631
|
633
|
LEFT JOIN (
|
632
|
634
|
SELECT
|
633
|
635
|
count( * ) AS uv_num,
|
634
|
|
- be_uv AS building_id,
|
635
|
|
- DATE_FORMAT( create_date, '%Y-%m-%d' ) AS create_date
|
|
636
|
+ u.be_uv AS building_id,
|
|
637
|
+ DATE_FORMAT( u.create_date, '%Y-%m-%d' ) AS create_date
|
636
|
638
|
FROM
|
637
|
|
- ta_uv
|
|
639
|
+ ta_uv u
|
|
640
|
+ LEFT JOIN ta_person p ON u.person_id = p.person_id
|
638
|
641
|
WHERE
|
639
|
642
|
tagert_type = 'project'
|
640
|
|
- AND be_uv = #{buildingId}
|
|
643
|
+ AND p.org_id = #{orgId}
|
|
644
|
+ AND u.be_uv = #{buildingId}
|
641
|
645
|
<if test="startDate != null">
|
642
|
|
- and TO_DAYS(create_date) >= TO_DAYS(#{startDate})
|
|
646
|
+ and TO_DAYS(u.create_date) >= TO_DAYS(#{startDate})
|
643
|
647
|
</if>
|
644
|
648
|
<if test="endDate != null">
|
645
|
|
- and TO_DAYS(create_date) <= TO_DAYS(#{endDate})
|
|
649
|
+ and TO_DAYS(u.create_date) <= TO_DAYS(#{endDate})
|
646
|
650
|
</if>
|
647
|
651
|
GROUP BY
|
648
|
|
- DATE_FORMAT( create_date, '%Y-%m-%d' )
|
|
652
|
+ DATE_FORMAT( u.create_date, '%Y-%m-%d' )
|
649
|
653
|
) u ON t.date = u.create_date
|
650
|
654
|
ORDER BY create_date
|
651
|
655
|
</select>
|
|
@@ -714,27 +718,29 @@
|
714
|
718
|
LEFT JOIN (
|
715
|
719
|
SELECT
|
716
|
720
|
count( * ) AS uv_num,
|
717
|
|
- be_uv AS building_id,
|
718
|
|
- DATE_FORMAT( create_date, '%Y-%m-%d' ) AS create_date
|
|
721
|
+ u.be_uv AS building_id,
|
|
722
|
+ DATE_FORMAT( u.create_date, '%Y-%m-%d' ) AS create_date
|
719
|
723
|
FROM
|
720
|
|
- ta_uv
|
|
724
|
+ ta_uv u
|
|
725
|
+ LEFT JOIN ta_person p ON u.person_id = p.person_id
|
721
|
726
|
WHERE
|
722
|
|
- tagert_type = 'project'
|
723
|
|
- AND be_uv = #{buildingId}
|
|
727
|
+ u.tagert_type = 'project'
|
|
728
|
+ AND p.org_id = #{orgId}
|
|
729
|
+ AND u.be_uv = #{buildingId}
|
724
|
730
|
<if test="startDate != null">
|
725
|
|
- and TO_DAYS(create_date) >= TO_DAYS(#{startDate})
|
|
731
|
+ and TO_DAYS(u.create_date) >= TO_DAYS(#{startDate})
|
726
|
732
|
</if>
|
727
|
733
|
<if test="endDate != null">
|
728
|
|
- and TO_DAYS(create_date) <= TO_DAYS(#{endDate})
|
|
734
|
+ and TO_DAYS(u.create_date) <= TO_DAYS(#{endDate})
|
729
|
735
|
</if>
|
730
|
736
|
GROUP BY
|
731
|
|
- DATE_FORMAT( create_date, '%Y-%m-%d' )
|
|
737
|
+ DATE_FORMAT( u.create_date, '%Y-%m-%d' )
|
732
|
738
|
) u ON t.date = u.create_date
|
733
|
739
|
ORDER BY
|
734
|
740
|
<if test="sortField != null and sortField != ''">
|
735
|
741
|
${sortField} ${orderType},
|
736
|
742
|
</if>
|
737
|
|
- create_date
|
|
743
|
+ create_date desc
|
738
|
744
|
</select>
|
739
|
745
|
|
740
|
746
|
</mapper>
|