A query implementation method with comparison operator control
By defining a control with comparison characters in the query interface, the problem of cumbersome interaction between query and filtering functions in the existing technology is solved, and users can quickly locate data and simplify filtering operations, meeting the needs of users to flexibly switch filtering methods.
Patent Information
- Application Number
- CN202210311695.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In the prior art, the query and filtering functions are complicated to interact and occupy a large page space, so it is impossible to remember the frequency of user's query scheme and query conditions.
Using the query implementation method with a comparison character control, define a control with a comparison character in the query interface, obtain input information, select comparison symbols, and cut the parameter content into two parts: logical symbol code and filter content, and convert it into SQL comparison symbols. , spliced into WHERE filter conditions.
It realizes users to quickly locate data, simplifies filtering operations, reduces page occupation, and can remember commonly used filtering methods for users to meet users' needs for flexible switching of filtering methods, and improves component reuse rate.
Smart Images

Figure CN114840548B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer applications, and in particular to a query implementation method with a comparison operator control. Background Art
[0002] For any software system, query and filter can be said to be a frequently used form of interaction. When it comes to B-end products, the query and filter logic will be more complicated than that of the mobile end, accompanied by: and relationship, or relationship, greater than, less than, etc., such complex filtering forms also add a lot of difficulty to the design itself. At present, the solution of most systems on the market is to use multiple controls to implement advanced filtering functions. Users need to select filter fields, filter conditions, filter operations, and filter values, such as Figure 1 shown.
[0003] Although this design can also solve the problem of users conducting multi-dimensional keyword searches, it also has problems such as cumbersome interaction with the filtering function, taking up page space, being unable to remember users' query plans, and being unable to remember the frequency of use of page query conditions. Summary of the invention
[0004] In view of the problem of cumbersome functions in current query filtering, the present invention provides a query implementation method with a comparison operator control, which changes the advanced filtering function composed of multiple controls into a control with a comparison operator, thereby ensuring that the overall filtering area will not be too large. At the same time, the filters commonly used by users are placed in the front, which can meet the basic business needs and usage scenarios of users.
[0005] To achieve the above object, the embodiments of the present invention adopt the following technical solutions:
[0006] A query implementation method with a comparison operator control, the query implementation method comprising the following steps:
[0007] Define a control with a comparison operator in the query interface;
[0008] Get the information entered in the query interface;
[0009] Select a comparison symbol or set it as the default comparison symbol, and confirm whether the form and character structure are legal;
[0010] If they are all legal, the parameter content is cut into two parts: the logical symbol code and the filter content;
[0011] Convert the logic symbol code into SQL comparison symbols, and splice it with the filter content into a WHERE filter condition that can be compiled by SQL, and filter the query results to obtain the query results.
[0012] According to one aspect of the present invention, defining a control with a comparison symbol in the query interface includes: adding a comparison symbol in the upper right corner of the filter field to perform a filter operation.
[0013] According to one aspect of the present invention, the filtering operation is configurable, and the corresponding filtering operation is configured according to the control type.
[0014] According to one aspect of the present invention, the comparison operators involved in the screening operation may be set with default values according to actual business scenarios.
[0015] According to one aspect of the present invention, the method of obtaining information inputted in the query interface includes: providing a form input box on the interface, and obtaining specific content filled in the form input box according to the filtering requirements of the query on the interface.
[0016] According to one aspect of the present invention, selecting a comparison symbol or setting it as a default comparison symbol includes: selecting an operator code as a filtering rule in the comparison operator drop-down box in the upper right corner of the form input box, and the content involved in the comparison operator drop-down box is the comparison operators commonly used in SQL syntax.
[0017] According to one aspect of the present invention, the query implementation method includes: submitting a form to background processing in the form of an operation symbol + a separator ($$) + text concatenation.
[0018] According to one aspect of the present invention, the query implementation method includes: if the background receives content containing a separator ($$), it is judged as a parameter with an operation comparison operator, and the parameter content is cut into two parts, a logical symbol code and a filter content, according to the separator.
[0019] According to one aspect of the present invention, the query implementation method includes: if the form is illegal, an error is reported and the form cannot be submitted.
[0020] According to one aspect of the present invention, the query implementation method includes: if the character structure is illegal, an error is reported and the query cannot be submitted.
[0021] Advantages of the present invention:
[0022] 1. It can help users quickly locate data in a vast amount of data;
[0023] 2. Users can locate data according to the filtering method they want. Comparison symbols that are frequently used by users can be set as default values to shorten the time users spend searching for data.
[0024] 3. It can satisfy users' need to flexibly switch different screening methods according to actual business scenarios at work;
[0025] 4. Improve the reuse rate of components;
[0026] 5. The advanced filtering function composed of multiple controls is changed to a control with comparison symbols, which can ensure that the overall filtering area will not be too large. At the same time, the filters commonly used by users are placed in the front, which can meet the user's basic business needs and usage scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A schematic diagram of the background technology of the present invention;
[0029] Figure 2 A schematic diagram of the present invention;
[0030] Figure 3 The present invention is a flowchart of a method for implementing a query with a comparison operator control. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] like Figure 2 and Figure 3 As shown, a query implementation method with a comparison operator control includes the following steps:
[0033] Step S1: define a control with a comparison operator in the query interface;
[0034] Change the advanced filter composed of multiple controls to only one filter field control with a comparison operator, such as Figure 2 shown.
[0035] 1. Add a comparison symbol in the upper right corner of the filter field to perform the filter operation;
[0036] 2. Filter operations can be configured: Configure the corresponding filter operations according to the control type. For example, for text controls, the operators are equal to, not equal to, contains, contains before, contains after; for numeric controls, the operators are greater than, less than, equal to, not equal to;
[0037] 3. The comparison operators involved in the filtering operation can set default values according to the actual business scenario. For example, for the outbound order number control, the default query is fuzzy query, so the default comparison operator can be set to "contains";
[0038] Cancel the filter relationship control (the "and" relationship and "or" relationship between conditions). When two or more filter conditions have values, the default is the and relationship query.
[0039] Step S2: Obtaining information inputted in the query interface;
[0040] The method of obtaining information inputted in the query interface includes: providing a form input box on the interface, and obtaining specific content filled in the form input box according to the filtering requirements of the query on the interface.
[0041] Step S3: Select a comparison symbol or set it as a default comparison symbol, and confirm whether the form and character structure are legal;
[0042] The selection of a comparison symbol or setting it as a default comparison symbol includes: selecting an operator code as a filtering rule in the comparison operator drop-down box in the upper right corner of the form input box, and the content involved in the comparison operator drop-down box is the comparison operator commonly used in SQL grammar. The query implementation method includes: submitting the form to the background processing in the form of operator symbol + separator ($$) + text splicing. If the form is illegal, an error message cannot be submitted. If the character structure is illegal, an error message cannot be submitted.
[0043] Step S4: If all are legal, the parameter content is cut into two parts: the logic symbol code and the filtering content;
[0044] The query implementation method includes: when the backend receives content containing a separator ($$), it is judged as a parameter with an operation comparison operator, and the parameter content is cut into two parts, a logic symbol code and a filtering content, according to the separator.
[0045] Step S5: convert the logic symbol code into SQL comparison symbols, and combine them with the filtering content into a WHERE filtering condition that can be compiled by SQL, and filter the query results to obtain the query results.
[0046] In practical applications, such as Figure 3 As shown, the process of the query implementation method is as follows:
[0047] Step 1: Fill in the specific content in the form input box according to the query filtering requirements on the interface
[0048] Step 2: Select an operator code as the filtering rule in the comparison operator drop-down box in the upper right corner of the form input box. The comparison operator drop-down involves the commonly used comparison operators in SQL syntax, such as '<>=likeNOTIN', etc.
[0049] Step 3: Submit to the background processing in the form of operator + separator ($$) + text concatenation, for example: '<>$$text'.
[0050] Step 4: If the background receives content containing a separator ($$), it is judged as a parameter with an operation comparison operator, and the parameter content is cut into two parts: a logical symbol code and a filter content according to the separator.
[0051] Step 5: After obtaining the logic symbol code and content, convert the logic symbol code into SQL comparison symbols, and splice them with the content into a WHERE filter condition that can be compiled by SQL. Finally, the query results will be filtered to obtain the query results.
[0052] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A query implementation method with a comparison operator control, characterized in that: The query implementation method comprises the following steps: Define a control with a comparison operator in the query interface; Get the information entered in the query interface; Select a comparison symbol or set it as the default comparison symbol, and confirm whether the form and character structure are legal; If they are all legal, the parameter content is cut into two parts: the logical symbol code and the filter content; Convert the logic symbol code into SQL comparison symbols, and combine them with the filter content to form a WHERE filter condition that can be compiled by SQL, and filter the query results to obtain the query results; Wherein, obtaining the information inputted in the query interface includes: providing a form input box on the interface, and obtaining the specific content filled in the form input box according to the filtering requirements of the query on the interface; Selecting a comparison symbol or setting it as the default comparison symbol includes: selecting an operator code as the filtering rule in the comparison operator drop-down box in the upper right corner of the form input box. The comparison operator drop-down box involves the commonly used comparison operators in SQL syntax; The query implementation method includes: submitting a form to a backend for processing in the form of an operation symbol + a separator + a text concatenation; The query implementation method comprises: if the backend receives content containing a separator, it is judged as a parameter with an operation comparison operator, and the parameter content is cut into two parts, a logic symbol code and a filtering content, according to the separator.
2. The query implementation method with a comparison operator control according to claim 1, characterized in that: Defining a control with a comparison symbol in the query interface includes: adding a comparison symbol in the upper right corner of the filter field to perform a filter operation.
3. The query implementation method with a comparison operator control according to claim 2, characterized in that: The filtering operation can be configured according to the control type.
4. The query implementation method with a comparison operator control according to claim 3 is characterized in that: The comparison operators involved in the filtering operation may be set with default values according to actual business scenarios.
5. The query implementation method with a comparison operator control according to claim 1, characterized in that: The query implementation method includes: if the form is illegal, an error is reported and the form cannot be submitted.
6. The query implementation method with a comparison operator control according to claim 1, characterized in that: The query implementation method includes: if the character structure is illegal, an error is reported and the query cannot be submitted.
Citation Information
Patent Citations
Universal selection assisting system and method
CN102411493A
Bill inquiring method and device based on general filtering condition compound assembly
CN102819545A