|
@@ -0,0 +1,327 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.ruoyi.ems.mapper.ElecConsumptionMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.ems.model.ElecConsumptionVO" id="ElecConsumptionResult">
|
|
|
+ <result property="areaCode" column="area_code"/>
|
|
|
+ <result property="areaName" column="area_name"/>
|
|
|
+ <result property="objCode" column="obj_code"/>
|
|
|
+ <result property="objName" column="obj_name"/>
|
|
|
+ <result property="objType" column="obj_type"/>
|
|
|
+ <result property="statisticDate" column="statistic_date"/>
|
|
|
+ <result property="statisticYear" column="statistic_year"/>
|
|
|
+ <result property="statisticMonth" column="statistic_month"/>
|
|
|
+ <result property="timeDimension" column="time_dimension"/>
|
|
|
+ <result property="totalElecQuantity" column="total_elec_quantity"/>
|
|
|
+ <result property="sharpPeakQuantity" column="sharp_peak_quantity"/>
|
|
|
+ <result property="peakQuantity" column="peak_quantity"/>
|
|
|
+ <result property="normalQuantity" column="normal_quantity"/>
|
|
|
+ <result property="valleyQuantity" column="valley_quantity"/>
|
|
|
+ <result property="totalElecCost" column="total_elec_cost"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- ==================== 区域用电统计查询(基于设备codes汇总,支持峰谷电) ==================== -->
|
|
|
+
|
|
|
+ <!-- 根据设备代码列表查询区域日用电统计 -->
|
|
|
+ <select id="selectAreaDailyElecConsumptionByDevices" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ a.area_code,
|
|
|
+ a.area_name as obj_name,
|
|
|
+ a.area_code as obj_code,
|
|
|
+ 1 as obj_type,
|
|
|
+ h.date as statistic_date,
|
|
|
+ 'DAY' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_elec_meter_h h
|
|
|
+ INNER JOIN adm_meter_boundary_rel rel ON rel.meter_device = h.device_code AND rel.meter_cls = 45 AND rel.obj_type = 1
|
|
|
+ INNER JOIN adm_area a ON a.area_code = rel.boundary_obj
|
|
|
+ WHERE h.device_code IN
|
|
|
+ <foreach collection="meterDevices" item="device" open="(" close=")" separator=",">
|
|
|
+ #{device}
|
|
|
+ </foreach>
|
|
|
+ <if test="queryMeter.startRecTime != null and queryMeter.startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{queryMeter.startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="queryMeter.endRecTime != null and queryMeter.endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{queryMeter.endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ GROUP BY a.area_code, a.area_name, h.date
|
|
|
+ ORDER BY h.date ${queryMeter.orderFlag}, a.area_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据设备代码列表查询区域月用电统计 -->
|
|
|
+ <select id="selectAreaMonthlyElecConsumptionByDevices" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ a.area_code,
|
|
|
+ a.area_name as obj_name,
|
|
|
+ a.area_code as obj_code,
|
|
|
+ 1 as obj_type,
|
|
|
+ DATE(CONCAT(DATE_FORMAT(h.date, '%Y-%m'), '-01')) as statistic_date,
|
|
|
+ DATE_FORMAT(h.date, '%Y-%m') as statistic_month,
|
|
|
+ 'MONTH' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_elec_meter_h h
|
|
|
+ INNER JOIN adm_meter_boundary_rel rel ON rel.meter_device = h.device_code AND rel.meter_cls = 45 AND rel.obj_type = 1
|
|
|
+ INNER JOIN adm_area a ON a.area_code = rel.boundary_obj
|
|
|
+ WHERE h.device_code IN
|
|
|
+ <foreach collection="meterDevices" item="device" open="(" close=")" separator=",">
|
|
|
+ #{device}
|
|
|
+ </foreach>
|
|
|
+ <if test="queryMeter.startRecTime != null and queryMeter.startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{queryMeter.startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="queryMeter.endRecTime != null and queryMeter.endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{queryMeter.endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ GROUP BY a.area_code, a.area_name, DATE_FORMAT(h.date, '%Y-%m')
|
|
|
+ ORDER BY DATE_FORMAT(h.date, '%Y-%m') ${queryMeter.orderFlag}, a.area_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据设备代码列表查询区域年用电统计 -->
|
|
|
+ <select id="selectAreaYearlyElecConsumptionByDevices" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ a.area_code,
|
|
|
+ a.area_name as obj_name,
|
|
|
+ a.area_code as obj_code,
|
|
|
+ 1 as obj_type,
|
|
|
+ DATE(CONCAT(YEAR(h.date), '-01-01')) as statistic_date,
|
|
|
+ YEAR(h.date) as statistic_year,
|
|
|
+ 'YEAR' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_elec_meter_h h
|
|
|
+ INNER JOIN adm_meter_boundary_rel rel ON rel.meter_device = h.device_code AND rel.meter_cls = 45 AND rel.obj_type = 1
|
|
|
+ INNER JOIN adm_area a ON a.area_code = rel.boundary_obj
|
|
|
+ WHERE h.device_code IN
|
|
|
+ <foreach collection="meterDevices" item="device" open="(" close=")" separator=",">
|
|
|
+ #{device}
|
|
|
+ </foreach>
|
|
|
+ <if test="queryMeter.startRecTime != null and queryMeter.startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{queryMeter.startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="queryMeter.endRecTime != null and queryMeter.endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{queryMeter.endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ GROUP BY a.area_code, a.area_name, YEAR(h.date)
|
|
|
+ ORDER BY YEAR(h.date) ${queryMeter.orderFlag}, a.area_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据设备代码列表查询区域用电汇总 -->
|
|
|
+ <select id="selectAreaElecConsumptionSummaryByDevices" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ 'TOTAL' as area_code,
|
|
|
+ '总计' as obj_name,
|
|
|
+ 'TOTAL' as obj_code,
|
|
|
+ 1 as obj_type,
|
|
|
+ 'SUMMARY' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost
|
|
|
+ FROM adm_elec_meter_h h
|
|
|
+ WHERE h.device_code IN
|
|
|
+ <foreach collection="meterDevices" item="device" open="(" close=")" separator=",">
|
|
|
+ #{device}
|
|
|
+ </foreach>
|
|
|
+ <if test="queryMeter.startRecTime != null and queryMeter.startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{queryMeter.startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="queryMeter.endRecTime != null and queryMeter.endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{queryMeter.endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- ==================== 设施用电统计查询 ==================== -->
|
|
|
+
|
|
|
+ <!-- 查询设施日用电统计 -->
|
|
|
+ <select id="selectFacsDailyElecConsumption" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ f.ref_area as area_code,
|
|
|
+ f.facs_name as obj_name,
|
|
|
+ f.facs_code as obj_code,
|
|
|
+ 2 as obj_type,
|
|
|
+ h.date as statistic_date,
|
|
|
+ 'DAY' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_ems_facs f
|
|
|
+ LEFT JOIN adm_meter_boundary_rel rel ON rel.obj_type = 2 AND rel.boundary_obj = f.facs_code
|
|
|
+ LEFT JOIN adm_elec_meter_h h ON h.device_code = rel.meter_device AND rel.meter_cls = 45
|
|
|
+ <where>
|
|
|
+ <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
|
|
|
+ AND f.ref_area = #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != '' and objCode != '-1'">
|
|
|
+ AND f.facs_code = #{objCode}
|
|
|
+ </if>
|
|
|
+ <if test="facsCategory != null and facsCategory != ''">
|
|
|
+ AND f.facs_category = #{facsCategory}
|
|
|
+ </if>
|
|
|
+ <if test="startRecTime != null and startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="endRecTime != null and endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ AND f.enable = 1
|
|
|
+ </where>
|
|
|
+ GROUP BY f.facs_code, f.facs_name, f.ref_area, h.date
|
|
|
+ ORDER BY h.date ${orderFlag}, f.facs_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询设施月用电统计 -->
|
|
|
+ <select id="selectFacsMonthlyElecConsumption" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ f.ref_area as area_code,
|
|
|
+ f.facs_name as obj_name,
|
|
|
+ f.facs_code as obj_code,
|
|
|
+ 2 as obj_type,
|
|
|
+ DATE(CONCAT(DATE_FORMAT(h.date, '%Y-%m'), '-01')) as statistic_date,
|
|
|
+ DATE_FORMAT(h.date, '%Y-%m') as statistic_month,
|
|
|
+ 'MONTH' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_ems_facs f
|
|
|
+ LEFT JOIN adm_meter_boundary_rel rel ON rel.obj_type = 2 AND rel.boundary_obj = f.facs_code
|
|
|
+ LEFT JOIN adm_elec_meter_h h ON h.device_code = rel.meter_device AND rel.meter_cls = 45
|
|
|
+ <where>
|
|
|
+ <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
|
|
|
+ AND f.ref_area = #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != '' and objCode != '-1'">
|
|
|
+ AND f.facs_code = #{objCode}
|
|
|
+ </if>
|
|
|
+ <if test="facsCategory != null and facsCategory != ''">
|
|
|
+ AND f.facs_category = #{facsCategory}
|
|
|
+ </if>
|
|
|
+ <if test="startRecTime != null and startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="endRecTime != null and endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ AND f.enable = 1
|
|
|
+ </where>
|
|
|
+ GROUP BY f.facs_code, f.facs_name, f.ref_area, DATE_FORMAT(h.date, '%Y-%m')
|
|
|
+ ORDER BY DATE_FORMAT(h.date, '%Y-%m') ${orderFlag}, f.facs_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询设施年用电统计 -->
|
|
|
+ <select id="selectFacsYearlyElecConsumption" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ f.ref_area as area_code,
|
|
|
+ f.facs_name as obj_name,
|
|
|
+ f.facs_code as obj_code,
|
|
|
+ 2 as obj_type,
|
|
|
+ DATE(CONCAT(YEAR(h.date), '-01-01')) as statistic_date,
|
|
|
+ YEAR(h.date) as statistic_year,
|
|
|
+ 'YEAR' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost,
|
|
|
+ NOW() as create_time
|
|
|
+ FROM adm_ems_facs f
|
|
|
+ LEFT JOIN adm_meter_boundary_rel rel ON rel.obj_type = 2 AND rel.boundary_obj = f.facs_code
|
|
|
+ LEFT JOIN adm_elec_meter_h h ON h.device_code = rel.meter_device AND rel.meter_cls = 45
|
|
|
+ <where>
|
|
|
+ <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
|
|
|
+ AND f.ref_area = #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != '' and objCode != '-1'">
|
|
|
+ AND f.facs_code = #{objCode}
|
|
|
+ </if>
|
|
|
+ <if test="facsCategory != null and facsCategory != ''">
|
|
|
+ AND f.facs_category = #{facsCategory}
|
|
|
+ </if>
|
|
|
+ <if test="startRecTime != null and startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="endRecTime != null and endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ AND f.enable = 1
|
|
|
+ </where>
|
|
|
+ GROUP BY f.facs_code, f.facs_name, f.ref_area, YEAR(h.date)
|
|
|
+ ORDER BY YEAR(h.date) ${orderFlag}, f.facs_code
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询设施用电统计汇总 -->
|
|
|
+ <select id="selectFacsElecConsumptionSummary" parameterType="com.ruoyi.ems.model.QueryMeter" resultMap="ElecConsumptionResult">
|
|
|
+ SELECT
|
|
|
+ COALESCE(#{areaCode}, '0') as area_code,
|
|
|
+ '总计' as obj_name,
|
|
|
+ 'TOTAL' as obj_code,
|
|
|
+ 2 as obj_type,
|
|
|
+ 'SUMMARY' as time_dimension,
|
|
|
+ ROUND(SUM(COALESCE(h.elec_quantity, 0)), 2) as total_elec_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 2 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as sharp_peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as peak_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = 0 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as normal_quantity,
|
|
|
+ ROUND(SUM(CASE WHEN h.meter_type = -1 THEN COALESCE(h.elec_quantity, 0) ELSE 0 END), 2) as valley_quantity,
|
|
|
+ ROUND(SUM(COALESCE(h.use_elec_cost, 0)), 2) as total_elec_cost
|
|
|
+ FROM adm_ems_facs f
|
|
|
+ LEFT JOIN adm_meter_boundary_rel rel ON rel.obj_type = 2 AND rel.boundary_obj = f.facs_code
|
|
|
+ LEFT JOIN adm_elec_meter_h h ON h.device_code = rel.meter_device AND rel.meter_cls = 45
|
|
|
+ <where>
|
|
|
+ <if test="areaCode != null and areaCode != '' and areaCode != '-1'">
|
|
|
+ AND f.ref_area = #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="facsCategory != null and facsCategory != ''">
|
|
|
+ AND f.facs_category = #{facsCategory}
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != '' and objCode != '-1'">
|
|
|
+ AND f.facs_code = #{objCode}
|
|
|
+ </if>
|
|
|
+ <if test="startRecTime != null and startRecTime != ''">
|
|
|
+ AND h.date >= DATE(#{startRecTime})
|
|
|
+ </if>
|
|
|
+ <if test="endRecTime != null and endRecTime != ''">
|
|
|
+ AND h.date <= DATE(#{endRecTime})
|
|
|
+ </if>
|
|
|
+ AND h.date IS NOT NULL
|
|
|
+ AND f.enable = 1
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+</mapper>
|