Skip to content

Self-Hosted Database

Usage Notes

You provide the host/port/database/username/password, and we will push real-time data from your account to this database.

This method will automatically create tables in your database, requiring your database to allow public network access.

  • Data tables are fully overwritten during updates. Partial user-added data in the same table is not supported.
  • Do not create tables in the database with the same names as CaoLiao tables, as they will be identified as CaoLiao tables and fully overwritten.
  • Database type: MySQL 5.7
  • Synchronizes all QR code information, form records, status details, plan completion details, etc., in real time.
  • Tables are only created if there are batch templates or forms with submitted data.
  • If firewall or other access restrictions exist, add the IP whitelist.

Reference: Download MySQL 5.7 Database

Data Table Descriptions

1. base_codeinfo Basic QR Code Information Table

Description: Pushed when the account has QR code information, including dynamic QR codes and template sub-codes.

Field NameTypeDescriptionExample
code_idintUnique identifier for the QR code67654543
QR Code NamestringName of the QR codeFire Hydrant 01
QR Code TypestringTypes: dynamic QR code, template sub-code, or template codeTemplate Sub-Code
urlstringQR code URLhttp://qr61.cn/o2eikt/q85Q8KL
tpl_code_idintBatch template ID for sub-codes
For non-template sub-codes, same as code_id
56335353
Template NamestringBatch template name for sub-codes
For non-template sub-codes, same as QR code name
Fire Hydrant
DirectorystringName of the last-level directory where the QR code is located (excludes higher-level directories)Firefighting Equipment
Tag SetstringGrouping set for the QR codeFirefighting, Equipment

Directory Information: Shows the last-level directory where the QR code is located, excluding higher-level directories.

2. code_state QR Code Status Table

Description: Pushed when QR codes have associated statuses. View Status Feature

Status data for QR codes created before enabling this feature will not be pushed. Contact customer support for manual synchronization if needed.

Field NameTypeDescriptionExample
code_idintUnique identifier for the QR code67654543
member_idintUnique identifier for the member2091263
auth_idintUnique identifier for the submitter12789054
Update TimedatetimeTime of status update2020-11-20 15:00:00
Example: Equipment Status_720stringStatus group name, where "_720" is an auto-generated identifier to prevent duplicatesNormal
......stringAll status groups under the account are listed hereAbnormal

3. code_state_log QR Code Status Change Log Table

Description: Pushed when QR codes have associated statuses. Each status change is recorded here. Historical status changes before enabling the database will not be pushed.

Field NameTypeDescriptionExample
code_idintUnique identifier for the QR code67654543
member_idintUnique identifier for the member2091263
auth_idintUnique identifier for the submitter12789054
Update TimedatetimeTime of status update2020-11-20 15:00:00
Status GroupstringName of the status groupEquipment Status
Status ValuestringCurrent status of the groupNormal
Change MethodstringHow the status was changed: via form submission or manual editRecord/Edit
SourcestringFor record-based changes, the unique identifier of the form data12220988

4. table_dXX Forms Data Detail Table

