|
|
|
@ -27,43 +27,51 @@ public interface EnergyAnalyzeMapper {
|
|
|
|
|
*/ |
|
|
|
|
@Select("<script>" + |
|
|
|
|
"select " + |
|
|
|
|
" dh.calc_value, " + |
|
|
|
|
" dh.device_num, " + |
|
|
|
|
" dm.remark, " + |
|
|
|
|
" dm.grade " + |
|
|
|
|
" dm.calc_value, " + |
|
|
|
|
" dm.device_num, " + |
|
|
|
|
" cpm.other_name as remark, " + |
|
|
|
|
" cpm.terminal_device_type as device_type " + |
|
|
|
|
"from " + |
|
|
|
|
" ${lastTableName} dh " + |
|
|
|
|
"join device_manage dm " + |
|
|
|
|
"on " + |
|
|
|
|
" dh.device_num = dm.device_num " + |
|
|
|
|
" ${lastTableName} dm " + |
|
|
|
|
"join collection_params_manage cpm " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.mt_num = dm.device_num " + |
|
|
|
|
" and cpm.mt_code = dm.device_code " + |
|
|
|
|
" and cpm.register_addr = dm.register_addr " + |
|
|
|
|
"join device_ledger dl " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.device_ledger_id = dl.id " + |
|
|
|
|
"where " + |
|
|
|
|
" dh.cur_time >= #{startTime} " + |
|
|
|
|
" and dh.cur_time <= #{endTime} " + |
|
|
|
|
" and dm.grade < 40 " + |
|
|
|
|
" and dm.device_type like '%meter%' " + |
|
|
|
|
" and dm.status = 0" + |
|
|
|
|
" dm.cur_time >= #{startTime} " + |
|
|
|
|
" and dm.cur_time <= #{endTime} " + |
|
|
|
|
" and cpm.grade = 40 " + |
|
|
|
|
" and cpm.is_use = 0 " + |
|
|
|
|
"<if test='paramType != null and paramType != \"\"'>" + |
|
|
|
|
" and dh.device_type = #{paramType}" + |
|
|
|
|
" and dl.device_type = #{paramType}" + |
|
|
|
|
"</if>" + |
|
|
|
|
"union all " + |
|
|
|
|
"select " + |
|
|
|
|
" dh.calc_value, " + |
|
|
|
|
" dh.device_num, " + |
|
|
|
|
" dm.remark, " + |
|
|
|
|
" dm.grade " + |
|
|
|
|
" dm.calc_value, " + |
|
|
|
|
" dm.device_num, " + |
|
|
|
|
" cpm.other_name as remark, " + |
|
|
|
|
" cpm.terminal_device_type as device_type " + |
|
|
|
|
"from " + |
|
|
|
|
" ${curTableName} dh " + |
|
|
|
|
"join device_manage dm " + |
|
|
|
|
"on " + |
|
|
|
|
" dh.device_num = dm.device_num " + |
|
|
|
|
" ${curTableName} dm " + |
|
|
|
|
"join collection_params_manage cpm " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.mt_num = dm.device_num " + |
|
|
|
|
" and cpm.mt_code = dm.device_code " + |
|
|
|
|
" and cpm.register_addr = dm.register_addr " + |
|
|
|
|
"join device_ledger dl " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.device_ledger_id = dl.id " + |
|
|
|
|
"where " + |
|
|
|
|
" dh.cur_time >= #{startTime} " + |
|
|
|
|
" and dh.cur_time <= #{endTime} " + |
|
|
|
|
" and dm.grade < 40 " + |
|
|
|
|
" and dm.device_type like '%meter%' " + |
|
|
|
|
" and dm.status = 0" + |
|
|
|
|
" dm.cur_time >= #{startTime} " + |
|
|
|
|
" and dm.cur_time <= #{endTime} " + |
|
|
|
|
" and cpm.grade = 40 " + |
|
|
|
|
" and cpm.is_use = 0 " + |
|
|
|
|
"<if test='paramType != null and paramType != \"\"'>" + |
|
|
|
|
" and dh.device_type = #{paramType}" + |
|
|
|
|
" and dl.device_type = #{paramType}" + |
|
|
|
|
"</if>" + |
|
|
|
|
"</script>") |
|
|
|
|
List<DeviceTypeEnergy> queryManyTable(@Param("startTime") String startTime, |
|
|
|
@ -83,23 +91,27 @@ public interface EnergyAnalyzeMapper {
|
|
|
|
|
*/ |
|
|
|
|
@Select("<script>" + |
|
|
|
|
"select " + |
|
|
|
|
" dh.calc_value, " + |
|
|
|
|
" dh.device_num, " + |
|
|
|
|
" dm.remark, " + |
|
|
|
|
" dm.grade " + |
|
|
|
|
" dm.calc_value, " + |
|
|
|
|
" dm.device_num, " + |
|
|
|
|
" cpm.other_name as remark, " + |
|
|
|
|
" cpm.terminal_device_type as device_type " + |
|
|
|
|
"from " + |
|
|
|
|
" ${lastTableName} dh " + |
|
|
|
|
"join device_manage dm " + |
|
|
|
|
"on " + |
|
|
|
|
" dh.device_num = dm.device_num " + |
|
|
|
|
" ${lastTableName} dm " + |
|
|
|
|
"join collection_params_manage cpm " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.mt_num = dm.device_num " + |
|
|
|
|
" and cpm.mt_code = dm.device_code " + |
|
|
|
|
" and cpm.register_addr = dm.register_addr " + |
|
|
|
|
"join device_ledger dl " + |
|
|
|
|
" on " + |
|
|
|
|
" cpm.device_ledger_id = dl.id " + |
|
|
|
|
"where " + |
|
|
|
|
" dh.cur_time >= #{startTime} " + |
|
|
|
|
" and dh.cur_time <= #{endTime} " + |
|
|
|
|
" and dm.grade < 40 " + |
|
|
|
|
" and dm.device_type like '%meter%' " + |
|
|
|
|
" and dm.status = 0" + |
|
|
|
|
" dm.cur_time >= #{startTime}::timestamp " + |
|
|
|
|
" and dm.cur_time <= #{endTime}::timestamp " + |
|
|
|
|
" and cpm.grade = 40 " + |
|
|
|
|
" and cpm.is_use = 0 " + |
|
|
|
|
"<if test='paramType != null and paramType != \"\"'>" + |
|
|
|
|
" and dh.device_type = #{paramType}" + |
|
|
|
|
" and dl.device_type = #{paramType}" + |
|
|
|
|
"</if>" + |
|
|
|
|
"</script>") |
|
|
|
|
List<DeviceTypeEnergy> queryOneTable(@Param("startTime") String startTime, |
|
|
|
|