|
@@ -407,6 +407,12 @@
|
407
|
407
|
AND a.realty_consultant IS NOT NULL
|
408
|
408
|
AND a.realty_consultant != ''
|
409
|
409
|
AND a.org_id = #{orgId}
|
|
410
|
+ <if test="startDate != null">
|
|
411
|
+ and TO_DAYS(a.create_date) >= TO_DAYS(#{startDate})
|
|
412
|
+ </if>
|
|
413
|
+ <if test="endDate != null">
|
|
414
|
+ and TO_DAYS(a.create_date) <= TO_DAYS(#{endDate})
|
|
415
|
+ </if>
|
410
|
416
|
GROUP BY
|
411
|
417
|
a.building_id
|
412
|
418
|
) aa ON aa.building_id = t.building_id
|
|
@@ -425,6 +431,12 @@
|
425
|
431
|
AND b.org_id = #{orgId}
|
426
|
432
|
AND IFNULL( b.person_type, '' ) IN ( 'estate agent', 'customer' )
|
427
|
433
|
AND b.person_id NOT IN ( SELECT c.person_id FROM ta_recommend_customer c WHERE c.org_id = 84 AND person_id IS NOT NULL AND person_id != '' )
|
|
434
|
+ <if test="startDate != null">
|
|
435
|
+ and TO_DAYS(b.create_date) >= TO_DAYS(#{startDate})
|
|
436
|
+ </if>
|
|
437
|
+ <if test="endDate != null">
|
|
438
|
+ and TO_DAYS(b.create_date) <= TO_DAYS(#{endDate})
|
|
439
|
+ </if>
|
428
|
440
|
GROUP BY
|
429
|
441
|
b.person_id
|
430
|
442
|
) bb
|
|
@@ -439,11 +451,29 @@
|
439
|
451
|
ta_uv u
|
440
|
452
|
WHERE
|
441
|
453
|
u.tagert_type = 'project'
|
|
454
|
+ <if test="startDate != null">
|
|
455
|
+ and TO_DAYS(u.create_date) >= TO_DAYS(#{startDate})
|
|
456
|
+ </if>
|
|
457
|
+ <if test="endDate != null">
|
|
458
|
+ and TO_DAYS(u.create_date) <= TO_DAYS(#{endDate})
|
|
459
|
+ </if>
|
442
|
460
|
GROUP BY
|
443
|
461
|
u.be_uv
|
444
|
462
|
) uu ON uu.building_id = t.building_id
|
445
|
463
|
WHERE
|
446
|
464
|
t.org_id = #{orgId}
|
|
465
|
+ <if test="personBuildingList != null and personBuildingList.size > 0">
|
|
466
|
+ AND t.building_id in
|
|
467
|
+ <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
|
|
468
|
+ #{personBuilding.buildingId}
|
|
469
|
+ </foreach>
|
|
470
|
+ </if>
|
|
471
|
+ <if test="buildingId != null and buildingId != '' ">
|
|
472
|
+ AND t.building_id = #{buildingId}
|
|
473
|
+ </if>
|
|
474
|
+ <if test="sortField != null and sortField != ''">
|
|
475
|
+ ORDER BY ${sortField} ${orderType}
|
|
476
|
+ </if>
|
447
|
477
|
</select>
|
448
|
478
|
|
449
|
479
|
</mapper>
|