|
@@ -306,28 +306,45 @@
|
|
|
${locateid}
|
|
|
</if>
|
|
|
union all
|
|
|
- select #{clockt} clock,itemid,itemname,itemdesc,locateid,energyid,tag_modulus,
|
|
|
- nvl((select mendvalue from EMS_CALPOINT_VALUE where itemid =t.itemid and clock =
|
|
|
- (select max(clock) from EMS_CALPOINT_VALUE where itemid = t.itemid and clock < #{clockt})), 0) mintvalue,0 mendvalue,
|
|
|
- 0 apportvalue,'' bz,1 ed,'' oper_user,'' oper_date,unitid,mintimegranid as timegranid,to_number(REGEXP_REPLACE(bdesc2,'[^0-9]','')) as xh
|
|
|
- from T_RM_CALPOINT t
|
|
|
- where itemid in (${itemid}) and mintimegranid = 'DAY'
|
|
|
+ select c.clock,
|
|
|
+ t.itemid,
|
|
|
+ t.itemname,
|
|
|
+ t.itemdesc,
|
|
|
+ t.locateid,
|
|
|
+ t.energyid,
|
|
|
+ t.tag_modulus,
|
|
|
+ c.mintvalue,
|
|
|
+ c.mendvalue,
|
|
|
+ c.apportvalue,
|
|
|
+ c.bz,
|
|
|
+ case
|
|
|
+ when clock = '2021-11-14' then
|
|
|
+ 1
|
|
|
+ else
|
|
|
+ 0
|
|
|
+ end ed,
|
|
|
+ c.crman as oper_user,
|
|
|
+ c.REC_TIME as oper_date,
|
|
|
+ t.unitid,
|
|
|
+ t.mintimegranid as timegranid,
|
|
|
+ to_number(REGEXP_REPLACE(bdesc2, '[^0-9]', '')) as xh
|
|
|
+ from T_RM_CALPOINT t
|
|
|
+ INNER JOIN T_RM_CALPOINT_VALUE c
|
|
|
+ on t.itemid = c.itemid
|
|
|
+ where t.itemid in (${itemid}) and mintimegranid = 'DAY'
|
|
|
+ and t.itemid not in
|
|
|
+ (select itemid from EMS_CALPOINT_VALUE where clock = #{clockt})
|
|
|
<if test="itemid2 != null and itemid2 != ''">
|
|
|
- and itemid = #{itemid2}
|
|
|
+ and t.itemid = #{itemid2}
|
|
|
</if>
|
|
|
- and itemid not in
|
|
|
- (select itemid from EMS_CALPOINT_VALUE where clock = #{clockt})
|
|
|
<if test="clock != null and clock != ''">
|
|
|
- and #{clockt} >= #{clock}
|
|
|
- </if>
|
|
|
- <if test="clocke != null and clocke != ''">
|
|
|
- and #{clockt} <= #{clocke}
|
|
|
+ and c.clock = #{clock}
|
|
|
</if>
|
|
|
<if test="itemname != null and itemname != ''">
|
|
|
- and ITEMNAME LIKE '%${itemname}%'
|
|
|
+ and t.ITEMNAME LIKE '%${itemname}%'
|
|
|
</if>
|
|
|
<if test="itemdesc != null and itemdesc != ''">
|
|
|
- and itemdesc LIKE '%${itemdesc}%'
|
|
|
+ and t.itemdesc LIKE '%${itemdesc}%'
|
|
|
</if>
|
|
|
<if test="locateid != null and locateid != ''">
|
|
|
${locateid}
|
|
@@ -357,28 +374,43 @@
|
|
|
${locateid}
|
|
|
</if>
|
|
|
union all
|
|
|
- select #{clocktm} clock,itemid,itemname,itemdesc,locateid,energyid,tag_modulus,
|
|
|
- nvl((select mendvalue from EMS_CALPOINT_VALUE where itemid =t.itemid and clock =
|
|
|
- (select max(clock) from EMS_CALPOINT_VALUE where itemid = t.itemid and clock < #{clocktm})), 0) mintvalue,0 mendvalue,
|
|
|
- 0 apportvalue,'' bz,1 ed,'' oper_user,'' oper_date,unitid,mintimegranid as timegranid,to_number(REGEXP_REPLACE(bdesc2,'[^0-9]','')) as xh
|
|
|
- from T_RM_CALPOINT t
|
|
|
- where itemid in (${itemid}) and mintimegranid = 'MONTH'
|
|
|
- <if test="itemid2 != null and itemid2 != ''">
|
|
|
- and itemid = #{itemid2}
|
|
|
- </if>
|
|
|
- and itemid not in
|
|
|
+ select c.clock,
|
|
|
+ t.itemid,
|
|
|
+ t.itemname,
|
|
|
+ t.itemdesc,
|
|
|
+ t.locateid,
|
|
|
+ t.energyid,
|
|
|
+ t.tag_modulus,
|
|
|
+ c.mintvalue,
|
|
|
+ c.mendvalue,
|
|
|
+ c.apportvalue,
|
|
|
+ c.bz,
|
|
|
+ case
|
|
|
+ when clock = '2021-11-14' then
|
|
|
+ 1
|
|
|
+ else
|
|
|
+ 0
|
|
|
+ end ed,
|
|
|
+ c.crman as oper_user,
|
|
|
+ c.REC_TIME as oper_date,
|
|
|
+ t.unitid,
|
|
|
+ t.mintimegranid as timegranid,
|
|
|
+ to_number(REGEXP_REPLACE(bdesc2, '[^0-9]', '')) as xh
|
|
|
+ from T_RM_CALPOINT t
|
|
|
+ INNER JOIN T_RM_CALPOINT_VALUE c
|
|
|
+ on t.itemid = c.itemid
|
|
|
+ where t.itemid in (${itemid}) and mintimegranid = 'MONTH'
|
|
|
+ and t.itemid not in
|
|
|
(select itemid from EMS_CALPOINT_VALUE where clock = #{clocktm})
|
|
|
- <if test="clock != null and clock != ''">
|
|
|
- and #{clocktm} >= substr(#{clock}, 0, 7)
|
|
|
- </if>
|
|
|
- <if test="clocke != null and clocke != ''">
|
|
|
- and #{clocktm} <= substr(#{clocke}, 0, 7)
|
|
|
+ and c.clock = #{clocktm}
|
|
|
+ <if test="itemid2 != null and itemid2 != ''">
|
|
|
+ and t.itemid = #{itemid2}
|
|
|
</if>
|
|
|
<if test="itemname != null and itemname != ''">
|
|
|
- and ITEMNAME LIKE '%${itemname}%'
|
|
|
+ and t.ITEMNAME LIKE '%${itemname}%'
|
|
|
</if>
|
|
|
<if test="itemdesc != null and itemdesc != ''">
|
|
|
- and itemdesc LIKE '%${itemdesc}%'
|
|
|
+ and t.itemdesc LIKE '%${itemdesc}%'
|
|
|
</if>
|
|
|
<if test="locateid != null and locateid != ''">
|
|
|
${locateid}
|