Commit f01a5c93 authored by 吴俊凯's avatar 吴俊凯

电力设备后台SQL修改

parent b9cd3627
...@@ -20,6 +20,11 @@ public class EquipmentSpecificVo { ...@@ -20,6 +20,11 @@ public class EquipmentSpecificVo {
//是否单件管理(1是多件) //是否单件管理(1是多件)
private Integer single; private Integer single;
//IOT编码
private String iotCode;
//装备编码
private String specificCode;
//系统名称
private String systemName;
} }
...@@ -28,33 +28,38 @@ ...@@ -28,33 +28,38 @@
</delete> </delete>
<select id="getEquipmentBySpe" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo"> <select id="getEquipmentBySpe" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificVo">
select select
sto.id as id , sto.id as id ,
equ.code as code, equ.code as code,
det.name as name, det.name as name,
cate.name as type, cate.name as type,
if(fire.fire_equipment_id is null ,'NO','YES') as isbind, if(fire.fire_equipment_id is null ,'NO','YES') as isbind,
ware.full_name as address, ware.full_name as address,
spe.single as single, spe.single as single,
sto.amount as amount sto.amount as amount,
from spe.iot_code,
wl_stock_detail as sto spe.code as specific_code,
left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code spe.system_id,
left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id manage.name as system_name
left join wl_equipment_detail as det on sto.equipment_detail_id = det.id from
left join wl_equipment as equ on det.equipment_id = equ.id wl_stock_detail as sto
left join wl_equipment_category as cate on equ.category_id = cate.id left join wl_equipment_specific as spe on sto.qr_code = spe.qr_code
left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id left join wl_warehouse_structure as ware on sto.warehouse_structure_id = ware .id
where sto.amount <![CDATA[>]]> 0 left join wl_equipment_detail as det on sto.equipment_detail_id = det.id
<if test="name != null and name!='null' "> left join wl_equipment as equ on det.equipment_id = equ.id
and det.name like CONCAT('%',#{name},'%' ) left join wl_equipment_category as cate on equ.category_id = cate.id
</if> left join f_equipment_fire_equipment as fire on sto.id = fire.fire_equipment_id
<if test="code != null and code!='null' "> left join f_equipment_manage as manage on spe.system_id = manage.SEQUENCE_NBR
and cate.code like CONCAT('%',#{code},'%' ) where sto.amount <![CDATA[>]]> 0
</if> <if test="name != null and name!='null' ">
<if test="equipmentId != null and equipmentId!='null' "> and det.name like CONCAT('%',#{name},'%' )
and fire.equipment_id = #{equipmentId} </if>
</if> <if test="code != null and code!='null' ">
limit #{pageNumber},#{pageSize} and cate.code like CONCAT('%',#{code},'%' )
</if>
<if test="equipmentId != null and equipmentId!='null' ">
and fire.equipment_id = #{equipmentId}
</if>
limit #{pageNumber},#{pageSize}
</select> </select>
<select id="getEquipmentBySpeCount" resultType="int"> <select id="getEquipmentBySpeCount" resultType="int">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment