Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

资产

1. 查询物料的库存总数
测试1 - 不汇总

1 {
2 "table": "asset",
3 关联产品为1676143162946052098的资产的关联产品和在手资产数量是多少?"
"query": "
4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"quantity_on_hand_total\": 1.0}]",
8 "sql": "SELECT product_id, quantity_on_hand_total FROM asset WHERE
product_id = '1676143162946052098';",
9 "status": "success",
10 "tokens": 1574
11 }

结果:输出正确
测试2 - 汇总

1 {
2 "table": "asset",
3 关联产品为1676143162946052098的资产的关联产品和在手资产数量总和是多少?"
"query": "
4 }
5

6 {
7 "query_result": "[]",
8 "sql": "SELECT product_id, SUM(quantity_on_hand_total) AS
total_quantity_on_hand FROM asset WHERE parent_asset_id = '1676143162946052098'
GROUP BY product_id;",
9 "status": "success",
10 "tokens": 1592
11 }

结果:输出不正确,where条件中不应该是parent_asset_id

2. 查询物料号的批次库位信息
测试1 - 不汇总

1 {
2 "table": "asset",
"query": "关联产品为1676143162946052098批次ID为1721334815214608386的资产的关联产品
批次ID库位ID和在手资产数量是多少?"
3

4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\", \"lot_id\":
\"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"quantity_on_hand_total\": 1.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"quantity_on_hand_total\": 1.0}]",
8 "sql": "SELECT product_id, lot_id, location_seq_id, quantity_on_hand_total
FROM asset WHERE product_id = '1676143162946052098' AND lot_id =
'1721334815214608386';",
9 "status": "success",
10 "tokens": 1613
11 }

结果:输出正确
测试2 - 汇总

1 {
2 "table": "asset",
"query": "关联产品为1676143162946052098批次ID为1721334815214608386的资产的关联产品
批次ID库位ID和在手资产数量总和是多少?"
3

4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\", \"lot_id\":
\"1721334815214608386\", \"location_seq_id\": \"2D3\",
\"total_quantity_on_hand\": 8.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D4\",
\"total_quantity_on_hand\": 8.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D5\",
\"total_quantity_on_hand\": 8.0}, {\"product_id\": \"1676143162946052098\",
\"lot_id\": \"1721334815214608386\", \"location_seq_id\": \"2D6\",
\"total_quantity_on_hand\": 8.0}]",
8 "sql": "SELECT product_id, lot_id, location_seq_id,
SUM(quantity_on_hand_total) AS total_quantity_on_hand FROM asset WHERE
product_id = '1676143162946052098' AND lot_id = '1721334815214608386'
GROUP BY product_id, lot_id, location_seq_id;",
9 "status": "success",
10 "tokens": 1641
11 }

结果:输出正确

