| | |
| | | ]]> |
| | | </sql> |
| | | |
| | | <select id="count" parameterType="java.lang.Long" resultType="java.util.Map"> |
| | | select count(id) as visit, |
| | | (select count(id) from event_visiting_tasks where grid_member_community = #{communityId} and event_status = 3) as visited, |
| | | (select count(id) from event_visiting_tasks where grid_member_community = #{communityId} and event_status = 6) as canceled |
| | | from event_visiting_tasks WHERE grid_member_community = #{communityId} and event_status = 1 |
| | | </select> |
| | | |
| | | <select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventVisitingTasksVO" |
| | | parameterType="com.panzhihua.common.model.dtos.grid.PageEventVisitingTasksDTO"> |
| | | SELECT <include refid="columns" /> |
| | | FROM event_visiting_tasks |
| | | <where> |
| | | <if test="pageEventVisitingTasksDTO.id!=null"> |
| | | AND id = #{pageEventVisitingTasksDTO.id} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberStreet!=null"> |
| | | AND grid_member_street = #{pageEventVisitingTasksDTO.gridMemberStreet} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberCommunity!=null"> |
| | | AND grid_member_community = #{pageEventVisitingTasksDTO.gridMemberCommunity} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMember!=null"> |
| | | AND grid_member = #{pageEventVisitingTasksDTO.gridMember} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMemberName!=null"> |
| | | AND grid_member_name = #{pageEventVisitingTasksDTO.gridMemberName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.gridMenberTele!=null"> |
| | | AND grid_menber_tele = #{pageEventVisitingTasksDTO.gridMenberTele} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterId!=null"> |
| | | AND visiter_id = #{pageEventVisitingTasksDTO.visiterId} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterName!=null"> |
| | | AND visiter_name = #{pageEventVisitingTasksDTO.visiterName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterSex!=null"> |
| | | AND visiter_sex = #{pageEventVisitingTasksDTO.visiterSex} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterTele!=null"> |
| | | AND visiter_tele = #{pageEventVisitingTasksDTO.visiterTele} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterAddress!=null"> |
| | | AND visiter_address = #{pageEventVisitingTasksDTO.visiterAddress} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.visiterType!=null"> |
| | | AND visiter_type = #{pageEventVisitingTasksDTO.visiterType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventTitle!=null"> |
| | | AND event_title = #{pageEventVisitingTasksDTO.eventTitle} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventType!=null"> |
| | | AND event_type = #{pageEventVisitingTasksDTO.eventType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventDes!=null"> |
| | | AND event_des = #{pageEventVisitingTasksDTO.eventDes} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.actOpara!=null"> |
| | | AND act_opara = #{pageEventVisitingTasksDTO.actOpara} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happenTimeBegin!=null"> |
| | | AND happen_time >= #{pageEventVisitingTasksDTO.happenTimeBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happenTimeEnd!=null"> |
| | | AND happen_time <= #{pageEventVisitingTasksDTO.happenTimeEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happentAddress!=null"> |
| | | AND happent_address = #{pageEventVisitingTasksDTO.happentAddress} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.happentLatLng!=null"> |
| | | AND happent_lat_lng = #{pageEventVisitingTasksDTO.happentLatLng} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.eventStatus!=null"> |
| | | AND event_status = #{pageEventVisitingTasksDTO.eventStatus} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.reporting!=null"> |
| | | AND reporting = #{pageEventVisitingTasksDTO.reporting} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellType!=null"> |
| | | AND dell_type = #{pageEventVisitingTasksDTO.dellType} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellUserId!=null"> |
| | | AND dell_user_id = #{pageEventVisitingTasksDTO.dellUserId} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellUserName!=null"> |
| | | AND dell_user_name = #{pageEventVisitingTasksDTO.dellUserName} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDateBegin!=null"> |
| | | AND dell_date >= #{pageEventVisitingTasksDTO.dellDateBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDateEnd!=null"> |
| | | AND dell_date <= #{pageEventVisitingTasksDTO.dellDateEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.dellDesc!=null"> |
| | | AND dell_desc = #{pageEventVisitingTasksDTO.dellDesc} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.invalid!=null"> |
| | | AND invalid = #{pageEventVisitingTasksDTO.invalid} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.urgent!=null"> |
| | | AND urgent = #{pageEventVisitingTasksDTO.urgent} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.urgentDell!=null"> |
| | | AND urgent_dell = #{pageEventVisitingTasksDTO.urgentDell} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.submitDateBegin!=null"> |
| | | AND submit_date >= #{pageEventVisitingTasksDTO.submitDateBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.submitDateEnd!=null"> |
| | | AND submit_date <= #{pageEventVisitingTasksDTO.submitDateEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.exception!=null"> |
| | | AND exception = #{pageEventVisitingTasksDTO.exception} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.tableContentJson!=null"> |
| | | AND table_content_json = #{pageEventVisitingTasksDTO.tableContentJson} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createBy!=null"> |
| | | AND create_by = #{pageEventVisitingTasksDTO.createBy} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createAtBegin!=null"> |
| | | AND create_at >= #{pageEventVisitingTasksDTO.createAtBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.createAtEnd!=null"> |
| | | AND create_at <= #{pageEventVisitingTasksDTO.createAtEnd} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateBy!=null"> |
| | | AND update_by = #{pageEventVisitingTasksDTO.updateBy} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateAtBegin!=null"> |
| | | AND update_at >= #{pageEventVisitingTasksDTO.updateAtBegin} |
| | | </if> |
| | | <if test="pageEventVisitingTasksDTO.updateAtEnd!=null"> |
| | | AND update_at <= #{pageEventVisitingTasksDTO.updateAtEnd} |
| | | </if> |
| | | </where> |
| | | <if test="pageEventVisitingTasksDTO.sortColumns!=null"> |
| | | ORDER BY ${pageEventVisitingTasksDTO.sortColumns} ${pageEventVisitingTasksDTO.sortType} |
| | | <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 |
| | | 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} |
| | | </if> |
| | | </select> |
| | | <if test="query.tag != null and query.tag != ''"> |
| | | p.label like concat('%',#{query.tag},'%') |
| | | </if> |
| | | <if test="query.isExp != null and query.isExp != ''"> |
| | | and vt.event_status = 7 |
| | | </if> |
| | | <if test="query.keyWord != null and query.keyWord != ''"> |
| | | and( |
| | | p.card_no_str like concat('%',#{query.keyWord},'%') or |
| | | vt.visiter_address like concat('%',#{query.keyWord},'%') |
| | | ) |
| | | </if> |
| | | order by vt.id desc |
| | | </select> |
| | | |
| | | <select id="list" parameterType="com.panzhihua.common.model.query.visit.EventTasksQuery" resultType="com.panzhihua.common.model.vos.visit.AppVisitTasksVO"> |
| | | SELECT vt.id,vt.visiter_name,vt.grid_member,vt.grid_member_name,vt.visiter_name,vt.visiter_tele,vt.dell_user_id,vt.dell_user_name,vt.submit_date,vt.event_status,vt.visiter_address,vt.happent_lat_lng, |
| | | p.card_no_str,p.name,REPLACE(p.label,',','#') |
| | | FROM event_visiting_tasks vt LEFT JOIN com_mng_population p ON vt.visiter_id = p.id WHERE 1=1 |
| | | <if test = "query.visiterId !=null"> |
| | | and vt.visiter_id = #{query.visiterId} |
| | | </if> |
| | | <if test = "query.communityId !=null"> |
| | | and vt.grid_member_community = #{query.communityId} |
| | | </if> |
| | | <if test = "query.status != null and query.status == 1"> |
| | | and (vt.event_status = 3 or vt.event_status = 7) |
| | | </if> |
| | | <if test = "query.status != null and query.status == 2"> |
| | | and (vt.event_status = 1 or vt.event_status = 2) |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="visitorList" parameterType="com.panzhihua.common.model.query.visit.EventVisitListQuery" resultType="com.panzhihua.common.model.vos.visit.EventVisitListVO"> |
| | | SELECT p.id,p.name,p.card_no_str,p.label, TIMESTAMPDIFF(YEAR, p.birthday, CURDATE()) AS age,p.sex,p.political_outlook,p.phone,p.census_register,phu.relation, |
| | | MAX(vt.id),vt.create_at |
| | | FROM com_mng_population p LEFT JOIN com_mng_population_house_user phu ON p.id = phu.popul_id |
| | | left join event_visiting_tasks vt ON p.id = vt.visiter_id |
| | | where 1=1 |
| | | <if test="sex != null"> |
| | | and p.sex = #{query.sex} |
| | | </if> |
| | | <if test="political != null"> |
| | | and p.political_outlook = #{query.political} |
| | | </if> |
| | | <if test="houseHolder != null"> |
| | | and phu.relation = #{query.houseHolder} |
| | | </if> |
| | | <if test="tag != null"> |
| | | and p.label like concat('%',#{query.tag},'%') |
| | | </if> |
| | | <if test="keyWord != null"> |
| | | and (p.card_no_str like concat(#{query.keyWord},'%') or |
| | | p.name like concat(#{query.keyWord},'%')) |
| | | </if> |
| | | GROUP BY p.id |
| | | </select> |
| | | |
| | | <select id="findUserByCommunityId" resultType="java.util.Map"> |
| | | SELECT u.user_id,u.name,u.phone,a.street_id FROM sys_user u |
| | | LEFT JOIN com_act a ON u.community_id = a.community_id |
| | | WHERE u.community_id = #{communityId} and u.type = #{type} limit 1 |
| | | </select> |
| | | |
| | | <select id="findUserByCommunityId" resultType="java.util.Map"> |
| | | SELECT u.user_id,u.name,u.phone,u.community_id,a.street_id, FROM sys_user u |
| | | LEFT JOIN com_act a ON u.community_id = a.community_id |
| | | WHERE u.id = #{id} |
| | | </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,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> |
| | | |
| | | <select id="countNoneComplete" resultType="java.lang.Integer"> |
| | | SELECT count(id) from event_visiting_tasks where visiter_id = #{id} and (event_status = 1 or event_status = 2 or event_status = 4) |
| | | </select> |
| | | |
| | | <update id="updateEventStatus"> |
| | | update event_visiting_tasks set event_status = #{status} where id = #{id} |
| | | </update> |
| | | |
| | | <update id="start"> |
| | | update event_visiting_tasks set event_status = #{eventStatus}, |
| | | grid_member_street = #{gridMemberStreet},grid_member_community=#{gridMemberCommunity},grid_member=#{gridMember},grid_member_name=#{gridMemberName},grid_menber_tele=#{gridMenberTele} |
| | | dell_user_id = #{gridMember} ,dell_user_name =#{gridMemberName}, dell_type = 1,dell_date = NOW() where id = #{id} |
| | | </update> |
| | | |
| | | <update id="cancel"> |
| | | update event_visiting_tasks set event_status = #{status},cancel_time = NOW() where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | <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=#{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> |