<iftest="dto.createDate != null and dto.createDate.length() > 7">
<iftest="dto.createDate != null and dto.createDate.length() > 7">
...
@@ -749,7 +762,7 @@
...
@@ -749,7 +762,7 @@
and wlesal.confirm_type is not null
and wlesal.confirm_type is not null
</if>
</if>
<iftest="dto.isFirm == 'no' ">
<iftest="dto.isFirm == 'no' ">
and wlesal.confirm_type is null
and wlesal.confirm_type is null
</if>
</if>
</where>
</where>
) d
) d
...
@@ -811,10 +824,10 @@
...
@@ -811,10 +824,10 @@
d.fireEquipmentSpecificIndexName,
d.fireEquipmentSpecificIndexName,
d.createDate,
d.createDate,
d.`status`,
d.`status`,
(CASE WHEN d.type='FIREALARM' THEN '火警'
(CASE WHEN d.type='FIREALARM' THEN '火警'
WHEN d.type ='BREAKDOWN' THEN '故障'
WHEN d.type ='BREAKDOWN' THEN '故障'
WHEN d.type='SHIELD' THEN '屏蔽'
WHEN d.type='SHIELD' THEN '屏蔽'
WHEN d.type='NOTICE' THEN '预警'
WHEN d.type='NOTICE' THEN '预警'
ELSE '' END) AS type,
ELSE '' END) AS type,
d.confirmUserName,
d.confirmUserName,
d.systemIds,
d.systemIds,
...
@@ -853,7 +866,7 @@
...
@@ -853,7 +866,7 @@
wlesa.`status`,
wlesa.`status`,
wlesal.type AS type,
wlesal.type AS type,
wlesal.create_date AS createDate,
wlesal.create_date AS createDate,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName,
CONCAT_WS(' ',wws.full_name,wlsd.description) AS warehouseStructureName,
wlesal.confirm_user_name confirmUserName,
wlesal.confirm_user_name confirmUserName,
wlesal.system_ids systemIds,
wlesal.system_ids systemIds,
(select
(select
...
@@ -885,29 +898,33 @@
...
@@ -885,29 +898,33 @@
</if>
</if>
<iftest='dto.createDate != null and dto.createDate == "3"'>
<iftest='dto.createDate != null and dto.createDate == "3"'>
AND wlesal.create_date >= subdate(curdate(),date_format(curdate(),'%w')-1) and wlesal.create_date <= subdate(curdate(),date_format(curdate(),'%w')-7) <!--本周-->
AND wlesal.create_date >= subdate(curdate(),date_format(curdate(),'%w')-1) and wlesal.create_date
<iftest='dto.createDate != null and dto.createDate == "4"'>
<iftest='dto.createDate != null and dto.createDate == "4"'>
AND wlesal.create_date >= subdate(curdate(),date_format(curdate(),'%w')+6) and wlesal.create_date <= subdate(curdate(),date_format(curdate(),'%w')-0)<!--上周-->
AND wlesal.create_date >= subdate(curdate(),date_format(curdate(),'%w')+6) and wlesal.create_date
<iftest='dto.createDate != null and dto.createDate == "5"'>
<iftest='dto.createDate != null and dto.createDate == "5"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月-->
AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月-->
</if>
</if>
<iftest='dto.createDate != null and dto.createDate == "6"'>
<iftest='dto.createDate != null and dto.createDate == "6"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(date_sub(curdate(), interval 1 month),'%y-%m') <!--上月-->
AND date_format(wlesa.create_date,'%y-%m')=date_format(date_sub(curdate(), interval 1
month),'%y-%m') <!--上月-->
</if>
</if>
<iftest='dto.startDate != null and dto.endDate != null '>
<iftest='dto.startDate != null and dto.endDate != null '>
AND DATE_FORMAT(wlesa.create_date, '%Y-%m-%d ' ) between DATE_FORMAT(#{dto.startDate}, '%Y-%m-%d ' ) and DATE_FORMAT(#{dto.endDate}, '%Y-%m-%d ' )
AND DATE_FORMAT(wlesa.create_date, '%Y-%m-%d ' ) between DATE_FORMAT(#{dto.startDate}, '%Y-%m-%d ' ) and
DATE_FORMAT(#{dto.endDate}, '%Y-%m-%d ' )
</if>
</if>
<iftest="dto.isFirm == 'yes'">
<iftest="dto.isFirm == 'yes'">
and wlesal.confirm_type <![CDATA[<>]]> ''
and wlesal.confirm_type <![CDATA[<>]]> ''
</if>
</if>
<iftest="dto.isFirm == 'no'">
<iftest="dto.isFirm == 'no'">
and wlesal.confirm_type is null
and wlesal.confirm_type is null
</if>
</if>
</where>
</where>
) d
) d
...
@@ -922,13 +939,13 @@
...
@@ -922,13 +939,13 @@
</otherwise>
</otherwise>
</choose>
</choose>
<iftest='dto.fireEquipmentName != null '>
<iftest='dto.fireEquipmentName != null '>
AND d.fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
AND d.fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
</if>
</if>
<iftest='dto.systemIds != null '>
<iftest='dto.systemIds != null '>
AND d.systemIds in (#{dto.systemIds})
AND d.systemIds in (#{dto.systemIds})
</if>
</if>
<iftest='dto.confirmUserName != null '>
<iftest='dto.confirmUserName != null '>
AND d.confirmUserName LIKE CONCAT('%', #{dto.confirmUserName}, '%' )
AND d.confirmUserName LIKE CONCAT('%', #{dto.confirmUserName}, '%' )
</if>
</if>
<iftest="dto.code != null">
<iftest="dto.code != null">
and d.code like CONCAT('%', #{dto.code}, '%' )
and d.code like CONCAT('%', #{dto.code}, '%' )
...
@@ -945,7 +962,8 @@
...
@@ -945,7 +962,8 @@
b.eqname fireEquipmentName,
b.eqname fireEquipmentName,
b.qrcode fireEquipmentCode,
b.qrcode fireEquipmentCode,
b.eqimg eqimg,
b.eqimg eqimg,
IFNULL(( select DISTINCT wl_equipment_specific_alarm.`status` from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1 and wl_equipment_specific_alarm.equipment_detail_id=b.eqid ), 0) `status`
IFNULL(( select DISTINCT wl_equipment_specific_alarm.`status` from wl_equipment_specific_alarm where
wl_equipment_specific_alarm.`status`=1 and wl_equipment_specific_alarm.equipment_detail_id=b.eqid ), 0) `status`
from
from
(select
(select
wl_warehouse_structure.full_name address,
wl_warehouse_structure.full_name address,
...
@@ -954,19 +972,20 @@
...
@@ -954,19 +972,20 @@
wl_equipment_detail.img eqimg,
wl_equipment_detail.img eqimg,
wl_equipment_detail.id eqid,
wl_equipment_detail.id eqid,
wl_equipment_specific.system_id
wl_equipment_specific.system_id
from wl_equipment_detail
from wl_equipment_detail
LEFT JOIN wl_equipment_specific ON wl_equipment_specific.equipment_detail_id = wl_equipment_detail.id
LEFT JOIN wl_equipment_specific ON wl_equipment_specific.equipment_detail_id = wl_equipment_detail.id
LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id
LEFT JOIN (select DISTINCT wl_equipment_index.equipment_id from wl_equipment_index where
wl_equipment_index.is_iot=1) b on b.equipment_id=wl_equipment_detail.equipment_id
LEFT JOIN wl_stock_detail on wl_equipment_detail.id =wl_stock_detail.equipment_detail_id
LEFT JOIN wl_stock_detail on wl_equipment_detail.id =wl_stock_detail.equipment_detail_id
LEFT JOIN wl_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id
LEFT JOIN wl_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id
)b
)b
)m
)m
<where>
<where>
<iftest="dto.status != null and dto.status != ''">
<iftest="dto.status != null and dto.status != ''">
AND `status`= #{dto.status}
AND `status`= #{dto.status}
</if>
</if>
<iftest="dto.warehouseStructureName != null and dto.warehouseStructureName != ''">
<iftest="dto.warehouseStructureName != null and dto.warehouseStructureName != ''">
AND warehouseStructureName LIKE CONCAT('%', #{dto.warehouseStructureName}, '%' )
AND warehouseStructureName LIKE CONCAT('%', #{dto.warehouseStructureName}, '%' )
</if>
</if>
<iftest="dto.fireEquipmentCode != null and dto.fireEquipmentCode!= ''">
<iftest="dto.fireEquipmentCode != null and dto.fireEquipmentCode!= ''">
AND fireEquipmentCode LIKE CONCAT('%', #{dto.fireEquipmentCode}, '%' )
AND fireEquipmentCode LIKE CONCAT('%', #{dto.fireEquipmentCode}, '%' )
...
@@ -975,7 +994,7 @@
...
@@ -975,7 +994,7 @@
AND fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
AND fireEquipmentName LIKE CONCAT('%', #{dto.fireEquipmentName}, '%' )
</if>
</if>
<iftest="dto.systemIds != null and dto.systemIds!= ''">
<iftest="dto.systemIds != null and dto.systemIds!= ''">
AND systemIds in (#{dto.systemIds})
AND systemIds in (#{dto.systemIds})
</if>
</if>
</where>
</where>
ORDER BY status DESC
ORDER BY status DESC
...
@@ -1008,25 +1027,26 @@
...
@@ -1008,25 +1027,26 @@
<selectid="getcountAlarmtype"resultType="int">
<selectid="getcountAlarmtype"resultType="int">
select
select
count(wl_equipment_specific_alarm.id) num
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<iftest="tyep != null and tyep!= ''">
<iftest="tyep != null and tyep!= ''">
AND wl_equipment_specific_alarm.type = #{tyep}
AND wl_equipment_specific_alarm.type = #{tyep}
</if>
</if>
</select>
</select>
<selectid="getcountAlarmHandle"resultType="int">
<selectid="getcountAlarmHandle"resultType="int">
select
select
count(wl_equipment_specific_alarm.id) num
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<iftest="tyep == 'yes'">
<iftest="tyep == 'yes'">
and wl_equipment_specific_alarm.confirm_type <![CDATA[<>]]> '' AND wl_equipment_specific_alarm.confirm_type IS NOT NULL
and wl_equipment_specific_alarm.confirm_type <![CDATA[<>]]> '' AND wl_equipment_specific_alarm.confirm_type
IS NOT NULL
</if>
</if>
<iftest="tyep == 'no'">
<iftest="tyep == 'no'">
and wl_equipment_specific_alarm.confirm_type is null
and wl_equipment_specific_alarm.confirm_type is null