|
@@ -8,7 +8,7 @@
|
|
tbdio.service_id AS serviceUnitId,
|
|
tbdio.service_id AS serviceUnitId,
|
|
IFNULL(tbs.name,'--') AS serviceUnitName,
|
|
IFNULL(tbs.name,'--') AS serviceUnitName,
|
|
tbdio.usage_type AS usageType,
|
|
tbdio.usage_type AS usageType,
|
|
- tbdio.device_no AS deviceNo,
|
|
|
|
|
|
+ sd.device_code AS deviceNo,
|
|
sd.id AS deviceId,
|
|
sd.id AS deviceId,
|
|
sd.brand AS deviceBrand,
|
|
sd.brand AS deviceBrand,
|
|
sd.model AS deviceModel,
|
|
sd.model AS deviceModel,
|
|
@@ -23,6 +23,7 @@
|
|
tbdio.address_arr AS addressArrTemp,
|
|
tbdio.address_arr AS addressArrTemp,
|
|
tbdio.serial_no AS serialNo,
|
|
tbdio.serial_no AS serialNo,
|
|
tbdio.base_photo_path AS basePhotoPath,
|
|
tbdio.base_photo_path AS basePhotoPath,
|
|
|
|
+ tbdio.device_serial_no AS deviceSerialNo,
|
|
ss.id AS supplierId,
|
|
ss.id AS supplierId,
|
|
ss.name AS supplierName
|
|
ss.name AS supplierName
|
|
FROM
|
|
FROM
|
|
@@ -30,7 +31,7 @@
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
t_b_service tbs ON tbdio.service_id = tbs.id
|
|
t_b_service tbs ON tbdio.service_id = tbs.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_device sd ON tbdio.serial_no = sd.serial_no
|
|
|
|
|
|
+ sys_device sd ON tbdio.device_serial_no = sd.serial_no
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
sys_user su ON tbdio.user_id = su.id
|
|
sys_user su ON tbdio.user_id = su.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
@@ -56,7 +57,7 @@
|
|
AND #{inOutTimeEnd} > tbdio.in_out_time
|
|
AND #{inOutTimeEnd} > tbdio.in_out_time
|
|
</if>
|
|
</if>
|
|
<if test="deviceNo != null and deviceNo != ''">
|
|
<if test="deviceNo != null and deviceNo != ''">
|
|
- AND tbdio.device_no LIKE CONCAT('%',#{deviceNo},'%')
|
|
|
|
|
|
+ AND sd.device_code LIKE CONCAT('%',#{deviceNo},'%')
|
|
</if>
|
|
</if>
|
|
<if test="customName != null and customName != ''">
|
|
<if test="customName != null and customName != ''">
|
|
AND tbdio.custom_name LIKE CONCAT('%',#{customName},'%')
|
|
AND tbdio.custom_name LIKE CONCAT('%',#{customName},'%')
|
|
@@ -101,7 +102,7 @@
|
|
tbdio.service_id AS serviceUnitId,
|
|
tbdio.service_id AS serviceUnitId,
|
|
IFNULL(tbs.name,'--') AS serviceUnitName,
|
|
IFNULL(tbs.name,'--') AS serviceUnitName,
|
|
tbdio.usage_type AS usageType,
|
|
tbdio.usage_type AS usageType,
|
|
- tbdio.device_no AS deviceNo,
|
|
|
|
|
|
+ sd.device_code AS deviceNo,
|
|
sd.id AS deviceId,
|
|
sd.id AS deviceId,
|
|
sd.brand AS deviceBrand,
|
|
sd.brand AS deviceBrand,
|
|
sd.model AS deviceModel,
|
|
sd.model AS deviceModel,
|
|
@@ -124,7 +125,7 @@
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
t_b_service tbs ON tbdio.service_id = tbs.id
|
|
t_b_service tbs ON tbdio.service_id = tbs.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
- sys_device sd ON tbdio.serial_no = sd.serial_no
|
|
|
|
|
|
+ sys_device sd ON tbdio.device_serial_no = sd.serial_no
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
sys_user su ON tbdio.user_id = su.id
|
|
sys_user su ON tbdio.user_id = su.id
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
@@ -150,7 +151,7 @@
|
|
AND #{inOutTimeEnd} > tbdio.in_out_time
|
|
AND #{inOutTimeEnd} > tbdio.in_out_time
|
|
</if>
|
|
</if>
|
|
<if test="deviceNo != null and deviceNo != ''">
|
|
<if test="deviceNo != null and deviceNo != ''">
|
|
- AND tbdio.device_no LIKE CONCAT('%',#{deviceNo},'%')
|
|
|
|
|
|
+ AND sd.device_code LIKE CONCAT('%',#{deviceNo},'%')
|
|
</if>
|
|
</if>
|
|
<if test="customName != null and customName != ''">
|
|
<if test="customName != null and customName != ''">
|
|
AND tbdio.custom_name LIKE CONCAT('%',#{customName},'%')
|
|
AND tbdio.custom_name LIKE CONCAT('%',#{customName},'%')
|
|
@@ -244,10 +245,10 @@
|
|
</if>
|
|
</if>
|
|
<choose>
|
|
<choose>
|
|
<when test="sopNo != null and sopNo != ''">
|
|
<when test="sopNo != null and sopNo != ''">
|
|
- AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.sop_no = #{sopNo})
|
|
|
|
|
|
+ AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_serial_no = sd.device_code AND tbdio.sop_no = #{sopNo})
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.serial_no = sd.device_code AND tbdio.service_id IS NULL)
|
|
|
|
|
|
+ AND EXISTS(SELECT 1 FROM t_b_device_in_out tbdio WHERE tbdio.device_serial_no = sd.device_code AND tbdio.service_id IS NULL)
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</where>
|
|
</where>
|