<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
<mapper namespace="com.panzhihua.service_grid.dao.EventMapper">
|
|
<resultMap id="baseResult" type="com.panzhihua.service_grid.model.dos.EventDO">
|
<result property="id" column="id"/>
|
<result property="orderSn" column="order_sn"/>
|
<result property="eventCategory" column="event_category"/>
|
<result property="gridMemberStreet" column="grid_member_street"/>
|
<result property="gridMemberCommunity" column="grid_member_community"/>
|
<result property="gridId" column="grid_id"/>
|
<result property="gridMemberId" column="grid_member_id"/>
|
<result property="gridMemberName" column="grid_member_name"/>
|
<result property="gridMemberTelephone" column="grid_member_telephone"/>
|
<result property="eventTitle" column="event_title"/>
|
<result property="propagandaType" column="propaganda_type"/>
|
<result property="propagandaTime" column="propaganda_time"/>
|
<result property="eventType" column="event_type"/>
|
<result property="eventDes" column="event_des"/>
|
<result property="propagandaObject" column="propaganda_object"/>
|
<result property="propagandaNum" column="propaganda_num"/>
|
<result property="communityProcess" column="community_process"/>
|
<result property="happenTime" column="happen_time"/>
|
<result property="happentAddress" column="happent_address"/>
|
<result property="happenAddress" column="happen_address"/>
|
<result property="happentLatLng" column="happent_lat_lng"/>
|
<result property="eventStatus" column="event_status"/>
|
<result property="eventProcessStatus" column="event_process_status"/>
|
<result property="processType" column="process_type"/>
|
<result property="processUserId" column="process_user_id"/>
|
<result property="processUserName" column="process_user_name"/>
|
<result property="processDate" column="process_date"/>
|
<result property="processDesc" column="process_desc"/>
|
<result property="eventResource" column="event_resource"/>
|
<result property="dangerLevel" column="danger_level"/>
|
<result property="redCard" column="red_card"/>
|
<result property="yellowCard" column="yellow_card"/>
|
<result property="invalid" column="invalid"/>
|
<result property="major" column="major"/>
|
<result property="deathsNumber" column="deaths_number"/>
|
<result property="injuriesNumber" column="injuries_number"/>
|
<result property="difficult" column="difficult"/>
|
<result property="urgent" column="urgent"/>
|
<result property="urgentDell" column="urgent_dell"/>
|
<result property="submitDate" column="submit_date"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createAt" column="create_at"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateAt" column="update_at"/>
|
<result property="eventClazz" column="event_clazz"/>
|
<result property="eventDealStatus" column="event_deal_status"/>
|
</resultMap>
|
|
<sql id="columns">
|
<![CDATA[
|
id,order_sn,event_category,grid_member_street,happen_address,grid_member_community,event_clazz,grid_id,grid_member_id,grid_member_name,grid_member_telephone,
|
event_title,propaganda_type,propaganda_time,event_type,event_des,propaganda_object,propaganda_num,community_process,happen_time,happent_address,happent_lat_lng,
|
event_status,event_process_status,process_type,process_user_id,process_user_name,process_date,process_desc,event_resource,danger_level,red_card,yellow_card,invalid,
|
major,deaths_number,injuries_number,difficult,urgent,urgent_dell,submit_date,create_by,create_at,update_by,update_at,event_deal_status
|
]]>
|
</sql>
|
|
|
<select id="findByPage" resultType="com.panzhihua.common.model.vos.grid.EventVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PageEventDTO">
|
SELECT <include refid="columns" />
|
FROM event
|
<where>
|
event_status != 3 AND event_category = 1
|
<if test="pageEventDTO.eventDealStatus!=null">
|
AND event_deal_status = #{pageEventDTO.eventDealStatus}
|
</if>
|
<if test="pageEventDTO.revokeType!=null">
|
AND ( revoke_type = #{pageEventDTO.revokeType} OR revoke_type is null )
|
</if>
|
<if test="pageEventDTO.id!=null">
|
AND id = #{pageEventDTO.id}
|
</if>
|
<if test="pageEventDTO.orderSn!=null">
|
AND order_sn = #{pageEventDTO.orderSn}
|
</if>
|
<if test="pageEventDTO.eventCategory!=null">
|
AND event_category = #{pageEventDTO.eventCategory}
|
</if>
|
<if test="pageEventDTO.gridMemberStreet!=null">
|
AND grid_member_street = #{pageEventDTO.gridMemberStreet}
|
</if>
|
<if test="pageEventDTO.gridMemberCommunity!=null">
|
AND grid_member_community = #{pageEventDTO.gridMemberCommunity}
|
</if>
|
<if test="pageEventDTO.gridId!=null">
|
AND grid_id = #{pageEventDTO.gridId}
|
</if>
|
<if test="pageEventDTO.gridMemberId!=null">
|
AND grid_member_id = #{pageEventDTO.gridMemberId}
|
</if>
|
<if test="pageEventDTO.gridMemberName!=null">
|
AND grid_member_name = #{pageEventDTO.gridMemberName}
|
</if>
|
<if test="pageEventDTO.gridMemberTelephone!=null">
|
AND grid_member_telephone = #{pageEventDTO.gridMemberTelephone}
|
</if>
|
<if test="pageEventDTO.eventTitle!=null">
|
AND event_title = #{pageEventDTO.eventTitle}
|
</if>
|
<if test="pageEventDTO.propagandaType!=null">
|
AND propaganda_type = #{pageEventDTO.propagandaType}
|
</if>
|
<if test="pageEventDTO.propagandaTimeBegin!=null">
|
AND propaganda_time <![CDATA[>=]]> #{pageEventDTO.propagandaTimeBegin}
|
</if>
|
<if test="pageEventDTO.propagandaTimeEnd!=null">
|
AND propaganda_time <![CDATA[<=]]> #{pageEventDTO.propagandaTimeEnd}
|
</if>
|
<if test="pageEventDTO.eventType!=null">
|
AND event_type = #{pageEventDTO.eventType}
|
</if>
|
<if test="pageEventDTO.eventDes!=null">
|
AND event_des = #{pageEventDTO.eventDes}
|
</if>
|
<if test="pageEventDTO.propagandaObject!=null">
|
AND propaganda_object = #{pageEventDTO.propagandaObject}
|
</if>
|
<if test="pageEventDTO.propagandaNum!=null">
|
AND propaganda_num = #{pageEventDTO.propagandaNum}
|
</if>
|
<if test="pageEventDTO.communityProcess!=null">
|
AND community_process = #{pageEventDTO.communityProcess}
|
</if>
|
<if test="pageEventDTO.happenTimeBegin!=null">
|
AND happen_time <![CDATA[>=]]> #{pageEventDTO.happenTimeBegin}
|
</if>
|
<if test="pageEventDTO.happenTimeEnd!=null">
|
AND happen_time <![CDATA[<=]]> #{pageEventDTO.happenTimeEnd}
|
</if>
|
<if test="pageEventDTO.happentAddress!=null">
|
AND happent_address = #{pageEventDTO.happentAddress}
|
</if>
|
<if test="pageEventDTO.happentLatLng!=null">
|
AND happent_lat_lng = #{pageEventDTO.happentLatLng}
|
</if>
|
<if test="pageEventDTO.eventStatus!=null">
|
AND event_status = #{pageEventDTO.eventStatus}
|
</if>
|
<if test="pageEventDTO.eventProcessStatus!=null">
|
AND event_process_status = #{pageEventDTO.eventProcessStatus}
|
</if>
|
<if test="pageEventDTO.processType!=null">
|
AND process_type = #{pageEventDTO.processType}
|
</if>
|
<if test="pageEventDTO.processUserId!=null">
|
AND process_user_id = #{pageEventDTO.processUserId}
|
</if>
|
<if test="pageEventDTO.processUserName!=null">
|
AND process_user_name = #{pageEventDTO.processUserName}
|
</if>
|
<if test="pageEventDTO.processDateBegin!=null">
|
AND process_date <![CDATA[>=]]> #{pageEventDTO.processDateBegin}
|
</if>
|
<if test="pageEventDTO.processDateEnd!=null">
|
AND process_date <![CDATA[<=]]> #{pageEventDTO.processDateEnd}
|
</if>
|
<if test="pageEventDTO.processDesc!=null">
|
AND process_desc = #{pageEventDTO.processDesc}
|
</if>
|
<if test="pageEventDTO.eventResource!=null">
|
AND event_resource = #{pageEventDTO.eventResource}
|
</if>
|
<if test="pageEventDTO.dangerLevel!=null">
|
AND danger_level = #{pageEventDTO.dangerLevel}
|
</if>
|
<if test="pageEventDTO.redCard!=null">
|
AND red_card = #{pageEventDTO.redCard}
|
</if>
|
<if test="pageEventDTO.yellowCard!=null">
|
AND yellow_card = #{pageEventDTO.yellowCard}
|
</if>
|
<if test="pageEventDTO.invalid!=null">
|
AND invalid = #{pageEventDTO.invalid}
|
</if>
|
<if test="pageEventDTO.major!=null">
|
AND major = #{pageEventDTO.major}
|
</if>
|
<if test="pageEventDTO.deathsNumber!=null">
|
AND deaths_number = #{pageEventDTO.deathsNumber}
|
</if>
|
<if test="pageEventDTO.injuriesNumber!=null">
|
AND injuries_number = #{pageEventDTO.injuriesNumber}
|
</if>
|
<if test="pageEventDTO.difficult!=null">
|
AND difficult = #{pageEventDTO.difficult}
|
</if>
|
<if test="pageEventDTO.urgent!=null">
|
AND urgent = #{pageEventDTO.urgent}
|
</if>
|
<if test="pageEventDTO.urgentDell!=null">
|
AND urgent_dell = #{pageEventDTO.urgentDell}
|
</if>
|
<if test="pageEventDTO.submitDateBegin!=null">
|
AND submit_date <![CDATA[>=]]> #{pageEventDTO.submitDateBegin}
|
</if>
|
<if test="pageEventDTO.submitDateEnd!=null">
|
AND submit_date <![CDATA[<=]]> #{pageEventDTO.submitDateEnd}
|
</if>
|
<if test="pageEventDTO.createBy!=null">
|
AND create_by = #{pageEventDTO.createBy}
|
</if>
|
<if test="pageEventDTO.createAtBegin!=null">
|
AND create_at <![CDATA[>=]]> #{pageEventDTO.createAtBegin}
|
</if>
|
<if test="pageEventDTO.createAtEnd!=null">
|
AND create_at <![CDATA[<=]]> #{pageEventDTO.createAtEnd}
|
</if>
|
<if test="pageEventDTO.updateBy!=null">
|
AND update_by = #{pageEventDTO.updateBy}
|
</if>
|
<if test="pageEventDTO.updateAtBegin!=null">
|
AND update_at <![CDATA[>=]]> #{pageEventDTO.updateAtBegin}
|
</if>
|
<if test="pageEventDTO.updateAtEnd!=null">
|
AND update_at <![CDATA[<=]]> #{pageEventDTO.updateAtEnd}
|
</if>
|
</where>
|
<if test="pageEventDTO.sortColumns!=null">
|
ORDER BY ${pageEventDTO.sortColumns} ${pageEventDTO.sortType}
|
</if>
|
</select>
|
<select id="findPublicityByPage" resultType="com.panzhihua.common.model.vos.grid.EventVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PagePublicityEventDTO">
|
SELECT
|
e.id,e.order_sn,e.event_category,e.grid_member_street,e.happen_address,e.grid_member_community,e.event_clazz,e.grid_id,e.grid_member_id,e.grid_member_name,e.grid_member_telephone,
|
e.event_title,e.propaganda_type,e.propaganda_time,e.event_type,e.event_des,e.propaganda_object,e.propaganda_num,e.community_process,e.happen_time,e.happent_address,e.happent_lat_lng,
|
e.event_status,e.event_process_status,e.process_type,e.process_user_id,e.process_user_name,e.process_date,e.process_desc,e.event_resource,e.danger_level,e.red_card,e.yellow_card,e.invalid,
|
e.major,e.deaths_number,e.injuries_number,e.difficult,e.urgent,e.urgent_dell,e.submit_date,e.create_by,e.create_at,e.update_by,e.update_at,e.event_deal_status
|
FROM
|
event e left join event_grid_data egd on e.grid_id = egd.id
|
<where>
|
e.event_status != 3 AND e.event_category = 2
|
<if test="pagePublicityEventDTO.communityId!=null">
|
AND egd.grid_community_id = #{pagePublicityEventDTO.communityId}
|
</if>
|
|
<if test="pagePublicityEventDTO.revokeType!=null">
|
AND ( e.revoke_type = #{pagePublicityEventDTO.revokeType} OR e.revoke_type is null )
|
</if>
|
<if test="pagePublicityEventDTO.eventDealStatus!=null">
|
AND e.event_deal_status = #{pagePublicityEventDTO.eventDealStatus}
|
</if>
|
<if test="pagePublicityEventDTO.id!=null">
|
AND e.id = #{pagePublicityEventDTO.id}
|
</if>
|
<if test="pagePublicityEventDTO.orderSn!=null">
|
AND e.order_sn = #{pagePublicityEventDTO.orderSn}
|
</if>
|
<if test="pagePublicityEventDTO.eventCategory!=null">
|
AND e.event_category = #{pagePublicityEventDTO.eventCategory}
|
</if>
|
<if test="pagePublicityEventDTO.gridMemberStreet!=null">
|
AND e.grid_member_street = #{pagePublicityEventDTO.gridMemberStreet}
|
</if>
|
<if test="pagePublicityEventDTO.gridMemberCommunity!=null">
|
AND e.grid_member_community = #{pagePublicityEventDTO.gridMemberCommunity}
|
</if>
|
<if test="pagePublicityEventDTO.gridId!=null">
|
AND e.grid_id = #{pagePublicityEventDTO.gridId}
|
</if>
|
<if test="pagePublicityEventDTO.gridMemberId!=null">
|
AND e.grid_member_id = #{pagePublicityEventDTO.gridMemberId}
|
</if>
|
<if test="pagePublicityEventDTO.gridMemberName!=null">
|
AND e.grid_member_name = #{pagePublicityEventDTO.gridMemberName}
|
</if>
|
<if test="pagePublicityEventDTO.gridMemberTelephone!=null">
|
AND e.grid_member_telephone = #{pagePublicityEventDTO.gridMemberTelephone}
|
</if>
|
<if test="pagePublicityEventDTO.eventTitle!=null">
|
AND e.event_title = #{pagePublicityEventDTO.eventTitle}
|
</if>
|
<if test="pagePublicityEventDTO.propagandaType!=null">
|
AND e.propaganda_type = #{pagePublicityEventDTO.propagandaType}
|
</if>
|
<if test="pagePublicityEventDTO.propagandaTimeBegin!=null">
|
AND e.propaganda_time <![CDATA[>=]]> #{pagePublicityEventDTO.propagandaTimeBegin}
|
</if>
|
<if test="pagePublicityEventDTO.propagandaTimeEnd!=null">
|
AND e.propaganda_time <![CDATA[<=]]> #{pagePublicityEventDTO.propagandaTimeEnd}
|
</if>
|
<if test="pagePublicityEventDTO.eventDes!=null">
|
AND e.event_des = #{pagePublicityEventDTO.eventDes}
|
</if>
|
<if test="pagePublicityEventDTO.propagandaObject!=null">
|
AND e.propaganda_object = #{pagePublicityEventDTO.propagandaObject}
|
</if>
|
<if test="pagePublicityEventDTO.propagandaNum!=null">
|
AND e.propaganda_num = #{pagePublicityEventDTO.propagandaNum}
|
</if>
|
<if test="pagePublicityEventDTO.communityProcess!=null">
|
AND e.community_process = #{pagePublicityEventDTO.communityProcess}
|
</if>
|
<if test="pagePublicityEventDTO.happenTimeBegin!=null">
|
AND e.happen_time <![CDATA[>=]]> #{pagePublicityEventDTO.happenTimeBegin}
|
</if>
|
<if test="pagePublicityEventDTO.happenTimeEnd!=null">
|
AND e.happen_time <![CDATA[<=]]> #{pagePublicityEventDTO.happenTimeEnd}
|
</if>
|
<if test="pagePublicityEventDTO.happentAddress!=null">
|
AND e.happent_address = #{pagePublicityEventDTO.happentAddress}
|
</if>
|
<if test="pagePublicityEventDTO.happentLatLng!=null">
|
AND e.happent_lat_lng = #{pagePublicityEventDTO.happentLatLng}
|
</if>
|
<if test="pagePublicityEventDTO.eventStatus!=null">
|
AND e.event_status = #{pagePublicityEventDTO.eventStatus}
|
</if>
|
<if test="pagePublicityEventDTO.eventProcessStatus!=null">
|
AND e.event_process_status = #{pagePublicityEventDTO.eventProcessStatus}
|
</if>
|
<if test="pagePublicityEventDTO.processType!=null">
|
AND e.process_type = #{pagePublicityEventDTO.processType}
|
</if>
|
<if test="pagePublicityEventDTO.processUserId!=null">
|
AND e.process_user_id = #{pagePublicityEventDTO.processUserId}
|
</if>
|
<if test="pagePublicityEventDTO.processUserName!=null">
|
AND e.process_user_name = #{pagePublicityEventDTO.processUserName}
|
</if>
|
<if test="pagePublicityEventDTO.processDateBegin!=null">
|
AND e.process_date <![CDATA[>=]]> #{pagePublicityEventDTO.processDateBegin}
|
</if>
|
<if test="pagePublicityEventDTO.processDateEnd!=null">
|
AND e.process_date <![CDATA[<=]]> #{pagePublicityEventDTO.processDateEnd}
|
</if>
|
<if test="pagePublicityEventDTO.processDesc!=null">
|
AND e.process_desc = #{pagePublicityEventDTO.processDesc}
|
</if>
|
<if test="pagePublicityEventDTO.eventResource!=null">
|
AND e.event_resource = #{pagePublicityEventDTO.eventResource}
|
</if>
|
<if test="pagePublicityEventDTO.dangerLevel!=null">
|
AND e.danger_level = #{pagePublicityEventDTO.dangerLevel}
|
</if>
|
<if test="pagePublicityEventDTO.redCard!=null">
|
AND e.red_card = #{pagePublicityEventDTO.redCard}
|
</if>
|
<if test="pagePublicityEventDTO.yellowCard!=null">
|
AND e.yellow_card = #{pagePublicityEventDTO.yellowCard}
|
</if>
|
<if test="pagePublicityEventDTO.invalid!=null">
|
AND e.invalid = #{pagePublicityEventDTO.invalid}
|
</if>
|
<if test="pagePublicityEventDTO.major!=null">
|
AND e.major = #{pagePublicityEventDTO.major}
|
</if>
|
<if test="pagePublicityEventDTO.deathsNumber!=null">
|
AND e.deaths_number = #{pagePublicityEventDTO.deathsNumber}
|
</if>
|
<if test="pagePublicityEventDTO.injuriesNumber!=null">
|
AND e.injuries_number = #{pagePublicityEventDTO.injuriesNumber}
|
</if>
|
<if test="pagePublicityEventDTO.difficult!=null">
|
AND e.difficult = #{pagePublicityEventDTO.difficult}
|
</if>
|
<if test="pagePublicityEventDTO.urgent!=null">
|
AND e.urgent = #{pagePublicityEventDTO.urgent}
|
</if>
|
<if test="pagePublicityEventDTO.urgentDell!=null">
|
AND e.urgent_dell = #{pagePublicityEventDTO.urgentDell}
|
</if>
|
<if test="pagePublicityEventDTO.submitDateBegin!=null">
|
AND e.submit_date <![CDATA[>=]]> #{pagePublicityEventDTO.submitDateBegin}
|
</if>
|
<if test="pagePublicityEventDTO.submitDateEnd!=null">
|
AND e.submit_date <![CDATA[<=]]> #{pagePublicityEventDTO.submitDateEnd}
|
</if>
|
<if test="pagePublicityEventDTO.createBy!=null">
|
AND e.create_by = #{pagePublicityEventDTO.createBy}
|
</if>
|
<if test="pagePublicityEventDTO.createAtBegin!=null">
|
AND e.create_at <![CDATA[>=]]> #{pagePublicityEventDTO.createAtBegin}
|
</if>
|
<if test="pagePublicityEventDTO.createAtEnd!=null">
|
AND e.create_at <![CDATA[<=]]> #{pagePublicityEventDTO.createAtEnd}
|
</if>
|
<if test="pagePublicityEventDTO.updateBy!=null">
|
AND e.update_by = #{pagePublicityEventDTO.updateBy}
|
</if>
|
<if test="pagePublicityEventDTO.updateAtBegin!=null">
|
AND e.update_at <![CDATA[>=]]> #{pagePublicityEventDTO.updateAtBegin}
|
</if>
|
<if test="pagePublicityEventDTO.updateAtEnd!=null">
|
AND e.update_at <![CDATA[<=]]> #{pagePublicityEventDTO.updateAtEnd}
|
</if>
|
</where>
|
<if test="pagePublicityEventDTO.sortColumns!=null">
|
ORDER BY e.${pagePublicityEventDTO.sortColumns} ${pagePublicityEventDTO.sortType}
|
</if>
|
</select>
|
|
<select id="getEventByGridId" resultType="com.panzhihua.common.model.vos.grid.ComMapGridEventVO">
|
SELECT
|
id,
|
event_type AS type,
|
event_des AS eventTitle,
|
happent_address AS happentAddress,
|
happen_address AS happenAddress,
|
happent_lat_lng AS happentLatLng
|
FROM
|
`event`
|
WHERE
|
( event_category = 1 OR event_category = 2 )
|
AND event_process_status = 1
|
AND event_status = 2
|
AND grid_id = #{gridId}
|
AND process_type = 1 UNION ALL
|
SELECT
|
id,
|
IFNULL( NULL, 7 ) AS type,
|
event_des AS eventTitle,
|
happent_address AS happentAddress,
|
happen_address AS happenAddress,
|
happent_lat_lng AS happentLatLng
|
FROM
|
event_visiting_tasks
|
WHERE
|
event_status = 1
|
AND dell_type = 1
|
AND grid_id = #{gridId}
|
</select>
|
|
<select id="getGridMemberImageUrl" resultType="String">
|
select image_url from sys_user where user_id = #{gridMemberId}
|
</select>
|
<select id="findToManageByPage" resultType="com.panzhihua.common.model.vos.grid.EventVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PageEventManageDTO">
|
SELECT
|
e.id,e.order_sn,e.event_category,e.grid_member_street,e.happen_address,e.grid_member_community,e.event_clazz,e.grid_id,e.grid_member_id,e.grid_member_name,e.grid_member_telephone,
|
e.event_title,e.propaganda_type,e.propaganda_time,e.event_type,e.event_des,e.propaganda_object,e.propaganda_num,e.community_process,e.happen_time,e.happent_address,e.happent_lat_lng,
|
e.event_status,e.event_process_status,e.process_type,e.process_user_id,e.process_user_name,e.process_date,e.process_desc,e.event_resource,e.danger_level,e.red_card,e.yellow_card,e.invalid,
|
e.major,e.deaths_number,e.injuries_number,e.difficult,e.urgent,e.urgent_dell,e.submit_date,e.create_by,e.create_at,e.update_by,e.update_at,e.event_deal_status,egd.grid_name
|
FROM
|
event e left join event_grid_data egd on e.grid_id = egd.id
|
<where>
|
e.event_status != 3 AND e.event_category = 1
|
<if test="pageEventManageDTO.communityId!=null">
|
AND egd.grid_community_id = #{pageEventManageDTO.communityId}
|
</if>
|
<if test='pageEventManageDTO.keyWord != null and pageEventManageDTO.keyWord != ""'>
|
AND (
|
e.grid_member_name like concat('%', #{pageEventManageDTO.keyWord},'%') OR
|
e.event_title like concat('%', #{pageEventManageDTO.keyWord},'%') OR
|
e.happen_address like concat('%', #{pageEventManageDTO.keyWord},'%') OR
|
e.order_sn like concat('%', #{pageEventManageDTO.keyWord},'%')
|
)
|
</if>
|
<if test="pageEventManageDTO.revokeType!=null">
|
AND ( e.revoke_type = #{pageEventManageDTO.revokeType} OR e.revoke_type is null )
|
</if>
|
<if test="pageEventManageDTO.eventDealStatus!=null">
|
AND e.event_deal_status = #{pageEventManageDTO.eventDealStatus}
|
</if>
|
<if test="pageEventManageDTO.communityProcess!=null">
|
AND e.community_process = #{pageEventManageDTO.communityProcess}
|
</if>
|
<if test="pageEventManageDTO.eventType!=null">
|
AND e.event_type = #{pageEventManageDTO.eventType}
|
</if>
|
<if test="pageEventManageDTO.dangerLevel!=null">
|
AND e.danger_level = #{pageEventManageDTO.dangerLevel}
|
</if>
|
<if test="pageEventManageDTO.redCard!=null">
|
AND e.red_card = #{pageEventManageDTO.redCard}
|
</if>
|
<if test="pageEventManageDTO.yellowCard!=null">
|
AND e.yellow_card = #{pageEventManageDTO.yellowCard}
|
</if>
|
<if test="pageEventManageDTO.urgent!=null">
|
AND e.urgent = #{pageEventManageDTO.urgent}
|
</if>
|
<if test="pageEventManageDTO.major!=null">
|
AND e.major = #{pageEventManageDTO.major}
|
</if>
|
<if test="pageEventManageDTO.invalid!=null">
|
AND e.invalid = #{pageEventManageDTO.invalid}
|
</if>
|
</where>
|
<if test="pageEventManageDTO.sortColumns!=null">
|
ORDER BY e.${pageEventManageDTO.sortColumns} ${pageEventManageDTO.sortType}
|
</if>
|
</select>
|
|
<select id="findCommunityPublicityByPage" resultType="com.panzhihua.common.model.vos.grid.EventVO"
|
parameterType="com.panzhihua.common.model.dtos.grid.PagePublicityEventCommunityDTO">
|
SELECT
|
e.id,e.order_sn,e.event_category,e.grid_member_street,e.happen_address,e.grid_member_community,e.event_clazz,e.grid_id,e.grid_member_id,e.grid_member_name,e.grid_member_telephone,
|
e.event_title,e.propaganda_type,e.propaganda_time,e.event_type,e.event_des,e.propaganda_object,e.propaganda_num,e.community_process,e.happen_time,e.happent_address,e.happent_lat_lng,
|
e.event_status,e.event_process_status,e.process_type,e.process_user_id,e.process_user_name,e.process_date,e.process_desc,e.event_resource,e.danger_level,e.red_card,e.yellow_card,e.invalid,
|
e.major,e.deaths_number,e.injuries_number,e.difficult,e.urgent,e.urgent_dell,e.submit_date,e.create_by,e.create_at,e.update_by,e.update_at,e.event_deal_status, egd.grid_name
|
FROM
|
event e left join event_grid_data egd on e.grid_id = egd.id
|
<where>
|
e.event_status != 3 AND e.event_category = 2
|
<if test='pagePublicityEventCommunityDTO.keyWord != null and pagePublicityEventCommunityDTO.keyWord != ""'>
|
AND (
|
e.grid_member_name like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
|
e.event_title like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
|
e.happen_address like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%') OR
|
e.order_sn like concat('%', #{pagePublicityEventCommunityDTO.keyWord},'%')
|
)
|
</if>
|
<if test="pagePublicityEventCommunityDTO.revokeType!=null">
|
AND ( e.revoke_type = #{pagePublicityEventCommunityDTO.revokeType} OR e.revoke_type is null )
|
</if>
|
<if test="pagePublicityEventCommunityDTO.communityId!=null">
|
AND egd.grid_community_id = #{pagePublicityEventCommunityDTO.communityId}
|
</if>
|
<if test="pagePublicityEventCommunityDTO.eventDealStatus!=null">
|
AND e.event_deal_status = #{pagePublicityEventCommunityDTO.eventDealStatus}
|
</if>
|
</where>
|
<if test="pagePublicityEventCommunityDTO.sortColumns!=null">
|
ORDER BY e.${pagePublicityEventCommunityDTO.sortColumns} ${pagePublicityEventCommunityDTO.sortType}
|
</if>
|
</select>
|
<select id="eventStatistics" resultType="com.panzhihua.common.model.vos.grid.EventStatisticsAllAdminVO">
|
SELECT
|
count( e.id ) AS eventTotal,(
|
SELECT
|
count( e.id )
|
FROM
|
`event` AS e
|
LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
|
WHERE
|
egd.grid_community_id = #{communityId}
|
AND e.event_status = 2
|
AND e.event_process_status = 2
|
) AS handleEventTotal,
|
(
|
SELECT
|
count( e.id )
|
FROM
|
`event` AS e
|
LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
|
WHERE
|
egd.grid_community_id = #{communityId}
|
AND e.event_category = 2
|
AND e.event_status = 2
|
) AS propagandaEducationTotal,
|
( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2 AND community_id = #{communityId} ) AS easyPhotoTotal
|
FROM
|
`event` AS e
|
LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
|
WHERE
|
egd.grid_community_id = #{communityId}
|
AND e.event_status = 2
|
</select>
|
|
<select id="getEventCountByGridIds" resultType="Integer">
|
select count(id) from event where grid_id in
|
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
|
#{item}
|
</foreach>
|
</select>
|
|
<select id="getGridEventStatisticsByApp" resultType="com.panzhihua.common.model.vos.grid.GridEventStatisticsVO">
|
SELECT
|
count( id ) AS todayNum,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_process_status = 2
|
AND create_at BETWEEN DATE_FORMAT( DATE_ADD( curdate(), INTERVAL - DAY ( curdate())+ 1 DAY ), '%Y-%m-%d %H:%i:%s' )
|
AND NOW()
|
<if test="gridId!=null">
|
AND grid_id = #{gridId}
|
</if>
|
) AS monthNum,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 2
|
AND event_status = 2
|
AND create_at BETWEEN DATE_FORMAT( CURDATE(), '%Y-%m-%d %H:%i:%s' )
|
AND NOW()
|
<if test="gridId!=null">
|
AND grid_id = #{gridId}
|
</if>
|
) AS todayEducationNum,
|
( SELECT count( id ) FROM `event` WHERE event_category = 2 AND event_status = 2 ) AS educationNum,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 6
|
AND event_status = 2
|
AND event_process_status = 2
|
AND create_at BETWEEN DATE_FORMAT( CURDATE(), '%Y-%m-%d %H:%i:%s' )
|
AND NOW()
|
<if test="gridId!=null">
|
AND grid_id = #{gridId}
|
</if>
|
) AS todaySpecialTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_status = 2 AND event_process_status = 2 ) AS specialTotal
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_process_status = 2
|
AND create_at BETWEEN DATE_FORMAT( CURDATE(), '%Y-%m-%d %H:%i:%s' )
|
AND NOW()
|
<if test="gridId!=null">
|
AND grid_id = #{gridId}
|
</if>
|
</select>
|
|
<select id="getGridEventDetailStatisticsByApp" parameterType="com.panzhihua.common.model.dtos.grid.GridEventStatisticsDTO"
|
resultType="com.panzhihua.common.model.vos.grid.GridEventStatisticsDetailVO">
|
SELECT
|
count( e.id ) AS eventTFTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 5
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventTFTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 3 AND event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventMDTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 3
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventMDTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 1 AND event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventZATotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 1
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventZATotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 4 AND event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventBWDTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 4
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventBWDTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 6 AND event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventTSTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 6
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventTSTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 1 AND event_type = 2 AND event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventGGTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
`event`
|
WHERE
|
event_category = 1
|
AND event_type = 2
|
AND event_process_status IN ( 1, 3 )
|
AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventGGTotal,
|
( SELECT count( id ) FROM `event` WHERE event_category = 2 AND event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventXCTotal,
|
( SELECT count( id ) FROM event_visiting_tasks WHERE event_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventZFTotal,
|
(
|
SELECT
|
count( id )
|
FROM
|
event_visiting_tasks
|
WHERE
|
event_status IN ( 1, 3 )
|
<if test="statisticsDTO.gridId!=null">
|
AND grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventZFTotal,
|
( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2 AND community_id = egd.grid_community_id
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS eventSSPTotal,
|
( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 1 AND community_id = egd.grid_community_id
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
) AS noEventSSPTotal
|
FROM
|
`event` AS e
|
LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
|
WHERE
|
e.event_category = 1
|
AND e.event_type = 5
|
AND e.event_process_status = 2
|
<if test="statisticsDTO.gridId!=null">
|
AND e.grid_id = #{statisticsDTO.gridId}
|
</if>
|
<if test='statisticsDTO.startTime != null and statisticsDTO.startTime != ""'>
|
AND e.create_at <![CDATA[ >= ]]> #{statisticsDTO.startTime}
|
</if>
|
<if test='statisticsDTO.endTime != null and statisticsDTO.endTime != ""'>
|
AND e.create_at <![CDATA[ <= ]]> #{statisticsDTO.endTime}
|
</if>
|
</select>
|
|
<select id="getUserBaseInfo" parameterType="java.lang.Long" resultType="java.util.Map">
|
select name,image_url from sys_user where user_id = #{gridMemberId}
|
</select>
|
|
<select id="getScreenEventList" parameterType="com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO"
|
resultType="com.panzhihua.common.model.vos.community.screen.event.EventListVO">
|
SELECT
|
e.id,
|
e.grid_member_id,
|
su.image_url,
|
su.nick_name AS userName,
|
e.create_at,
|
e.urgent,
|
e.danger_level,
|
e.major,
|
e.event_des,
|
e.event_category,
|
e.event_type,
|
e.event_clazz,
|
e.happen_address,
|
e.happent_lat_lng,
|
e.happent_address,
|
e.event_deal_status,
|
egd.grid_name
|
FROM
|
`event` AS e
|
LEFT JOIN sys_user AS su ON su.user_id = e.grid_member_id
|
LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
|
<where>
|
and event_status = 2
|
<if test='eventListDTO.communityId != null'>
|
and egd.grid_community_id = #{eventListDTO.communityId}
|
</if>
|
|
<if test='eventListDTO.startTime != null and eventListDTO.startTime != ""'>
|
and e.create_at <![CDATA[>=]]> #{eventListDTO.startTime}
|
</if>
|
|
<if test='eventListDTO.endTime != null and eventListDTO.endTime != ""'>
|
and e.create_at <![CDATA[<=]]> #{eventListDTO.endTime}
|
</if>
|
|
<if test='eventListDTO.gridId != null'>
|
and e.grid_id = #{eventListDTO.gridId}
|
</if>
|
|
<if test='eventListDTO.eventCategory != null'>
|
and e.event_category = #{eventListDTO.eventCategory}
|
</if>
|
|
<if test='eventListDTO.eventType != null'>
|
and e.event_type = #{eventListDTO.eventType}
|
</if>
|
|
<if test='eventListDTO.eventDealStatus != null'>
|
and e.event_deal_status = #{eventListDTO.eventDealStatus}
|
</if>
|
|
<if test='eventListDTO.urgent != null and eventListDTO.urgent != ""'>
|
and e.urgent = #{eventListDTO.urgent}
|
</if>
|
|
<if test='eventListDTO.major != null and eventListDTO.major != ""'>
|
and e.major = #{eventListDTO.major}
|
</if>
|
</where>
|
order by e.create_at desc
|
</select>
|
|
</mapper>
|