UPDATE blade_machine m,
blade_workstation w,
blade_workstation_of_machine wm
SET m.collect_switch = #{collectSwitch}
WHERE w.id = wm.workstation_id
AND m.id = wm.machine_id
AND w.tenant_id = #{tenantId}
AND w.id = #{workstationId};
select count(*)
from blade_andon_record bar
left join blade_device_andon_type bdat on bar.type_id = bdat.andon_type_id and bdat.is_deleted = 0
left join blade_machine bm on bm.machine_type_id = bdat.device_type_id and bm.is_deleted = 0
where bar.is_deleted = 0
and bar.cur_status in (1, 2)
and bm.id in
#{item}
select bm.id,
bm.tenant_id tenantId,
bm.extend_id extendId,
machine_code machineCode,
machine_name machineName,
machine_model machineModel,
machine_life_status machineLifeStatus,
machine_use_status machineUseStatus,
factory_no factoryNo,
assets_code assetsCode,
brand,
nameplate,
bm.avatar,
serial_no serialNo,
factory_file factoryFile,
manufacturer,
country_of_manufacture countryOfManufacture,
system_name systemName,
software_version softwareVersion,
net_weight netWeight,
power,
voltage,
dimensions,
production_time productionTime,
delivery_time deliveryTime,
depreciation_year depreciationYear,
turn_to_fixed_assets_time turnToFixedAssetsTime,
invoice_value invoiceValue,
ovfa,
net_asset_value netAssetValue,
bm.organization_id organizationId,
bcg2.name organizationName,
production_line productionLine,
management_class managementClass,
elaborate_equipment elaborateEquipment,
bm.pin_code pinCode,
short_code shortCode,
installation_location installationLocation,
bm.remark,
machine_type_id machineTypeId,
bdt.name machineTypeName,
bdt.code machineTypeCode,
bm.group_id groupId,
bcg1.name groupName,
bm.employee_id employeeId,
be.name employeeName,
bm.status status
from blade_machine bm
LEFT JOIN blade_device_type bdt on bm.machine_type_id = bdt.id and bdt.is_deleted = 0
LEFT JOIN blade_common_group bcg1 on bm.group_id = bcg1.id and bcg1.is_deleted = 0
LEFT JOIN blade_common_group bcg2 on bm.organization_id = bcg2.id and bcg2.is_deleted = 0
LEFT JOIN blade_employee be on bm.employee_id = be.id and be.is_deleted = 0
where bm.id = #{id}
select bm.id,
bm.machine_code machineCode,
bm.machine_name machineName,
bdt.id machineTypeId,
bdt.name machineTypeName,
bm.machine_model machineModel,
bcg.name groupName,
bm.machine_type_id,
bm.serial_no serialNo,
bm.short_code shortCode,
bm.machine_use_status machineUseStatus,
bm.status status
from blade_machine bm
LEFT JOIN blade_device_type bdt on bm.machine_type_id = bdt.id and bdt.is_deleted = 0
LEFT JOIN blade_common_group bcg on bm.group_id = bcg.id and bcg.is_deleted = 0
WHERE bm.is_deleted = 0
and machine_name like CONCAT(#{machineName}, '%')
and machine_code like CONCAT( #{machineCode}, '%')
and machine_type_id = #{machineTypeId}
and group_id = #{groupId}
and bm.status = #{status}
ORDER BY bm.create_time DESC,bm.id DESC
SELECT t1.machine_type_id AS deviceTypeId,
t2.name AS deviceTypeName,
t1.id AS deviceId,
t1.machine_code AS code,
t1.machine_name AS name,
t1.machine_model AS machineModel
FROM blade_machine t1
LEFT JOIN blade_device_type t2
ON t1.machine_type_id = t2.id and t2.is_deleted = 0
WHERE t1.machine_type_id = #{deviceTypeId}
and t1.is_deleted = 0
SELECT t1.machine_type_id AS deviceTypeId,
t2.name AS deviceTypeName,
t1.id AS deviceId,
t1.machine_code AS code,
t1.machine_name AS name,
t1.machine_model AS machineModel
FROM blade_machine t1
LEFT JOIN blade_device_type t2
ON t1.machine_type_id = t2.id and t2.is_deleted = 0
WHERE t1.is_deleted = 0
AND t1.id IN
#{item}
select bm.id,
bm.tenant_id tenantId,
bm.extend_id extendId,
machine_code machineCode,
machine_name machineName,
machine_model machineModel,
machine_life_status machineLifeStatus,
machine_use_status machineUseStatus,
factory_no factoryNo,
assets_code assetsCode,
brand,
nameplate,
bm.avatar,
serial_no serialNo,
factory_file factoryFile,
manufacturer,
country_of_manufacture countryOfManufacture,
system_name systemName,
software_version softwareVersion,
net_weight netWeight,
power,
voltage,
dimensions,
production_time productionTime,
delivery_time deliveryTime,
depreciation_year depreciationYear,
turn_to_fixed_assets_time turnToFixedAssetsTime,
invoice_value invoiceValue,
ovfa,
net_asset_value netAssetValue,
bm.organization_id organizationId,
bcg2.name organizationName,
production_line productionLine,
management_class managementClas,
elaborate_equipment elaborateEquipment,
bm.pin_code pinCode,
short_code shortCode,
installation_location installationLocation,
bm.remark,
machine_type_id machineTypeId,
bdt.name machineTypeName,
bdt.code machineTypeCode,
bcg1.name groupName,
be.name employeeName
from blade_machine bm
LEFT JOIN blade_device_type bdt on bm.machine_type_id = bdt.id and bdt.is_deleted = 0
LEFT JOIN blade_common_group bcg1 on bm.group_id = bcg1.id and bcg1.is_deleted = 0
LEFT JOIN blade_common_group bcg2 on bm.organization_id = bcg2.id and bcg2.is_deleted = 0
LEFT JOIN blade_employee be on bm.employee_id = be.id and be.is_deleted = 0
WHERE bm.is_deleted = 0
and machine_name like CONCAT( #{machineName}, '%')
and machine_code like CONCAT( #{machineCode}, '%')
and machine_type_id = #{machineTypeId}
and group_id = #{groupId}
and bm.status = #{status}
ORDER BY bm.create_time DESC,bm.id DESC
select distinct bm.extend_id, bwom.workstation_id
from blade_machine bm
INNER JOIN blade_workstation_of_machine bwom on bm.id = bwom.machine_id
where bm.is_deleted = 0
and bwom.workstation_id in
#{item}
select bdv.dmp_id
from blade_workstation_wcs bww
left join blade_dmp_variables bdv on bww.dmp_variables_id = bdv.id
where workstation_id = #{workstationId}
and bww.data_type = #{code}
and bww.is_deleted = 0
select bm.id,
bm.tenant_id tenantId,
bm.extend_id extendId,
machine_code machineCode,
machine_name machineName,
machine_model machineModel,
machine_life_status machineLifeStatus,
machine_use_status machineUseStatus,
factory_no factoryNo,
assets_code assetsCode,
brand,
nameplate,
bm.avatar,
serial_no serialNo,
factory_file factoryFile,
manufacturer,
country_of_manufacture countryOfManufacture,
system_name systemName,
software_version softwareVersion,
net_weight netWeight,
power,
voltage,
dimensions,
production_time productionTime,
delivery_time deliveryTime,
depreciation_year depreciationYear,
turn_to_fixed_assets_time turnToFixedAssetsTime,
invoice_value invoiceValue,
ovfa,
net_asset_value netAssetValue,
bm.organization_id organizationId,
bcg2.name organizationName,
production_line productionLine,
management_class managementClass,
elaborate_equipment elaborateEquipment,
bm.pin_code pinCode,
short_code shortCode,
installation_location installationLocation,
bm.remark,
machine_type_id machineTypeId,
bdt.name machineTypeName,
bdt.code machineTypeCode,
bm.group_id groupId,
bcg1.name groupName,
bm.employee_id employeeId,
be.name employeeName,
bm.status status
from blade_machine bm
LEFT JOIN blade_device_type bdt
on bm.machine_type_id = bdt.id and bdt.is_deleted = 0
LEFT JOIN blade_common_group bcg1 on bm.group_id = bcg1.id and bcg1.is_deleted = 0
LEFT JOIN blade_common_group bcg2 on bm.organization_id = bcg2.id and bcg2.is_deleted = 0
LEFT JOIN blade_employee be on bm.employee_id = be.id and be.is_deleted = 0
where bm.machine_code = #{machineCode}
select bm.id,
bm.machine_code machineCode,
bm.machine_name machineName,
bdt.id machineTypeId,
bdt.name machineTypeName,
bm.machine_model machineModel,
bcg.name groupName,
bm.machine_type_id,
bm.serial_no serialNo,
bm.short_code shortCode,
bm.machine_use_status machineUseStatus,
bm.status status
from blade_machine bm
LEFT JOIN blade_device_type bdt on bm.machine_type_id = bdt.id and bdt.is_deleted = 0
LEFT JOIN blade_common_group bcg on bm.group_id = bcg.id and bcg.is_deleted = 0
WHERE bm.is_deleted = 0
and (bm.machine_name like CONCAT(#{machineSelectVO.keyword}, '%')
or bm.machine_code like CONCAT(#{machineSelectVO.keyword}, '%'))
ORDER BY bm.create_time DESC,bm.id DESC
select bm.*
from blade_machine bm
where bm.is_deleted = 0
AND bm.id not in (select bwom.machine_id
from blade_workstation_of_machine bwom)
select bm.*
from blade_machine bm
where bm.is_deleted = 0
AND bm.id in (select bwom.machine_id
from blade_workstation_of_machine bwom)