id,order_sn,request_user_id,user_event_status,request_user_event_des,event_succeed,current_event_process_result,request_user_name,request_user_tel,event_category,type,submit_date,appointment_time,request_user_community,center_id,center_tel,specialist_org,specialist_level,specialist_id,specialist_name,specialist_tel,specialist_accept_time,revoke_type,event_process_status,current_process_type,current_org_id,current_org_name,current_process_user_id,current_process_user_name,revoke_des,event_result,report_superior,result,result_date,urgent,difficult,urgent_dell,invalid,major,request_user_response,create_by,create_at,update_by,update_at,report_level,report_community,report_street,report_center,report_hall,is_end
SELECT
FROM com_sanshuo_event_info
event_process_status !=9
AND app_id=#{comEvent.appId}
AND request_user_community=#{comEvent.communityId}
AND ( order_sn like concat ('%',#{comEvent.keyword},'%') or request_user_tel like concat ('%',#{comEvent.keyword},'%') or current_org_name like concat ('%',#{comEvent.keyword},'%'))
AND create_at between DATE_FORMAT(#{comEvent.startTime},'%Y-%m-%d 00:00:00') and DATE_FORMAT(#{comEvent.endTime},'%Y-%m-%d 00:00:00')
AND create_by = #{comEvent.createBy}
AND event_category = #{comEvent.eventCategory}
AND event_process_status = #{comEvent.eventProcessStatus}
AND order_sn = #{comEvent.orderSn}
AND request_user_tel = #{comEvent.requestUserTel}
AND current_org_name = #{comEvent.currentOrgName}
AND request_user_id=#{comEvent.requestUserId}
AND specialist_id=#{comEvent.specialistId}
AND center_id=#{comEvent.centerId}
AND request_user_community=#{comEvent.communityId}
AND request_user_community in
#{id}
AND type=4 OR current_process_type=4
AND center_id=#{comEvent.searchId} AND current_process_type in(1,5)
AND request_user_community in (select community_id from com_act where street_id=#{comEvent.searchId})
AND current_process_type in (3,5)
AND request_user_community=#{comEvent.searchId} AND current_process_type in (2,5)
order by create_at desc
SELECT
FROM com_sanshuo_event_info
event_process_status !=9
AND app_id=#{comEvent.appId}
AND id in
#{id}
AND request_user_community=#{comEvent.communityId}
AND ( order_sn = #{comEvent.keyword} or request_user_tel =#{comEvent.keyword} or current_org_name=#{comEvent.keyword})
AND create_by = #{comEvent.createBy}
AND event_category = #{comEvent.eventCategory}
AND event_process_status = #{comEvent.eventProcessStatus}
AND order_sn = #{comEvent.orderSn}
AND request_user_tel = #{comEvent.requestUserTel}
AND current_org_name = #{comEvent.currentOrgName}
order by create_at desc
select event_id from com_sanshuo_expert_event where expert_id=#{expertId} and (status=0 or status=1)
SELECT
FROM com_sanshuo_event_info
where request_user_id=#{requestUserId}
select event_process_status as status ,count(1) as sum
from com_sanshuo_event_info
event_process_status not in (9)
AND app_id=#{comEvent.appId}
AND request_user_id=#{comEvent.requestUserId}
AND id in
#{id}
AND request_user_community=#{comEvent.communityId}
AND center_id=#{comEvent.centerId}
AND request_user_community=#{comEvent.communityId}
AND request_user_community in
#{id}
AND current_process_type=4
AND center_id=#{comEvent.searchId} AND current_process_type in(1,5)
AND request_user_community in (select community_id from com_act where street_id=#{comEvent.searchId})
AND current_process_type in (3,5)
AND request_user_community=#{comEvent.searchId} AND current_process_type in (2,5)
group by event_process_status
select count(id) as sum
from com_sanshuo_event_info
event_process_status not in (9)
AND app_id=#{comEvent.appId}
AND request_user_id=#{comEvent.requestUserId}
AND id in
#{id}
AND request_user_community=#{comEvent.communityId}
AND center_id=#{comEvent.centerId}
AND request_user_community=#{comEvent.communityId}
AND request_user_community in
#{id}
AND current_process_type=4
AND center_id=#{comEvent.searchId} AND current_process_type in(1,5)
AND request_user_community in (select community_id from com_act where street_id=#{comEvent.searchId})
AND current_process_type in (3,5)
AND request_user_community=#{comEvent.searchId} AND current_process_type in (2,5)
SELECT
(SELECT count(id) FROM com_sanshuo_event_info
where event_process_status in (2,3,5,6)
AND user_event_status not in(3,4)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as accept,
(SELECT count(id) FROM com_sanshuo_event_info
where is_end <> 1
AND user_event_status not in(3,4)
AND event_process_status not in (1,9)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as accepting,
(SELECT count(id) FROM com_sanshuo_event_info
where event_process_status = 6
AND is_end=1
AND user_event_status not in(3)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as accepted,
(SELECT count(t.id) FROM com_sanshuo_event_info as t
left join com_sanshuo_event_transfer_record as t1
on t.id=t1.event_id
where t.event_process_status in (6,7)
AND t.user_event_status not in(3,4)
AND t1.event_status=7
AND app_id='wx0cef797390444b75'
AND t.current_process_type in (1,5)
AND t.center_id is not null
AND t.center_id=#{dto.id}
AND t.current_process_type=3
AND t.request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND t.current_process_type in(2,5)
AND t.center_id is null
AND t.request_user_community=#{dto.id}
AND t.current_process_type=4
) as expirences,
(select count(id) FROM com_sanshuo_event_info
where event_result=2
AND user_event_status not in(3,4)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as success,
(select count(id) FROM com_sanshuo_event_info
where event_result=1
AND is_end=1
AND user_event_status not in(3,4)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as fail,
(select count(id) from com_sanshuo_event_info WHERE
create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
AND event_process_status not in (8)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as monthIncrease,
(select count(id) from com_sanshuo_event_info WHERE
create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
AND event_process_status not in (8)
AND event_process_status = 6
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
) as monthFinish
FROM com_sanshuo_event_info limit 1
SELECT COUNT(id) FROM com_sanshuo_event_info
WHERE create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
AND event_process_status not in (9)
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
SELECT COUNT(id) FROM com_sanshuo_event_info
WHERE create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
AND event_process_status=6
AND is_end=1
AND app_id='wx0cef797390444b75'
AND current_process_type in (1,5)
AND center_id is not null
AND center_id=#{dto.id}
AND current_process_type=3
AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
AND current_process_type in(2,5)
AND center_id is null
AND request_user_community=#{dto.id}
AND current_process_type=4
select count(id) as count,type from com_sanshuo_event_info
where event_process_status not in(7,8,9)
AND app_id='wx0cef797390444b75'
group by type
having type not in (5)
select count(id) as count,level as type from com_sanshuo_expert where app_id='wx0cef797390444b75'
group by level
select count(t.id) as count,t1.name from com_sanshuo_event_info t
left join com_mediate_type t1 on t.event_category=t1.id
where t.event_process_status not in(7,8,9)
AND t.app_id='wx0cef797390444b75'
group by t.event_category
select image_url from sys_user where user_id = #{userId}
insert into com_sanshuo_expert_event values(#{eventId},#{expertId},#{status})
select count(t.id) from com_sanshuo_event_info t
left join com_sanshuo_expert t1 on t.specialist_id=t1.id
where t.event_process_status not in (9)
and t1.level=2
AND t.current_process_type=5
AND t.app_id='wx0cef797390444b75'
update com_sanshuo_expert_event set status = 2
where event_id=#{eventId} and expert_id=#{expertId} and status=0