根据不断变化的需求记录每日检查结果

发布于 2024-10-07 15:01:21 字数 654 浏览 3 评论 0原文

我对这个标题表示歉意,但我想不出更好的方式来问这个问题。

基本上,我需要创建一个数据库模型来记录各种设备的日常检查和参数。用户每天都会打开一个表单,它会列出一些要检查的任务,并要求记录操作参数(例如温度)。然后,用户输入参数并标记有问题的任何项目。

我对此进行建模时遇到的问题是,要检查的项目可能会随着操作需求的变化而变化。我们可能需要添加或删除一些内容来检查以保持相关性。

我真的没有太多示例数据可以展示,因为我不知道该走哪条路。我能想到的一件事是保留某种版本号,但我不确定它在数据库中会是什么样子。我唯一能想到做的另一件事是生成结果的硬拷贝 PDF 并保存它,而不是将结果保存在数据库中。这样我就不必担心添加/删除项目,因为以前的日常检查不会存储在数据库中,因此不会受到影响。这可能会很好地满足我们的需求,因为我们不必在完成后返回并更改任何内容,但我不禁想到还有更好的方法。

如果您需要任何说明,请告诉我,并感谢您提供的任何帮助。

编辑(更多信息)
现在我们对每个设备都有一个空白的 Excel 表,它有一个检查列表......其中一个是“液压油的常规清理”,或“检查异常噪音/振动”,然后有几个狡猾地说“液压 (psi)”,您必须输入您记录的压力...平均大约有 20 个任务。然后你把你的名字写在纸上,注明日期,打印出来并签名……它被填满了,可能再也见不到了……

I apologize for the title, but I couldn't think of a better way to ask this question.

Basically, I need to create a database model for logging daily checks and parameters on various pieces of equipment. Every day the user will open up a form, it will list a number of tasks to check as well ask for operating parameters to be recorded (for example, temperature). The user then enters the parameters and flags any item that has an issue.

The issue I have with modeling this is the fact that the items to check can change as operational requirements change. We may need to add or remove things to check to keep things relevant.

I don't really have much example data to show as I am stumped about which way to go. One thing I can think of is keeping some sort of version number but I'm not sure how that would look in a database. The only other thing I could think to do is generate a hard copy PDF of the results and save that, rather than saving the results in the database. That way I don't have to worry about adding/removing items because previous daily checks will not be stored in the database and therefore won't be impacted. This would probably work fine for our needs as we don't have to go back and change anything after it's done, but I can't help to think there is a better way.

Let me know if you need any clarification and thanks for any help you can provide.

Edit (More Information)
Right now we have a blank excel sheet for each device, it's got a list of checks... one is say "General cleanup of hydraulic fluid", or "Check for abnormal noise/vibration" then there are a couple that wily say "Hydraulic Pressure (psi)" and you have to enter the pressure you recorded... there's probably about 20 tasks on average. You then put your name on the sheet, date it, print it and sign it.. it gets filled probably to never be seen again....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别挽留 2024-10-14 15:01:21

Cam,

这是我提出的模型/表格和数据列表。我认为它涵盖了您可能用于从应用程序中获取数据的大部分场景/查询。

设备表和检查表是两个独立的实体,分别具有设备和检查的主清单。

设置

每当您必须为给定设备设置一系列检查时,您都会在 Equipment_check_asc 表中插入一条新记录。由于这些关联/检查是基于时间的,因此我们有一个有效日期和结束日期来确定在给定时间点需要进行哪些检查,并保留该时间点强制执行的检查的历史记录。

实际日志记录

进行的实际检查是使用子表 (equipment_check_audit) 完成的,该子表记录了给定日期(无论何时进行)对每台设备进行的检查。

您可以从下面的模型中轻松回答以下问题,这些是我能想到的。

a) 截至目前,该设备需要进行哪些检查?

b) 截至给定日期,设备需要进行哪些检查

c) 在所需检查中,执行了多少次,未执行多少次(今天和任何给定日期)。

d) 在执行的检查中,通过/失败的次数。

alt text

create table equipment(
   equipment_id number primary key,
   equipment_name varchar2(200) not null
   );

create table checks(
   checkid number primary key,
   check_name varchar2(100) not null
  );

create table equipment_check_asc(
   equipment_check_asc_id number primary key,
   equipment_id number not null,
   checkid number not null,
   eff_date date not null,
   end_date date ,
   eff_flag varchar2(1) not null, -- kind of redundant, easier to find the checks effective today.
   constraint fk_equipment_id foreign key (equipment_id) references equipment(equipment_id),
   constraint fk_checkid      foreign key (checkid) references checks(checkid),
   constraint unq_check       unique (equipment_id,checkid,eff_date)
);

create table equipment_check_audit(
    audit_id number primary key,
    equipment_check_asc_id number not null,
    pass_fail_ind varchar2(1) not null,
    audit_date date not null,
    constraint fk_check_id foreign key (equipment_check_asc_id ) references 
       equipment_check_asc (equipment_check_asc_id)
);

可能还有您可能需要覆盖和建模的其他极端情况,但这应该给您一个总体思路。

这是我测试过的数据。

insert into equipment values (1, 'Item 1');
insert into equipment values (2, 'Item 2');
commit;

insert into checks values (100, 'Temperature');
insert into checks values (101, 'Robustness' );
insert into checks values (102, 'Stable'     );
commit;

insert into equipment_check_asc values (1000,1,100,sysdate-10, NULL , 'Y');
insert into equipment_check_asc values (1001,1,101,sysdate-10, NULL , 'Y');
insert into equipment_check_asc values (1002,1,102,sysdate-2 , NULL , 'Y');

