|
@@ -53,7 +53,38 @@
|
|
|
from lab_sparse_hardware
|
|
from lab_sparse_hardware
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="selectLabSparseHardwareListVo">
|
|
<sql id="selectLabSparseHardwareListVo">
|
|
|
- select t.id,
|
|
|
|
|
|
|
+ SELECT t.id,
|
|
|
|
|
+ t.hardware_num,
|
|
|
|
|
+ t.name,
|
|
|
|
|
+ t.type,
|
|
|
|
|
+ t.floor_id,
|
|
|
|
|
+ t.build_id,
|
|
|
|
|
+ CASE WHEN t.subject_id IS NOT NULL THEN
|
|
|
|
|
+ (SELECT DISTINCT bf.name FROM lab_build_floor bf INNER JOIN lab_build_floor_layout bfl ON bf.id = bfl.build_id WHERE bfl.sub_id = t.subject_id)
|
|
|
|
|
+ ELSE d.name END AS buildName,
|
|
|
|
|
+ t.subject_id,
|
|
|
|
|
+ s.name AS subjectName,
|
|
|
|
|
+ t.operate,
|
|
|
|
|
+ t.function_status,
|
|
|
|
|
+ t.dept_id,
|
|
|
|
|
+ t.dept_name,
|
|
|
|
|
+ t.create_time,
|
|
|
|
|
+ t.user_id,
|
|
|
|
|
+ t.create_by,
|
|
|
|
|
+ t.update_time,
|
|
|
|
|
+ t.update_by,
|
|
|
|
|
+ t.remark,
|
|
|
|
|
+ t.port,
|
|
|
|
|
+ t.device_vol,
|
|
|
|
|
+ t.device_type,
|
|
|
|
|
+ CASE WHEN t.subject_id IS NOT NULL THEN
|
|
|
|
|
+ (SELECT DISTINCT bf.name FROM lab_build_floor bf INNER JOIN lab_build_floor_layout bfl ON bf.id = bfl.floor_id WHERE bfl.sub_id = t.subject_id)
|
|
|
|
|
+ ELSE b.name END AS floorName
|
|
|
|
|
+ FROM lab_sparse_hardware AS t
|
|
|
|
|
+ LEFT JOIN lab_build_floor d ON t.build_id = d.id
|
|
|
|
|
+ LEFT JOIN lab_build_floor b ON t.floor_id = b.id
|
|
|
|
|
+ LEFT JOIN lab_subject s ON t.subject_id = s.id
|
|
|
|
|
+ <!--select t.id,
|
|
|
t.hardware_num,
|
|
t.hardware_num,
|
|
|
t.name,
|
|
t.name,
|
|
|
t.type,
|
|
t.type,
|
|
@@ -84,6 +115,7 @@
|
|
|
left join sys_dept d on t.build_id = d.dept_id
|
|
left join sys_dept d on t.build_id = d.dept_id
|
|
|
left join lab_building b on t.floor_id = b.id
|
|
left join lab_building b on t.floor_id = b.id
|
|
|
left join lab_subject s on t.subject_id = s.id
|
|
left join lab_subject s on t.subject_id = s.id
|
|
|
|
|
+ -->
|
|
|
</sql>
|
|
</sql>
|
|
|
<select id="selectLabSparseHardwareList" parameterType="com.zd.laboratory.domain.LabSparseHardware"
|
|
<select id="selectLabSparseHardwareList" parameterType="com.zd.laboratory.domain.LabSparseHardware"
|
|
|
resultMap="LabSparseHardwareResult">
|
|
resultMap="LabSparseHardwareResult">
|
|
@@ -111,14 +143,14 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectListByFloorId" resultType="java.util.Map">
|
|
<select id="selectListByFloorId" resultType="java.util.Map">
|
|
|
- SELECT t.hardware_num as hardwareNum,t.`name`,t.operate,t.port,t.device_vol as deviceVol FROM lab_sparse_hardware t LEFT JOIN sys_dept d ON t.floor_id = d.dept_id
|
|
|
|
|
|
|
+ SELECT t.hardware_num as hardwareNum,t.`name`,t.operate,t.port,t.device_vol as deviceVol FROM lab_sparse_hardware t LEFT JOIN lab_build_floor d ON t.floor_id = d.id
|
|
|
WHERE t.floor_id=#{floorId} AND t.`type`=#{type}
|
|
WHERE t.floor_id=#{floorId} AND t.`type`=#{type}
|
|
|
<if test="subId != null">
|
|
<if test="subId != null">
|
|
|
or (subject_id = #{subId} and device_type = 2)
|
|
or (subject_id = #{subId} and device_type = 2)
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
<select id="selectCameraByFloorId" resultType="java.lang.String">
|
|
<select id="selectCameraByFloorId" resultType="java.lang.String">
|
|
|
- SELECT t.hardware_num FROM lab_sparse_hardware t LEFT JOIN sys_dept d ON t.floor_id = d.dept_id
|
|
|
|
|
|
|
+ SELECT t.hardware_num FROM lab_sparse_hardware t LEFT JOIN lab_build_floor d ON t.floor_id = d.id
|
|
|
WHERE t.floor_id=#{floorId} AND t.`type`=1
|
|
WHERE t.floor_id=#{floorId} AND t.`type`=1
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|