Description: Pushed when form data is submitted under the account. Forms data tables start with "table_" followed by a number (the form's unique ID), e.g., table_d45. Each form corresponds to one table. View Forms Feature

file

Field NameTypeDescriptionExample
record_idintUnique identifier for the form data12220988
code_idintUnique identifier for the QR code67654543
tpl_code_idintFor template sub-codes: batch template ID
For non-template sub-codes: same as code_id
54349863
QR Code NamestringName of the QR codeFire Hydrant 01
tpl_idintUnique identifier for the form346636
Form NamestringName of the formFire Hydrant Inspection
Record TimedatetimeTime of form data submission2020-11-20 15:20:00
StatusstringCurrent status of the record: includes whether deleted or approvedNormal/Deleted/Pending Approval/Approved/Rejected
member_idintUnique identifier for the collaborating member2091263
auth_idintUnique identifier for the submitter12789054
Record IDstringID of the form dataL1234
Processing StatusstringProcessing status of the form dataPending/Completed/Not Required/Unmarked
Creation SourcestringIncludes mobile scan-to-fill or manual notesMobile Scan-to-Fill/Manual Notes
Source IDstringFor manual notes, the record ID of the original recordL1235
Submission IDstringCustom submission ID from CaoLiao backend11
Processing Status Update TimedatetimeTime of processing status change2020-11-20 15:20:00
Example: Equipment NamestringName of the form componentInspection Item 1
......stringAll form component names are displayed

Form Component Push Details:

  1. Numeric components do not display units.
  2. For checkbox components: 0=unfilled; 1=checked (√); 2=crossed (×); 3=unselected. Custom names for "√" or "×" are not displayed; values remain 0, 1, 2, or 3.
  3. Descriptions and images added to checkbox components are not pushed.
  4. Location components push three fields: location text, latitude, and longitude.
  5. Description components are pushed with the component title as the field name and the content as the value.
  6. Group header components are not pushed.
  7. ID card components are split into multiple fields: ID card info (empty), ID number, name, gender, ethnicity, birth date, and address.

5. base_table_data Forms Data Summary Table

Description: Pushed when form data is submitted under the account. This table summarizes common fields across all form records, such as QR code name, recorder, and form name.
Use Case: For example, if there are "entry" and "exit" forms, this table allows accessing all data without aggregating the two tables.

Field NameTypeDescriptionExample
record_idintUnique identifier for the form data12220988
code_idintUnique identifier for the QR code67654543
tpl_code_idintFor template sub-codes: batch template ID
For non-template sub-codes: same as code_id
56335353
tpl_idintUnique identifier for the form346636
QR Code NamestringName of the QR codeFire Hydrant 01
Form NamestringName of the formFire Hydrant Inspection
Record TimedatetimeTime of form data submission2020-11-20 12:01:02
RecorderstringName of the submitterLi Si
member_idintUnique identifier for the member2091263
auth_idintUnique identifier for the submitter12789054
StatusstringCurrent status of the record: includes whether deleted or approvedNormal/Deleted/Pending Approval/Approved/Rejected
Record IDstringID of the recordL1234

6. template_codeinfo_XXX Batch Template Sub-Code Information Table

Description: Pushed when batch templates generate sub-codes under the account. This table mainly displays variable content for batch sub-codes. View Bulk QR Codes Generation Feature

Table names start with "template" followed by the batch template ID, which has two historical naming conventions.

6.1 Naming Rules:

  • Method 1: Suffix is dXX, where XX is the batch template number.
    Example: If the batch template ID is M312, the table name is template_codeinfo_D312.

file

  • Method 2: Suffix is the internal batch template ID.
    Edit the batch template and extract the ID from the URL, as shown below:

file

6.2 Data Field Descriptions:

Field NameTypeDescriptionExample
code_idintUnique identifier for the QR code67654543
tpl_code_idintUnique identifier for the batch template56335353
StatusstringWhether the sub-code is deletedNormal
...stringFields below represent variable content in the batch template

7. record_review_data Follow-Up Actions Data Table

Description: Pushed when follow-up actions are added or processing statuses are marked for form records. View Follow-Up Actions Feature

Field NameTypeDescriptionExample
review_idintUnique identifier for the follow-up action record67654543
record_idintUnique identifier for the associated form record12220988
StatusstringWhether the follow-up action record is deletedNormal/Deleted
SourcestringSource of the follow-up actionManual Entry/Forwarded Record/Forwarded to WeCom Colleague/Status Change/Form Submission/Notification/Comment Reply
Text ContentstringSpecific content of the comment or status changeUpdated record to 【Completed】/@Zhang San/【Image】...
Key ContentstringUpdated processing status or form data ID for follow-up form submissionsCompleted/12220988
AttachmentsstringMultimedia files (images, audio, signatures) submitted with follow-up actions
SubmitterstringName of the submitterZhang San
Submission TimedatetimeTime of follow-up action submission2020-11-20 15:20:00

8. base_task Plan Basic Information Table

Description: Pushed when plans are created and executed under the account. Plan Management Feature

Field NameTypeDescriptionExample
task_idintUnique identifier for the plan33886
Plan NamestringName of the planMonthly Fire Extinguisher Inspection
DescriptionstringPlan description

9. code_task_log Plan Execution Details Table

Description: Pushed when plans are created and executed under the account. Only current and future cycle data are pushed; historical cycle data are not included.

This table lacks QR code names. Link with base_codeinfo or template_XXX to expand QR code information.

Field NameTypeDescriptionExample
log_idintUnique identifier for the current plan task239168567
task_idintUnique identifier for the plan33886
Plan NamestringName of the planMonthly Fire Extinguisher Inspection
code_idintUnique identifier for the QR code67654543
StatusstringExecution status for the cycleOptions:
Completed/Incomplete/Nearing Deadline/
Completed After Deadline/Incomplete After Deadline
Start TimedatetimeStart time of the plan cycle2020-12-10 12:00:00
Execution TimedatetimeTime of status change2020-12-10 13:00:00
DeadlinedatetimeEnd time for the QR code in this cycle2020-12-10 18:00:00
Is FilteredstringWhether filtered based on "No Inspection Required" conditionsOptions: Yes/No
Change MethodstringMethod of status changeRecord
SourceintFor record-based changes, the unique identifier of the form data12220988
Source Record ResultstringFor record-based changes, the result of the form dataEquipment Normal

10. code_tags QR Code Grouping Table

Description: Pushed when grouping is used and QR codes are added to groups. View Group Management Feature

Field NameTypeDescriptionExample
code_idintUnique identifier for the QR code67654543
Example: Building 1 Fire ExtinguishersintGroup name. If the QR code is in this group, the value is 11
Example: Building 2 Fire ExtinguishersintGroup name1
......intAll groups under the account are listed here

11. base_members Member Information Table

Description: Pushed when advanced members are added under the account. Only advanced member information is synchronized; basic member information is not pushed. View Members Feature

Field NameTypeDescriptionExample
member_idintUnique identifier for the collaborating member2091263
NamestringName of the collaborating memberZhang San
Phone NumberstringPhone number of the collaborating member135xxxx8934

12. base_auth_msg Submitter Information Table

Description: Pushed when form records are submitted or statuses are updated. Submitters are those who fill out forms or change statuses. View Submitter Component

  1. If no form is filled, only auth_id is displayed.
  2. If a form is filled but no submitter component is used, only auth_id is displayed, with the name as "WeChat User XXXX."
  3. If a form is filled with submitter components (name, phone, employee ID, license plate, ID card, etc.), the corresponding field data is displayed.
Field NameTypeDescriptionExample
auth_idintUnique identifier for the submitter12789054
NamestringName of the submitterLi Si
Phone NumberstringPhone number of the submitter135xxxx8934
Employee IDstringEmployee ID of the submitterD234
License PlatestringLicense plate of the submitterZheA.12342
ID CardstringID card of the submitter343xxxxxxxxxxxxx

13. record_audit_data Record Approval Work Order Table

Description: Pushed when records are submitted for approval or approved/rejected. View Approval Feature

Field NameTypeDescriptionExample
auth_idintUnique identifier for the approval work order9001
record_idintUnique identifier for the associated record1001
StatusstringWhether the work order is approvedPending Approval/Approved/Rejected
Approval TitlestringTitle for multi-level approval settings (empty for single-level)Finance Review
Assigned ApproverstringApprover assigned by the submitter or previous approver (empty if unassigned)Zhang San
ApproverstringActual approverZhang San
Approval TimedatetimeTime of approval2024-09-20 15:20:00
Approval SignaturestringURL of the approver's signature image (empty if unsigned)https://ncstatic.clewm.net/rsrc/2024/1015/15/c12d5af513b275ba2465f923557a1f7c.png
Approval ReplystringApprover's reply (empty if none)Submission does not meet requirements
Creation TimedatetimeTime of work order creation2024-09-20 10:20:00

Event Push Details

1. Dynamic QR Codes

EventPushed?Affected TablesData Behavior