puhanshu
2022-08-16 16da1624dc8b754785df02b07c8d2e5b187ea51d
服务范围优化
2个文件已修改
27 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -359,7 +359,12 @@
        LEFT JOIN com_act ca ON a.community_id = ca.community_id
        WHERE 1 = 1
        <if test ="comActActivityVO.communityId != null and comActActivityVO.communityId != 0">
            AND a.community_id = ${comActActivityVO.communityId}
            <if test="comActActivityVO.checkUnitId != null">
                AND (a.community_id = ${comActActivityVO.communityId} OR a.check_unit_id = #{comActActivityVO.checkUnitId})
            </if>
            <if test="comActActivityVO.checkUnitId == null">
                AND a.community_id = ${comActActivityVO.communityId}
            </if>
        </if>
        <if test ="comActActivityVO.phone != null and comActActivityVO.phone != &quot;&quot;">
            AND a.phone = ${comActActivityVO.phone}
@@ -367,7 +372,7 @@
        <if test ="comActActivityVO.areaCode != null">
            AND ca.area_code = ${comActActivityVO.areaCode}
        </if>
        <if test ="comActActivityVO.checkUnitId != null">
        <if test ="comActActivityVO.checkUnitId != null and comActActivityVO.communityId == null">
            AND a.check_unit_id = #{comActActivityVO.checkUnitId}
        </if>
        <if test="comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != &quot;&quot;">
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml
@@ -249,7 +249,7 @@
         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)
@@ -314,6 +314,7 @@
                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
@@ -362,6 +363,7 @@
            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
@@ -372,6 +374,7 @@
        <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
@@ -388,6 +391,7 @@
            <if test="checkUnitId != null">
                UNION ALL
                SELECT
                a.id AS serviceId,
                a.publish_at AS serviceAt,
                a.duration AS serviceTime,
                2 AS serviceType
@@ -406,6 +410,7 @@
            </if>
            UNION ALL
            SELECT
            a.id AS serviceId,
            a.publish_at AS serviceAt,
            a.duration AS serviceTime,
            3 AS serviceType
@@ -423,6 +428,7 @@
            a.id
            UNION ALL
            SELECT
            a.id AS serviceId,
            a.publish_at AS serviceAt,
            a.duration AS serviceTime,
            4 AS serviceType
@@ -443,6 +449,7 @@
        </if>
        <if test="serviceType == 1">
            SELECT
            canc.id AS serviceId,
            canc.order_time AS serviceAt,
            canc.real_service_time AS serviceTime,
            1 AS serviceType
@@ -460,6 +467,7 @@
        </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
@@ -478,6 +486,7 @@
        </if>
        <if test="serviceType == 3">
            SELECT
            a.id AS serviceId,
            a.publish_at AS serviceAt,
            a.duration AS serviceTime,
            3 AS serviceType
@@ -496,6 +505,7 @@
        </if>
        <if test="serviceType == 4">
            SELECT
            a.id AS serviceId,
            a.publish_at AS serviceAt,
            a.duration AS serviceTime,
            4 AS serviceType
@@ -567,7 +577,7 @@
            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&lt;>''
            where caa.`status` = 5 AND caa.check_unit_id&lt;>''
            and caa.type=5
            <if test="beginTime != null">
                and caa.publish_at between #{beginTime} and #{endTime}
@@ -605,7 +615,7 @@
            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
@@ -623,7 +633,7 @@
                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