select id, device_number, station_name, personnel_name,scanning_time, content_information,execution_message,execution_mark from fjqydb.ring_scan_information
and device_number = #{deviceNumber}
and DATE(scanning_time) = CURDATE() order by scanning_time desc limit #{offset},#{pageSize}
select count(id) from fjqydb.ring_scan_information
and device_number = #{deviceNumber}
and DATE(scanning_time) = CURDATE()
select id, device_number, device_name, scanning_time, content_information,personnel_name from fjqydb.ring_scan_information
and device_number = #{deviceNumber}
and process_name = #{processName}
and device_name like concat('%', #{deviceName}, '%')
and scanning_time = #{scanningTime}
and content_information = #{contentInformation}
and native_numbering = #{nativeNumbering}
and production_order_number = #{productionOrderNumber}
SELECT
pcf.production_order_list_id,
pcf.serial_number,
ptd.material_id,
ptd.material_name,
mbi.model,
ptd.power,
ptd.colour,
ptd.mingpai,
ptd.baozhuangxiang,
ptd.switch_box,
mbi.core_length,
mbi.voltage_frequency,
mbi.case_end_cover,
mbi.platter_interface,
CONCAT( IFNULL( mbi.data_info, '无' ), '/', IFNULL( mbi.phase_number, '无' ) ) AS data_info,
mbi.specification_book,
mbi.certificate_of_conformity,
ppm.special_requirements,
ppm.remark,
ptd.time_of_request AS timeOfRequest,
ptd.demand_document,
rsi.id,
rsi.device_number,
rsi.device_name,
rsi.scanning_time,
rsi.content_information,
rsi.native_numbering,
rsi.personnel_name,
rsi.process_name,
rsi.station_name,
rsi.execution_mark,
rsi.execution_message
FROM
fjqydb.production_card_flow AS pcf
LEFT JOIN fjqydb.plan_task_details AS ptd ON ptd.demand_document = pcf.demand_document_number
LEFT JOIN fjqydb.material_base_info mbi ON ptd.material_id = mbi.material_code
LEFT JOIN fjqydb.production_planning_management AS ppm ON pcf.production_order_list_id = ppm.order_number
RIGHT JOIN fjqydb.ring_scan_information AS rsi ON pcf.serial_number = rsi.native_numbering
and device_number = #{deviceNumber}
and device_name like concat('%', #{deviceName}, '%')
and scanning_time = #{scanningTime}
and content_information = #{contentInformation}
and native_numbering = #{nativeNumbering}
and execution_mark = #{executionMark}
order by scanning_time desc
where id = #{id}
and device_number = #{deviceNumber}
and device_name like concat('%', #{deviceName}, '%')
and scanning_time = #{scanningTime}
and content_information = #{contentInformation}
order by scanning_time DESC
LIMIT 1
SELECT
sub.count,
sub.process_name,
sub.native_numbering,
sub.order_number,
sub.scanning_time,
sub.sort,
rsif.`status`,
rsif.start_time,
rsif.end_time,
rsif.total_quantity
FROM
(
SELECT
rsi.process_name,
rsi.native_numbering,
rsi.order_number,
COUNT( rsi.process_name ) AS count,
MAX( rsi.scanning_time ) AS scanning_time,
pl.sort
FROM
fjqydb.ring_scan_information AS rsi
LEFT JOIN fjqydb.procedure_list AS pl ON pl.procedur_name = rsi.process_name
GROUP BY
rsi.order_number,
rsi.process_name
) AS sub
LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON ( sub.order_number = rsif.order_number )
sub.order_number IN
#{id}
rsi.order_number = 'X'
ORDER BY
sub.order_number,sub.sort
-- SELECT
-- sub.count,
-- sub.process_name,
-- sub.native_numbering,
-- sub.order_number,
-- sub.scanning_time,
-- sub.production_order_number,
-- sub.sort,
-- rsif.`status`,
-- rsif.start_time,
-- rsif.end_time,
-- rsif.total_quantity,
-- rsif.production_order_total_quantity
-- FROM
-- (
-- SELECT
-- rsi.process_name,
-- rsi.native_numbering,
-- rsi.order_number,
-- COUNT( rsi.process_name ) `AS count`,
-- rsi.production_order_number,
-- MAX( rsi.scanning_time ) AS scanning_time,
-- pl.sort
-- FROM
-- fjqydb.ring_scan_information AS rsi
-- LEFT JOIN fjqydb.procedure_list AS pl ON pl.procedur_name = rsi.process_name
-- where
-- rsi.execution_mark='1'
-- GROUP BY
-- rsi.production_order_number,
-- rsi.process_name
-- ) AS sub
-- LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON (sub.production_order_number = rsif.production_order_number)
SELECT
count(sub.count) as `count`,
sub.process_name,
sub.order_number,
sub.scanning_time,
sub.production_order_number,
sub.sort,
rsif.`status`,
rsif.start_time,
rsif.end_time,
rsif.total_quantity,
rsif.production_order_total_quantity
FROM
(
SELECT
rsi.process_name,
rsi.native_numbering,
rsi.order_number,
COUNT( rsi.process_name ) AS count,
rsi.production_order_number,
MAX( rsi.scanning_time ) AS scanning_time,
pl.sort
FROM
fjqydb.ring_scan_information AS rsi
LEFT JOIN fjqydb.procedure_list AS pl ON pl.procedur_name = rsi.process_name
WHERE
rsi.execution_mark = '1'
GROUP BY
rsi.production_order_number,rsi.process_name,rsi.native_numbering
) AS sub
LEFT JOIN fjqydb.ring_scan_information_first AS rsif ON ( sub.production_order_number = rsif.production_order_number )
sub.production_order_number IN
#{id}
rsi.production_order_number = 'X'
GROUP BY
sub.production_order_number,
sub.process_name
ORDER BY
rsif.start_time desc,sub.sort
insert into fjqydb.ring_scan_information
device_number,
device_name,
scanning_time,
content_information,
native_numbering,
personnel_name,
process,
process_name,
order_number,
production_order_number,
station_id,
station_name,
execution_mark,
execution_message,
#{deviceNumber},
#{deviceName},
#{scanningTime},
#{contentInformation},
#{nativeNumbering},
#{personnelName},
#{process},
#{processName},
#{orderNumber},
#{productionOrderNumber},
#{stationId},
#{stationName},
#{executionMark},
#{executionMessage},
update fjqydb.ring_scan_information
device_number = #{deviceNumber},
device_name = #{deviceName},
scanning_time = #{scanningTime},
content_information = #{contentInformation},
station_id=#{stationId},
station_name=#{stationName},
where id = #{id}
delete from fjqydb.ring_scan_information where id = #{id}
delete from fjqydb.ring_scan_information where id in
#{id}