罗元桥
2021-10-12 117e0945d9d7c94915c44e74c136d21a8fb17043
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventVisitingTasksMapper.xml
@@ -51,16 +51,15 @@
   <select id="count" parameterType="java.lang.Long" resultType="java.util.Map">
   select count(id) as visit,
      (select count(id) from event_visiting_tasks where event_status = 3) as visited,
      (select count(id) from event_visiting_tasks where event_status = 6) as canceled
      (select count(id) from event_visiting_tasks where event_status = 2) as visited,
      (select count(id) from event_visiting_tasks where event_status = 5) as canceled
      from event_visiting_tasks WHERE event_status = 1
   </select>
   <select id="findListByPage" parameterType="com.panzhihua.common.model.query.visit.EventTasksQuery" resultType="com.panzhihua.common.model.vos.visit.EventVisitingTasksVO">
      select vt.id,vt.create_at,vt.create_by,vt.visiter_id,vt.visiter_name,vt.visiter_tele,vt.visiter_sex,vt.visiter_address,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.event_status,
      TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,p.card_no_str,cmpct.label,u.name as creator,p.nation_code,vt.exception,vt.grid_member_name,vt.grid_menber_tele,egd.grid_name AS gridName
      TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,p.card_no_str,u.name as creator,p.nation_code,vt.exception,vt.grid_member_name,vt.grid_menber_tele,egd.grid_name AS gridName
      from event_visiting_tasks vt left join com_mng_population p on vt.visiter_id = p.id
      left join com_mng_population_community_tags AS cmpct on p.id = cmpct.population_id
      left join sys_user u on vt.create_by = u.user_id
      left join event_grid_data egd on egd.id = vt.grid_id
      where 1=1
@@ -89,10 +88,9 @@
         resultType="com.panzhihua.common.model.vos.visit.EventVisitingTasksVO">
      select vt.id,vt.create_at,vt.create_by,vt.visiter_id,vt.visiter_name,vt.visiter_tele,vt.visiter_sex
      ,vt.visiter_address,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.event_status,p.nation,p.political_outlook,
      TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,cmpct.label,u.name as creator,p.nation_code,p.card_no as cardNoStr
      TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,u.name as creator,p.nation_code,p.card_no as cardNoStr
      FROM event_visiting_tasks vt
      LEFT JOIN com_mng_population p ON p.id = vt.visiter_id
      left join com_mng_population_community_tags AS cmpct on p.id = cmpct.population_id
      LEFT JOIN sys_user u ON u.user_id = vt.create_by
      where 1=1
      <if test = "query.gridId != null">
@@ -209,5 +207,18 @@
      select label from com_mng_population where id = #{populationId}
   </select>
   <select id="getCommunityTagList" resultType="com.panzhihua.common.model.vos.community.ComMngPopulationCommunityTagsVo">
        SELECT
            cmpct.population_id,
            cmpct.community_id,
            cmpct.label,
            ca.`name` AS communityName
        FROM
            com_mng_population_community_tags AS cmpct
            LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
        WHERE
            cmpct.population_id = #{populationId}
    </select>
</mapper>