manailin
2021-06-27 76ed3735c23da4b7ef97b8a0f365facbc14f6903
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventVisitingTasksMapper.xml
@@ -57,13 +57,16 @@
   </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.dell_user_id,vt.dell_user_name,vt.submit_date,vt.cancel_time,vt.event_status,
      vt.event_status,p.card_no_str,p.label,u.name as creator
      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,p.label,u.name as creator,p.nation_code
      from event_visiting_tasks vt left join com_mng_population p on vt.visiter_id = p.id
      left join sys_user u on vt.create_by = u.user_id
      where vt.grid_member_community = #{query.communityId}
      <if test="query.status != null and query.status != ''">
         and vt.event_status = #{query.status}
      where p.act_id = #{query.communityId}
      <if test = "query.status == 1">
         and (vt.event_status = 3 or vt.event_status = 7)
      </if>
      <if test = "query.status == 2">
         and (vt.event_status = 1 or vt.event_status = 2)
      </if>
      <if test="query.tag != null and query.tag != ''">
         p.label like concat('%',#{query.tag},'%')
@@ -90,10 +93,10 @@
      <if test = "query.communityId !=null">
         and vt.grid_member_community = #{query.communityId}
      </if>
      <if test = "query.status != null and query.status == 1">
      <if test = "query.status == 1">
         and (vt.event_status = 3 or vt.event_status = 7)
      </if>
      <if test = "query.status != null and query.status == 2">
      <if test = "query.status == 2">
         and (vt.event_status = 1 or vt.event_status = 2)
      </if>
@@ -137,7 +140,7 @@
   </select>
   <select id="findPopulationById" resultType="java.util.Map">
      SELECT p.id,p.name,p.sex,p.phone,p.road,p.door_no,p.floor,p.unit_no,p.house_no,v.address,v.lng,v.lat FROM com_mng_population p
      SELECT p.id,p.name,p.sex,p.phone,p.road,p.door_no,p.floor,p.unit_no,p.house_no,v.address,v.lng,v.lat,p.label,p.out_or_local FROM com_mng_population p
      LEFT JOIN com_mng_village v ON p.village_id = v.village_id WHERE p.id = #{id}
   </select>
@@ -162,8 +165,13 @@
   <update id="complete" parameterType="com.panzhihua.common.model.vos.visit.EventVisitCompleteDTO">
      update event_visiting_tasks set event_status = #{eventStatus},address = #{address},address_remark=#{addressRemark},
         family_phone =#{familyPhone},family_source = #{familySource},lat_lng=#{lat_lng},dell_desc = #{dellDesc},exception = #{exception},submit_date = NOW()
         family_phone =#{familyPhone},family_source = #{familySource},lat_lng=#{latLng},dell_desc = #{dellDesc},table_content_json = #{option}
         exception = #{exception},submit_date = NOW()
      where id = #{id}
   </update>
   <select id="getLabel" parameterType="java.lang.Long" resultType="java.lang.String">
      select label from com_mng_population where id = #{id}
   </select>
</mapper>