2023-06-07 15:07:16 优化完善能耗统计查询接口!

master
魔神煜修罗皇 2 years ago
parent e65d1e51d6
commit 92b34ccba2
  1. 3
      psdc-business/src/main/java/com/psdc/mapper/PsdcStatisticsDayMapper.java
  2. 3
      psdc-business/src/main/java/com/psdc/mapper/PsdcStatisticsMonthMapper.java
  3. 3
      psdc-business/src/main/java/com/psdc/mapper/PsdcStatisticsYearMapper.java
  4. 6
      psdc-business/src/main/resources/mapper/business/PsdcStatisticsDayMapper.xml
  5. 6
      psdc-business/src/main/resources/mapper/business/PsdcStatisticsMonthMapper.xml
  6. 6
      psdc-business/src/main/resources/mapper/business/PsdcStatisticsYearMapper.xml

@ -25,8 +25,7 @@ public interface PsdcStatisticsDayMapper{
/** /**
* 分页查询指定行数据 * 分页查询指定行数据
* *
* @param psdcStatisticsDay 查询条件 * @param energyStatisticsRequest 查询条件
* @param pageable 分页对象
* @return 对象列表 * @return 对象列表
*/ */
List<PsdcStatisticsDay> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest); List<PsdcStatisticsDay> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest);

@ -26,8 +26,7 @@ public interface PsdcStatisticsMonthMapper{
/** /**
* 分页查询指定行数据 * 分页查询指定行数据
* *
* @param psdcStatisticsMonth 查询条件 * @param energyStatisticsRequest 查询条件
* @param pageable 分页对象
* @return 对象列表 * @return 对象列表
*/ */
List<PsdcStatisticsMonth> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest); List<PsdcStatisticsMonth> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest);

@ -26,8 +26,7 @@ public interface PsdcStatisticsYearMapper{
/** /**
* 分页查询指定行数据 * 分页查询指定行数据
* *
* @param psdcStatisticsYear 查询条件 * @param energyStatisticsRequest 查询条件
* @param pageable 分页对象
* @return 对象列表 * @return 对象列表
*/ */
List<PsdcStatisticsYear> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest); List<PsdcStatisticsYear> queryAllByLimit(EnergyStatisticsRequest energyStatisticsRequest);

@ -47,13 +47,13 @@
From psdc_statistics_day psd Left Join psdc_device pd On pd.device_id = psd.device_id From psdc_statistics_day psd Left Join psdc_device pd On pd.device_id = psd.device_id
<where> <where>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId} And psd.device_id = #{deviceId}
</if> </if>
<if test="startTime != null and startTime != ''"><!-- 开始时间检索 --> <if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
AND date_format(day_date,'%Y-%m-%d') &gt;= #{startTime} And date_format(day_date,'%Y-%m-%d') &gt;= #{startTime}
</if> </if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(day_date,'%Y-%m-%d') &lt;= #{endTime} And date_format(day_date,'%Y-%m-%d') &lt;= #{endTime}
</if> </if>
</where> </where>
</select> </select>

@ -87,15 +87,15 @@
From psdc_statistics_month psm Left Join psdc_device pd On pd.device_id = psm.device_id From psdc_statistics_month psm Left Join psdc_device pd On pd.device_id = psm.device_id
<where> <where>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId} And psm.device_id = #{deviceId}
</if> </if>
<!-- 开始时间检索 --> <!-- 开始时间检索 -->
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND date_format(month_date,'%Y-%m') &gt;= #{startTime} And date_format(month_date,'%Y-%m') &gt;= #{startTime}
</if> </if>
<!-- 结束时间检索 --> <!-- 结束时间检索 -->
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND date_format(month_date,'%Y-%m') &lt;= #{endTime} And date_format(month_date,'%Y-%m') &lt;= #{endTime}
</if> </if>
</where> </where>
</select> </select>

@ -35,15 +35,15 @@
From psdc_statistics_year psy Left Join psdc_device pd On pd.device_id = psy.device_id From psdc_statistics_year psy Left Join psdc_device pd On pd.device_id = psy.device_id
<where> <where>
<if test="deviceId != null and deviceId != ''"> <if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId} And psy.device_id = #{deviceId}
</if> </if>
<!-- 开始时间检索 --> <!-- 开始时间检索 -->
<if test="startTime != null and startTime != ''"> <if test="startTime != null and startTime != ''">
AND date_format(year_date,'%Y') &gt;= #{startTime} And date_format(year_date,'%Y') &gt;= #{startTime}
</if> </if>
<!-- 结束时间检索 --> <!-- 结束时间检索 -->
<if test="endTime != null and endTime != ''"> <if test="endTime != null and endTime != ''">
AND date_format(year_date,'%Y') &lt;= #{endTime} And date_format(year_date,'%Y') &lt;= #{endTime}
</if> </if>
</where> </where>

Loading…
Cancel
Save