java110
2023-05-30 f14c50cb0036d3ddd655ce4e34732ba396a836c4
java110-db/src/main/resources/mapper/report/ReportOrderStatisticsServiceDaoImplMapper.xml
@@ -179,4 +179,48 @@
        and t.status_cd = '0'
    </select>
    <select id="getOwnerReserveGoodsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
            select t.owner_id,t.name,t.link,count(1) from building_owner t
            left join building_owner bom on t.owner_id = bom.owner_id and bom.status_cd = '0'
            left join reserve_goods_order rgo on (bom.link = rgo.person_tel or t.link = rgo.person_tel) and rgo.status_cd = '0'
            where t.owner_type_cd = '1001'
            and t.community_id = #{communityId}
            and t.create_time &gt; #{startDate}
            and t.create_time &lt; #{endDate}
            <if test="name !=null and name != ''">
                and t.name like concat('%',#{name},'%')
            </if>
            <if test="link !=null and link != ''">
                and t.link= #{link}
            </if>
            and t.status_cd = '0'
            group by t.owner_id,t.name,t.link
            HAVING count(1) > 0
        ) a
    </select>
    <select id="getOwnerReserveGoods" parameterType="Map" resultType="Map">
        select t.owner_id ownerId,t.name,t.link,count(1) frequency
        from building_owner t
        left join building_owner bom on t.owner_id = bom.owner_id and bom.status_cd = '0'
        left join reserve_goods_order rgo on (bom.link = rgo.person_tel or t.link = rgo.person_tel) and rgo.status_cd = '0'
        where t.owner_type_cd = '1001'
        and t.community_id = #{communityId}
        and t.create_time &gt; #{startDate}
        and t.create_time &lt; #{endDate}
        <if test="name !=null and name != ''">
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="link !=null and link != ''">
            and t.link= #{link}
        </if>
        and t.status_cd = '0'
        group by t.owner_id,t.name,t.link
        HAVING count(1) > 0
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
</mapper>