| | |
| | | select count(t1.checkId) as times,COALESCE(sum(t1.hours),0) as hours from |
| | | ((select real_service_time as hours,solve_unit_id as checkId from com_act_neighbor_circle where order_type = 1 AND is_del = 2 and solve_status = 4 and solve_unit_id = #{checkUnitId} and order_time between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')) |
| | | union all |
| | | (select duration as hours,check_unit_id as checkId from com_act_activity where check_unit_id = #{checkUnitId} and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')) |
| | | (select duration as hours,check_unit_id as checkId from com_act_activity where check_unit_id = #{checkUnitId} AND `status` = 5 and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')) |
| | | union all |
| | | (SELECT a.duration AS hours,s.check_unit_id AS checkId FROM com_act_activity a LEFT JOIN com_act_act_regist s ON a.id = s.activity_id |
| | | WHERE s.end_time IS NOT NULL AND s.check_unit_id = #{checkUnitId} AND s.start_time BETWEEN concat( #{date}, '-01-01 00:00:00' ) AND concat( #{date}, '-12-31 23:59:59' ) GROUP BY a.id) |
| | |
| | | com_act_activity |
| | | WHERE |
| | | check_unit_id = #{checkUnitId} |
| | | AND `status` = 5 |
| | | AND publish_at BETWEEN concat( #{date}, '-01-01 00:00:00' ) |
| | | AND concat( #{date}, '-12-31 23:59:59' ) |
| | | ) temp ORDER BY serviceAt |
| | |
| | | com_act_activity |
| | | WHERE |
| | | check_unit_id = #{checkUnitId} |
| | | AND `status` = 5 |
| | | AND publish_at BETWEEN concat( #{date}, '-01-01 00:00:00' ) |
| | | AND concat( #{date}, '-12-31 23:59:59' ) |
| | | ORDER BY serviceAt |
| | |
| | | <if test="serviceType == null"> |
| | | SELECT * FROM ( |
| | | SELECT |
| | | canc.id AS serviceId, |
| | | canc.order_time AS serviceAt, |
| | | canc.real_service_time AS serviceTime, |
| | | 1 AS serviceType |
| | |
| | | <if test="checkUnitId != null"> |
| | | UNION ALL |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 2 AS serviceType |
| | |
| | | </if> |
| | | UNION ALL |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 3 AS serviceType |
| | |
| | | a.id |
| | | UNION ALL |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 4 AS serviceType |
| | |
| | | </if> |
| | | <if test="serviceType == 1"> |
| | | SELECT |
| | | canc.id AS serviceId, |
| | | canc.order_time AS serviceAt, |
| | | canc.real_service_time AS serviceTime, |
| | | 1 AS serviceType |
| | |
| | | </if> |
| | | <if test="serviceType == 2 and checkUnitId != null"> |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 2 AS serviceType |
| | |
| | | </if> |
| | | <if test="serviceType == 3"> |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 3 AS serviceType |
| | |
| | | </if> |
| | | <if test="serviceType == 4"> |
| | | SELECT |
| | | a.id AS serviceId, |
| | | a.publish_at AS serviceAt, |
| | | a.duration AS serviceTime, |
| | | 4 AS serviceType |
| | |
| | | unitId,caa.community_id as communityId,cpcu.belong_to |
| | | FROM com_act_activity as caa |
| | | left join com_pb_check_unit as cpcu on caa.check_unit_id=cpcu.id |
| | | where caa.check_unit_id<>'' |
| | | where caa.`status` = 5 AND caa.check_unit_id<>'' |
| | | and caa.type=5 |
| | | <if test="beginTime != null"> |
| | | and caa.publish_at between #{beginTime} and #{endTime} |
| | |
| | | resultType="com.panzhihua.common.model.vos.neighbor.PartyMemberAnalysisVO"> |
| | | SELECT count(id) as serviceTimes, sum(duration) as serviceTime, unitId, |
| | | communityId, memberId, memberName, belongUnit, belongCommunity, belong_to FROM ( |
| | | SELECT caa.id, caa.duration, cpcu.check_unit_id as unitId, cpcu.community_id as communityId, su.user_id as |
| | | SELECT caa.id, caa.duration, cpcu.id as unitId, cpcu.community_id as communityId, su.user_id as |
| | | memberId, su.name as memberName, su.relation_name as belongUnit, ca.name as belongCommunity, cpcu.belong_to |
| | | FROM `com_act_activity` as caa |
| | | left join com_act_act_regist as caar on caa.id=caar.activity_id |
| | |
| | | and cpcu.community_id=#{communityId} |
| | | </if> |
| | | <if test="unitId != null"> |
| | | and cpcu.check_unit_id=#{unitId} |
| | | and cpcu.id=#{unitId} |
| | | </if> |
| | | GROUP BY caa.id,caar.user_id |
| | | ) temp GROUP BY memberId |