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

电力设备后台SQL修改

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