TaPersonFromRecordMapper.xml 940B

123456789101112131415161718192021222324
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.huiju.estateagents.mapper.TaPersonFromRecordMapper">
  4. <select id="getNowDataList" resultType="com.huiju.estateagents.statistic.entity.TsPersonFromStatistic">
  5. SELECT
  6. count( 1 ) AS from_num,
  7. t.scene_type,
  8. t.event_type,
  9. t.org_id,
  10. t.create_date,
  11. sum( IF ( p.photo IS NOT NULL OR p.tel IS NOT NULL, 1, 0 ) ) AS registered_num
  12. FROM
  13. ta_person_from_record t
  14. LEFT JOIN ta_person p ON t.person_id = p.person_id
  15. WHERE
  16. t.is_first_time = 1
  17. AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ), '%Y-%m-%d' )
  18. GROUP BY
  19. t.scene_type,
  20. t.event_type,
  21. t.org_id
  22. </select>
  23. </mapper>