insert into equipment_check_asc values (1003,2,100,sysdate-30,  sysdate-1 , 'N');
insert into equipment_check_asc values (1004,2,101,sysdate-30,  NULL    , 'Y');

commit;

delete from equipment_check_audit;

/*** Item A ***/

---checks made on 12/09
insert into equipment_check_audit values (10000, 1000, 'Y', sysdate-5);
---insert into equipment_check_audit(10000, 1000, 'Y', sysdate-5); No checks made on robustness even when it was needed.
-- no check done on stability. (as it was not needed).

---checks made today. (all positives case)
insert into equipment_check_audit values (10001, 1000, 'Y', sysdate);
insert into equipment_check_audit values (10002, 1001, 'N', sysdate);
insert into equipment_check_audit values (10003, 1002, 'Y', sysdate);
commit;

/*** Item B ***/
--checks made on 12/9
insert into equipment_check_audit values (10004, 1003, 'Y', sysdate-5);
--checks made today.
insert into equipment_check_audit values (10005, 1004, 'Y', sysdate);
commit;

Cam,

Here is the model/ the list of tables and data that I came up with. I think it covers most of the scnerios/queries that you might use for getting data out of the application.

Equipment table and check tables are two independent entities having the master list of equipment and checks respectively.

Setup

Whenever you have to set up a series of checks for a given equipment, you will insert a new record in the equipment_check_asc table. Since these associations/ checks are time-based, we have an effective date and end-date to determine what are the checks needed at a given point in time and also to keep a historical track of what checks were mandated at that point in time.

Actual Logging

The actual checks that are made are done using a child table (equipment_check_audit) that records the checks made for each equipment for a given day (whenever they are made).

You can answer the following queries easily from the below model and these are the ones that I could think of.

a) What are the checks needed for this equipment as of today?

b) What were the checks needed for an equipment as of given date

c) Of the required checks, how many were performed and how many were not ( today and any given day ).

d) Of the checks performed, how many passed / failed.

alt text

create table equipment(
   equipment_id number primary key,
   equipment_name varchar2(200) not null
   );

create table checks(
   checkid number primary key,
   check_name varchar2(100) not null
  );

create table equipment_check_asc(
   equipment_check_asc_id number primary key,
   equipment_id number not null,
   checkid number not null,
   eff_date date not null,
   end_date date ,
   eff_flag varchar2(1) not null, -- kind of redundant, easier to find the checks effective today.
   constraint fk_equipment_id foreign key (equipment_id) references equipment(equipment_id),
   constraint fk_checkid      foreign key (checkid) references checks(checkid),
   constraint unq_check       unique (equipment_id,checkid,eff_date)
);

create table equipment_check_audit(
    audit_id number primary key,
    equipment_check_asc_id number not null,
    pass_fail_ind varchar2(1) not null,
    audit_date date not null,
    constraint fk_check_id foreign key (equipment_check_asc_id ) references 
       equipment_check_asc (equipment_check_asc_id)
);

There might be other corner cases that you might need to cover and model for, but this should give you a general idea.

Here is the data that I tested with.

insert into equipment values (1, 'Item 1');
insert into equipment values (2, 'Item 2');
commit;

insert into checks values (100, 'Temperature');
insert into checks values (101, 'Robustness' );
insert into checks values (102, 'Stable'     );
commit;

insert into equipment_check_asc values (1000,1,100,sysdate-10, NULL , 'Y');
insert into equipment_check_asc values (1001,1,101,sysdate-10, NULL , 'Y');
insert into equipment_check_asc values (1002,1,102,sysdate-2 , NULL , 'Y');

insert into equipment_check_asc values (1003,2,100,sysdate-30,  sysdate-1 , 'N');
insert into equipment_check_asc values (1004,2,101,sysdate-30,  NULL    , 'Y');

commit;

delete from equipment_check_audit;

/*** Item A ***/

---checks made on 12/09
insert into equipment_check_audit values (10000, 1000, 'Y', sysdate-5);
---insert into equipment_check_audit(10000, 1000, 'Y', sysdate-5); No checks made on robustness even when it was needed.
-- no check done on stability. (as it was not needed).

---checks made today. (all positives case)
insert into equipment_check_audit values (10001, 1000, 'Y', sysdate);
insert into equipment_check_audit values (10002, 1001, 'N', sysdate);
insert into equipment_check_audit values (10003, 1002, 'Y', sysdate);
commit;

/*** Item B ***/
--checks made on 12/9
insert into equipment_check_audit values (10004, 1003, 'Y', sysdate-5);
--checks made today.
insert into equipment_check_audit values (10005, 1004, 'Y', sysdate);
commit;
作妖 2024-10-14 15:01:21

我建议可能将其分解为组件......因此每个设备都有一个“任务”列表,然后可以创建这些任务中的每一个,甚至可以在多个设备上重用(如果您有共性)。这样,如果需求发生变化,您只需创建新任务。开发一个在编辑和显示最终结果方面看起来不错的 UI 可能需要一些麻烦,但出于建模目的,我认为这就是正确的方法。

我将创建一个表来存储设备实例,一个表来存储任务实例,然后您将拥有另一个连接日期、设备和任务的表。如果某个特定任务本身发生变化,您可以选择对其进行设计,使其可编辑。

What I would suggest is maybe breaking it down into components...so each device has a list of "tasks" and then each one of these tasks can be created and even reused across multiple devices if you have commonalities. That way if the requirements change you can just create new tasks. It might take a bit of fiddling to develop a UI that looks nice as far as editing and displaying the end result but for modeling purposes i'd say that's the way to go.

I would create a table to store instances of devices, a table to store instances of tasks, and then you would have one other table that connected dates,devices, and tasks. And if a particular task changes itself you have the option of designing it so that way it would be editable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文