3. 查询物料号某个批次的入库时间
测试1 - 查询资产所有入库时间记录
1 {
2 "table": "asset",
"query": "关联产品为1676143162946052098批次ID为1721334815214608386的资产的关联产品
批次ID和接收时间是多少?"
3

4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:31:32\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:31:32\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:31:32\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-06 16:31:32\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:31:32\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:31:32\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:31:32\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-06 16:31:32\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:38:01\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:38:01\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:38:01\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-06 16:38:01\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:38:01\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:38:01\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:38:01\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-06 16:38:01\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:44:09\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-27 15:11:20\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-27
15:14:23\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-27 15:14:23\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-27 15:14:23\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-27 15:14:23\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-27
15:14:23\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-27 15:14:23\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:44:09\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:44:09\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:44:09\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-06 16:44:09\"}, {\"product_id\": \"1676143162946052098\",
\"received_date\": \"2023-11-06 16:44:09\"}, {\"product_id\":
\"1676143162946052098\", \"received_date\": \"2023-11-06 16:44:09\"},
{\"product_id\": \"1676143162946052098\", \"received_date\": \"2023-11-06
16:44:09\"}, {\"product_id\": \"1676143162946052098\", \"received_date\":
\"2023-11-28 14:57:57\"}]",
8 "sql": "SELECT product_id, received_date FROM asset WHERE product_id =
'1676143162946052098' AND lot_id = '1721334815214608386';",
9 "status": "success",
10 "tokens": 1599
11 }

结果:返回结果中少了批次号
测试2 - 查询资产最晚入库时间

1 {
2 "table": "asset",
"query": "关联产品为1676143162946052098批次ID为1721334815214608386的资产的关联产品
批次ID和最晚接收时间是多少?"
3

4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\", \"lot_id\":
\"1721334815214608386\", \"latest_received_date\": \"2023-11-28 14:57:57\"}]",
8 "sql": "SELECT product_id, lot_id, MAX(received_date) AS
latest_received_date FROM asset WHERE product_id = '1676143162946052098' AND
lot_id = '1721334815214608386' GROUP BY product_id, lot_id;",
9 "status": "success",
10 "tokens": 1620
11 }

结果:输出正确
测试3 - 查询资产最早入库时间

1 {
2 "table": "asset",
"query": "关联产品为1676143162946052098批次ID为1721334815214608386的资产的关联产品
批次ID和最早接收时间是多少?"
3

4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\",
\"earliest_received_date\": \"2023-11-06 16:31:32\"}]",
8 "sql": "SELECT product_id, MIN(received_date) AS earliest_received_date
FROM asset WHERE product_id = '1676143162946052098' AND lot_id =
'1721334815214608386' GROUP BY product_id;",
9 "status": "success",
10 "tokens": 1614
11 }
结果:输出正确

4. 查询在库数量前5的物料号及数量
测试1

1 {
2 "table": "asset",
3 列出在手资产数量最多的5项关联产品及在手资产数量"
"query": "
4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143161750675458\",
\"total_quantity_on_hand\": 311.0}, {\"product_id\": \"1676143163277402114\",
\"total_quantity_on_hand\": 174.0}, {\"product_id\": \"1676143161981362178\",
\"total_quantity_on_hand\": 90.0}, {\"product_id\": \"1676143163067686914\",
\"total_quantity_on_hand\": 40.0}, {\"product_id\": \"1676143162946052098\",
\"total_quantity_on_hand\": 32.0}]",
8 "sql": "SELECT product_id, SUM(quantity_on_hand_total) AS
total_quantity_on_hand FROM asset WHERE product_id IS NOT NULL GROUP BY
product_id ORDER BY total_quantity_on_hand DESC LIMIT 5;",
9 "status": "success",
10 "tokens": 1585
11 }

结果:输出正确

5. 查询入库时间超过6个月的所有物料批次
测试1 - 时间超过6个月

1 {
2 "table": "asset",
3 列出接收时间超过6个月的设施ID关联产品批次ID在手资产数量接收时间和在库时长"
"query": "
4 }
5

6 {
7 "query_result": "[]",
8 "sql": "SELECT facility_id, product_id, lot_id,
quantity_on_hand_total, received_date, AGE(NOW(), received_date) AS
time_in_stock FROM asset WHERE received_date < NOW() - INTERVAL '6
months';",
9 "status": "success",
10 "tokens": 1718
11 }

结果:输出正确
测试2 - 时间超过2个月(30天)

1 {
2 "table": "asset",
3 列出接收时间超过30天的设施ID关联产品批次ID在手资产数量接收时间和在库时长"
"query": "
4 }
5

6 {
7 "query_result": "[]",
8 "sql": "SELECT facility_id, product_id, lot_id,
received_date, AGE(NOW(), received_date) AS in_stock_duration FROM
asset WHERE 设备
asset_type_enum_id = ' ' AND received_date < NOW() -
INTERVAL '30 days';",
9 "status": "success",
10 "tokens": 1621
11 }

结果:返回结果缺少资产数量,where条件中多了asset_type_enum_id = '设备'
6. 查询某几个物料的库存总数,并按一定比例(1:2)计算成套率
成套率计算公式待定

7. 查询某个供应商的库存总价值
问题
供应商信息需要关联lot、organization表获取
库存总价值怎么描述给GPT,直接输入库存总价值还是拆解开描述计算公式?
测试

1 {
2 "table": "asset",
3 列出关联产品为1676143162946052098的库存总价值"
"query": "
4 }
5

6 {
7 "query_result": "[{\"total_stock_value\": null}]",
8 "sql": "SELECT SUM(quantity_on_hand_total * acquire_cost) AS
total_stock_value FROM asset WHERE product_id = '1676143162946052098' AND
asset_type_enum_id = 'INVENTORY';",
9 "status": "success",
10 "tokens": 1581
11 }

结果:有点出乎预料,GPT理解了库存总价值,准确的将库存总价值转换为quantity_on_hand_total *
acquire_cost这一计算公式;但查询条件中的asset_type_enum_id是枚举值,准确的应该是
asset_type_enum_id = 'AstTpInventory'

8. 查询单价前三的物料的库存总数量
测试1

1 {
2 "table": "asset",
3 列出单价前三的关联产品及在手资产数量总和"
"query": "
4 }
5

6 {
7 "error": "(psycopg.errors.GroupingError) column \"asset.acquire_cost\" must
appear in the GROUP BY clause or be used in an aggregate function\nLINE 1:
...oduct_id IS NOT NULL GROUP BY product_id ORDER BY acquire_co...\n
^\n[SQL: SELECT product_id,
SUM(quantity_on_hand_total) AS total_quantity_on_hand FROM asset WHERE
product_id IS NOT NULL GROUP BY product_id ORDER BY acquire_cost DESC LIMIT
3;]\n(Background on this error at: https://sqlalche.me/e/20/f405)",
8 "sql": "SELECT product_id, SUM(quantity_on_hand_total) AS
total_quantity_on_hand FROM asset WHERE product_id IS NOT NULL GROUP BY
product_id ORDER BY acquire_cost DESC LIMIT 3;",
9 "status": "error",
10 "tokens": 1580
11 }

结果:sql语法有误

9. 查询某个库位的库存信息
测试1

1 {
2 "table": "asset",
3 列出库位ID为1D1的资产的库位ID关联产品批次ID和在手资产数量"
"query": "
4 }
5

6 {
7 "query_result": "[{\"asset_id\": \"1699674207218114562\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1699661406785314817\", \"quantity_on_hand_total\": 0.0},
{\"asset_id\": \"1699674207180365826\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1699661406785314817\",
\"quantity_on_hand_total\": 0.0}, {\"asset_id\": \"1721441675938701313\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1721334815214608386\", \"quantity_on_hand_total\": 1.0},
{\"asset_id\": \"1721441675993227266\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1721334815214608386\",
\"quantity_on_hand_total\": 1.0}, {\"asset_id\": \"1721441676022587393\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1721334815214608386\", \"quantity_on_hand_total\": 1.0},
{\"asset_id\": \"1721441676043558914\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1721334815214608386\",
\"quantity_on_hand_total\": 1.0}, {\"asset_id\": \"1721441676064530434\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1721334815214608386\", \"quantity_on_hand_total\": 1.0},
{\"asset_id\": \"1721441676085501953\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1721334815214608386\",
\"quantity_on_hand_total\": 1.0}, {\"asset_id\": \"1721441676169388034\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1721334815214608386\", \"quantity_on_hand_total\": 1.0},
{\"asset_id\": \"1721441676194553858\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1721334815214608386\",
\"quantity_on_hand_total\": 1.0}, {\"asset_id\": \"1699674207251668993\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1699661406785314817\", \"quantity_on_hand_total\": 0.0},
{\"asset_id\": \"1699674207285223425\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1699661406785314817\",
\"quantity_on_hand_total\": 0.0}, {\"asset_id\": \"1699674207318777857\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1699661406785314817\", \"quantity_on_hand_total\": 0.0},
{\"asset_id\": \"1699674207343943682\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1699661406785314817\",
\"quantity_on_hand_total\": 0.0}, {\"asset_id\": \"1699674207373303809\",
\"location_seq_id\": \"1D1\", \"product_id\": \"1676143161750675458\",
\"lot_id\": \"1699661406785314817\", \"quantity_on_hand_total\": 0.0},
{\"asset_id\": \"1699674207125839873\", \"location_seq_id\": \"1D1\",
\"product_id\": \"1676143161750675458\", \"lot_id\": \"1699661406785314817\",
\"quantity_on_hand_total\": 1.0}]",
8 "sql": "SELECT asset_id, location_seq_id, product_id, lot_id,
quantity_on_hand_total FROM asset WHERE location_seq_id = '1D1';",
9 "status": "success",
10 "tokens": 1582
11 }

结果:输出正确

10. 查询某个序列号的库位信息
测试1

1 {
2 "table": "asset",
3 列出序列号为05232500456#_0的资产的关联产品序列号在手资产数量库位ID和接收时间"
"query": "
4 }
5

6 {
7 "query_result": "[]",
8 "sql": "SELECT a.serial_number, a.quantity_on_hand_total,
a.location_seq_id, a.received_date FROM asset a WHERE a.original_serial_number
= '05232500456#_0';",
9 "status": "success",
10 "tokens": 1596
11 }

结果:输出不正确,跟表中另一字段original_serial_number(原始序列号)混起来了
测试2
1 {
2 "table": "asset",
3 列出设备编号为05232500456#_0的资产的关联产品序列号在手资产数量库位ID和接收时
"query": "
间"
4 }
5

6 {
7 "query_result": "[{\"product_id\": \"1676143162946052098\",
\"serial_number\": \"05232500456#_0\", \"quantity_on_hand_total\": 1.0,
\"location_seq_id\": \"2D3\", \"received_date\": \"2023-11-06 16:31:32\"}]",
8 "sql": "SELECT product_id, serial_number, quantity_on_hand_total,
location_seq_id, received_date FROM asset WHERE serial_number =
'05232500456#_0';",
9 "status": "success",
10 "tokens": 1591
11 }

结果:输出正确

You might also like