SELECT d.device_no AS 'deviceNo',d.model_no AS 'modelNo',dc.component AS 'component',d.device_type AS 'deviceType'
,d.device_type_sub AS 'deviceTypeSub',d.warranty_state AS 'warrantyState',d.shipment_date AS 'shipmentDate'
,d.start_warranty_date AS 'startWarrantyDate',d.warranty_month AS 'warrantyMonth',d.customer_name AS 'customerName'
FROM device d
LEFT JOIN device_component dc ON d.model_no=dc.model_no AND dc.`enable`=1
WHERE d.device_no=#{deviceNo}
and a.device_no=#{query.deviceNo}
and a.customer_name=#{query.customerName}
and a.agent_name=#{query.agentName}
and a.model_no=#{query.modelNo}
and a.warranty_state=#{query.warrantyState}
and a.start_warranty_date >= #{query.warrantyStartDate} and start_warranty_date <= #{query.warrantyEndDate}
select a.id, device_no, device_name, device_type, device_type_sub, model_no, customer_id, customer_name, device_state, agent_code, agent_name, shipment_date, warranty_state, start_warranty_date, warranty_month, data_valid_state, source_from, create_by, create_time, update_by, update_time, remark ,b.area_code ,b.area_name from device a
left join t_base_customer b on a.agent_code=b.agency_company_code
where data_valid_state=1
update device set data_valid_state=0 where id in
#{item}
SELECT d.device_no AS 'deviceNo',d.device_name AS 'deviceName',d.model_no AS 'modelNo',d.device_type AS 'deviceType',d.shipment_date AS 'shipmentDate'
FROM device d
INNER JOIN t_base_customer c ON d.agent_code=c.agency_company_code
WHERE d.data_valid_state=1 AND c.id IN
#{companyId}
and d.device_no LIKE concat('%', #{request.deviceNo}, '%')
and d.model_no LIKE concat('%', #{request.modelNo}, '%')
and d.shipment_date >= #{request.startTime}
and d.shipment_date <= #{request.endTime}