ibtaits动态列查询显示

来源:互联网 发布:网络推手kim 编辑:程序博客网 时间:2024/06/05 04:38
 <select id="selMobileStationStandard" resultClass="eoms.power.model.MSStandardPowerModel"
            parameterClass="java.util.Map" remapResults="true">
        select to_char(firstday,'yyyy') as date_str,
        <isNotEmpty prepend="" property="cityPar">
          a.unit as city,
        </isNotEmpty>
        <isNotEmpty prepend="" property="stPar">
          a.pr_type as station_type,
        </isNotEmpty>
        <isNotEmpty prepend="" property="btPar">
          a.jz_lx as biz_type,
        </isNotEmpty>
        avg(b.degrees) as power_avg,
        max(b.degrees) as power_hig,
        min(b.degrees) as power_low,
        count(a.jz_name) as station_total
        from mobile_info_his a,copy_info_month b
        where a.datestamp =b.firstday
        and b.jz_type = '移动基站'
        and a.jz_name=b.jz_name(+)
        and a.unit=b.city(+)
        and a.county=b.county(+)
        <isNotEmpty property="year_par" prepend="and">
            to_number(to_char(a.datestamp,'yyyy'))in ($year_par$)
        </isNotEmpty>
        <isNotEmpty property="month_par" prepend="and">
            to_number(to_char(a.datestamp,'mm'))in ($month_par$)
        </isNotEmpty>
        <isNotEmpty property="season_par" prepend="and">
            to_number(to_char(a.datestamp,'q'))in ($season_par$)
        </isNotEmpty>
        <isNotEmpty property="city_par" prepend="and">
            a.unit in ($city_par$)
        </isNotEmpty>
        <isNotEmpty property="station_par" prepend="and">
            a.pr_type in ($station_par$)
        </isNotEmpty>
        <isNotEmpty property="biz_par" prepend="and">
            a.jz_lx in ($biz_par$)
        </isNotEmpty>
        group by to_char(firstday,'yyyy')
        <isNotEmpty prepend="" property="cityPar">
           ,a.unit
        </isNotEmpty>
        <isNotEmpty prepend="" property="stPar">
           ,a.jz_lx
        </isNotEmpty>
        <isNotEmpty prepend="" property="btPar">
           , a.pr_type
        </isNotEmpty>
        order by to_char(firstday,'yyyy')
        <isNotEmpty prepend="" property="cityPar">
           ,a.unit
        </isNotEmpty>
        <isNotEmpty prepend="" property="stPar">
           ,a.jz_lx
        </isNotEmpty>
        <isNotEmpty prepend="" property="btPar">
           , a.pr_type
        </isNotEmpty>


    </select>
0 0