id AS "id", work_order_no AS "workOrderNo", sfc_code AS "sfcCode", product_code AS "productCode", production_line AS "productionLine", location_code AS "locationCode", equipment_no AS "equipmentNo", inbound_time AS "inboundTime", outbound_time AS "outboundTime", in_rs_sign AS "inRsSign", in_msg_sign AS "inMsgSign", out_rs_sign AS "outRsSign", out_msg_sign AS "outMsgSign", collection_time AS "collectionTime", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2", create_user AS "createUser", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime"
select
from cm_passing_station_collection where 1 = 1
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
and sfc_code like CONCAT('%',#{paramCondition.sfcCode},'%')
and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
and create_time >= #{paramCondition.startTime}
and create_time <= #{paramCondition.endTime}
select
from cm_passing_station_collection where 1 = 1
select
from cm_passing_station_collection where 1 = 1
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
and sfc_code like CONCAT('%',#{paramCondition.sfcCode},'%')
and location_code like CONCAT('%',#{paramCondition.locationCode},'%')
and create_time >= #{paramCondition.startTime}
and create_time <= #{paramCondition.endTime}
select
from cm_passing_station_collection where 1 = 1
select COUNT(*) as repairQty from cm_passing_station_collection where DateDiff(dd,create_time,getdate())=0
select COUNT(*) as repairQty from cm_passing_station_collection where DateDiff(week,create_time,getdate())=1
update cm_passing_station_collection set sfc_code = #{sfcCode} where sfc_code = #{childSfcCode}
SELECT
location_code as locationCode,
SUM ( CASE WHEN out_rs_sign = 1 THEN 1 ELSE 0 END ) as 'qualified',
SUM ( CASE WHEN out_rs_sign = 2 THEN 1 ELSE 0 END ) as 'unqualified',
FORMAT(CAST(SUM ( CASE WHEN out_rs_sign = 1 THEN 1 ELSE 0 END )*1.00 / COUNT(location_code) AS DECIMAL(8,6)),'P') as 'passRate'
FROM
cm_passing_station_collection
WHERE
1 = 1
and work_order_no like CONCAT('%',#{paramCondition.workOrderNo},'%')
and production_line like CONCAT('%',#{paramCondition.productionLine},'%')
and sfc_code like CONCAT('%',#{paramCondition.sfcCode},'%')
and location_code = #{paramCondition.locationCode}
and create_time >= #{paramCondition.startTime}
and create_time <= #{paramCondition.endTime}
GROUP BY
location_code
SELECT COUNT(*) AS sumNumber FROM cm_passing_station_collection
WHERE 1 = 1
AND location_code = 'OP170'
AND work_order_no = #{workOrderNo}
AND create_time BETWEEN #{startTime} AND #{endTime}
and out_rs_sign = #{qualifiedFlag}
SELECT ISNULL(C.num, '0') AS num, L.location_code
FROM (
SELECT 'OP150' AS location_code
UNION ALL
SELECT 'OP100'
UNION ALL
SELECT 'OP140'
UNION ALL
SELECT 'OP070'
UNION ALL
SELECT 'EOP080'
UNION ALL
SELECT 'EOP090'
) AS L
LEFT JOIN (
SELECT COUNT(*) AS num, location_code
FROM cm_passing_station_collection
WHERE work_order_no = #{workOrderNo}
AND out_rs_sign = '2'
GROUP BY location_code
) AS C ON L.location_code = C.location_code
ORDER BY C.num DESC
SELECT
COUNT(*)
FROM
cm_passing_station_collection
WHERE 1 = 1
AND location_code IN ( 'OP150', 'OP100', 'OP140', 'OP070', 'EOP080', 'EOP090' )
AND work_order_no = #{workOrderNo}
AND out_rs_sign = '2'