<iftest="dto.createDate != null and dto.createDate.length() > 7">
...
...
@@ -885,22 +898,26 @@
</if>
<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"'>
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"'>
AND date_format(wlesa.create_date,'%y-%m')=date_format(curdate(),'%y-%m')<!--本月-->
</if>
<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>
<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>
<iftest="dto.isFirm == 'yes'">
...
...
@@ -945,7 +962,8 @@
b.eqname fireEquipmentName,
b.qrcode fireEquipmentCode,
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
(select
wl_warehouse_structure.full_name address,
...
...
@@ -956,7 +974,8 @@
wl_equipment_specific.system_id
from wl_equipment_detail
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_warehouse_structure on wl_stock_detail.warehouse_structure_id = wl_warehouse_structure.id
)b
...
...
@@ -1023,7 +1042,8 @@
count(wl_equipment_specific_alarm.id) num
from wl_equipment_specific_alarm where wl_equipment_specific_alarm.`status`=1
<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>
<iftest="tyep == 'no'">
and wl_equipment_specific_alarm.confirm_type is null