CN113656036B - Compiling method, device, terminal and medium based on Mybatis - Google Patents

Compiling method, device, terminal and medium based on Mybatis Download PDF

Info

Publication number
CN113656036B
CN113656036B CN202010400992.2A CN202010400992A CN113656036B CN 113656036 B CN113656036 B CN 113656036B CN 202010400992 A CN202010400992 A CN 202010400992A CN 113656036 B CN113656036 B CN 113656036B
Authority
CN
China
Prior art keywords
compiling
compiled
statement
code
mybatis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010400992.2A
Other languages
Chinese (zh)
Other versions
CN113656036A (en
Inventor
鲍朝政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sinosun Technology Co ltd
Original Assignee
Shenzhen Sinosun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sinosun Technology Co ltd filed Critical Shenzhen Sinosun Technology Co ltd
Priority to CN202010400992.2A priority Critical patent/CN113656036B/en
Publication of CN113656036A publication Critical patent/CN113656036A/en
Application granted granted Critical
Publication of CN113656036B publication Critical patent/CN113656036B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a compiling method, a compiling device, a compiling terminal and a readable storage medium based on Mybatis, wherein the compiling method based on Mybatis obtains sentences to be compiled in a current storage file based on Mybatis; determining a target operation function of the statement to be compiled; based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled; and when receiving a confirmation compiling instruction, compiling codes of the statement to be compiled based on the verification parameters. According to the method and the device, the code compiling efficiency based on Mybatis can be improved.

Description

Compiling method, device, terminal and medium based on Mybatis
Technical Field
The present disclosure relates to the field of computer service operation management technologies, and in particular, to a compiling method, device, terminal and computer readable storage medium based on Mybatis.
Background
Currently, the commonly used IDE (Integrated Development Environment ) has no pre-compiling function of codes and no display of pre-compiling results, so after developing the service, a developer needs to deploy the service on a server, compile the service by the server and display the compiling results. When the programming language that constitutes the service is complex, for example, complex sql (Structured Query Language ), the developer is inevitably written with wrong sql statements, and the errors may be logic errors (for example, functions printed by the server log, that is, the output of the sql statements is not the function that the developer originally wants to design), and may also be grammatical errors (for example, field names are not right, punctuation marks are absent, etc.). When the compiling result displayed by the server shows that the sql statement has logic errors or grammar errors, a developer is required to modify the wrong sql statement in the service, and the new service obtained after modification is uploaded to the server again for compiling and displaying the compiling result. It can be seen that the compiling efficiency of the complex code is low at present.
Disclosure of Invention
The main purpose of the present application is to provide a compiling method, device, terminal and computer storage medium based on Mybatis, which aims to solve the technical problem of low compiling efficiency of complex codes in the prior art.
In order to achieve the above objective, an embodiment of the present application provides a compiling method based on Mybatis, where the compiling method based on Mybatis includes:
acquiring a statement to be compiled in a current Mybat-based storage file;
determining a target operation function of the statement to be compiled;
based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled;
and when receiving a confirmation compiling instruction, compiling codes of the statement to be compiled based on the verification parameters.
Optionally, the step of determining the target operation function of the statement to be compiled includes:
displaying alternative functions of the statement to be compiled in a preset mode, wherein the alternative functions comprise functions of the statement to be compiled for user selection operation;
and determining the function selected by the user from the alternative functions as the target operation function of the statement to be compiled.
Optionally, the step of acquiring and displaying the verification parameters of the statement to be compiled based on the target operation function includes:
generating a verification parameter input prompt matched with the target operation function based on the target operation function;
acquiring verification parameters of the statement to be compiled received based on the verification parameter input prompt;
and displaying the verification parameters according to a preset text format.
Optionally, when receiving the confirmation compiling instruction, the step of compiling the code of the statement to be compiled based on the verification parameter includes:
outputting a parameter input identifier when receiving a confirmation compiling instruction;
detecting whether input content exists after the parameter input identification;
if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter;
and acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
Optionally, the step of compiling the code for the statement to be compiled based on the verification parameter includes:
acquiring a preset grammar rule and a preset format rule;
and carrying out grammar analysis and format analysis on the statement to be compiled by combining the verification parameters based on the preset grammar rules and the preset format rules.
Optionally, after the step of performing code compiling on the statement to be compiled based on the verification parameter when receiving the confirmation compiling instruction, the method includes:
generating a code compiling adjustment result based on the updating information when the updating information of the code compiling initial result is received;
and displaying the code compiling and adjusting result.
Optionally, when receiving the confirmation compiling instruction, after the step of compiling the code of the statement to be compiled based on the verification parameter, the method further includes:
when a verification completion instruction is received, outputting a formatting result of the compiling result based on the compiling result of code compiling of the statement to be compiled;
if the compiling result is a code compiling initial result, formatting the code compiling initial result, and displaying a first formatting result of the code compiling initial result;
if the compiling result is the code compiling adjustment result, formatting the code compiling adjustment result, and displaying a second formatting result of the code compiling adjustment result.
The application also provides a code compiling device based on Mybatis, the code compiling device based on Mybatis includes:
the first acquisition module is used for acquiring sentences to be compiled in the current Mybatis-based storage file;
the determining module is used for determining the target operation function of the statement to be compiled;
the second acquisition module is used for acquiring and displaying the verification parameters of the statement to be compiled based on the target operation function;
and the compiling module is used for compiling codes of the statement to be compiled based on the verification parameters when receiving the confirmation compiling instruction.
Optionally, the determining module includes:
the first display sub-module is used for displaying alternative functions of the statement to be compiled in a preset mode, wherein the alternative functions comprise functions of the statement to be compiled, which can be selected and operated by a user;
and the determining submodule is used for determining the function selected by the user in the alternative functions as the target operation function of the statement to be compiled.
Optionally, the second obtaining module includes:
the generation sub-module is used for generating a verification parameter input prompt matched with the target operation function based on the target operation function;
the first acquisition sub-module is used for acquiring the verification parameters of the received statement to be compiled based on the verification parameter input prompt;
and the second display sub-module is used for displaying the verification parameters according to a preset text format.
Optionally, the compiling module includes:
the output sub-module is used for outputting a parameter input identifier when receiving a confirmation compiling instruction;
the detection sub-module is used for detecting whether the input content exists after the parameter input identification;
the second obtaining sub-module is used for extracting the input content after the parameter input identification as the verification parameter if the input content exists after the parameter input identification, and compiling the code of the statement to be compiled based on the verification parameter;
and the third acquisition sub-module is used for acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
Optionally, the second acquisition submodule includes:
the acquisition unit is used for acquiring a preset grammar rule and a preset format rule;
and the analysis unit is used for carrying out grammar analysis and format analysis on the statement to be compiled based on the preset grammar rule and the preset format rule and combining the verification parameters.
Optionally, the Mybatis-based code compiling device further includes:
the updating module is used for generating a code compiling adjustment result based on the updating information when receiving the updating information of the code compiling initial result;
and the display module is used for displaying the code compiling and adjusting result.
Optionally, the Mybatis-based code compiling device further includes:
the result output module is used for outputting a formatting result of the compiling result based on the compiling result of compiling the code of the statement to be compiled when receiving a verification completion instruction;
the first formatting module is used for formatting the code compiling initial result if the compiling result is the code compiling initial result and displaying the first formatting result of the code compiling initial result;
and the second formatting module is used for formatting the code compiling and adjusting result if the compiling result is the code compiling and adjusting result and displaying a second formatting result of the code compiling and adjusting result. The application also provides a terminal, the terminal includes: the system comprises a memory, a processor and a Mybat-based code compiler stored on the memory and executable on the processor, wherein the Mybat-based code compiler realizes the steps of the Mybat-based compiling method when being executed by the processor.
The present application also provides a computer storage medium having stored thereon a Mybatis-based code compiler which when executed by a processor implements the steps of the Mybatis-based compiling method as described above.
The application discloses a compiling method, a compiling device, a compiling terminal and a compiling computer readable storage medium based on Mybatis, wherein the compiling method based on Mybatis acquires sentences to be compiled in a current storing file based on Mybatis; determining a target operation function of the statement to be compiled; based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled; and when receiving a confirmation compiling instruction, compiling codes of the statement to be compiled based on the verification parameters. After the developer develops the service, the developer does not need to deploy the developed service on the server, the server compiles the service and displays the compiling result, the developed service can be precompiled in advance, and the precompiled result is displayed, so that the developer can check the service and correct writing errors according to the precompiled display result, and the code compiling efficiency based on Mybatis is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic hardware structure of an optional terminal according to an embodiment of the present application;
FIG. 2 is a flowchart of a first embodiment of a Mybatis-based compiling method according to the present application;
FIG. 3 is a flowchart of a second embodiment of a Mybatis-based compiling method according to the present application;
FIG. 4 is a flowchart of a third embodiment of a Mybatis-based compiling method according to the present application;
FIG. 5 is a flowchart of a fourth embodiment of a compiling method based on Mybatis according to the present application;
FIG. 6 is a flowchart of a fifth embodiment of a Mybatis-based compilation method of the present application;
FIG. 7 is a flowchart of a sixth embodiment of a compiling method based on Mybatis according to the present application;
fig. 8 is a schematic diagram of functional modules of a Mybatis-based code compiling apparatus according to the application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present application, and are not of specific significance per se. Thus, "module," "component," or "unit" may be used in combination.
As shown in fig. 1, fig. 1 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present application.
The terminal can be a fixed terminal, such as intelligent equipment of the Internet of things, and comprises intelligent home furnishings including intelligent air conditioners, intelligent electric lamps, intelligent power supplies, intelligent routers and the like; the mobile terminal can also be a mobile terminal, and comprises a plurality of networking devices such as a smart phone, a wearable networking AR/VR device, a smart sound box, an automatic driving automobile and the like.
As shown in fig. 1, the architecture design of the Mybatis-based code compiling terminal includes a node and a server, and the device structure may include: a processor 1001, such as a CPU, memory 1005, and a communication bus 1002. Wherein a communication bus 1002 is used to enable connected communication between the processor 1001 and a memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the Mybatis-based code compiling terminal may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The user interface may include a Display screen (Display), touch screen, camera (including AR/VR devices), etc., and the optional user interface may also include standard wired interfaces, wireless interfaces. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface, bluetooth interface, probe interface, 3G/4G/5G networking communication interface, etc.).
It will be appreciated by those skilled in the art that the Mybatis-based code compilation terminal structure shown in fig. 1 does not constitute a limitation of Mybatis-based code compilation terminals, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, and an early wake-up program may be included in a memory 1005, which is a type of computer storage medium. The operating system is a program for managing and controlling the code compiling terminal hardware and software resources based on Mybatis, and supports the running of the code compiling program based on Mybatis and other software and/or programs. The network communication module is used to implement communication between components within the memory 1005 and other hardware and software in the Mybatis-based code compiling terminal.
In the Mybatis-based code compiling terminal shown in fig. 1, the processor 1001 is configured to execute a Mybatis-based code compiling program stored in the memory 1005, and perform the following operations:
acquiring a statement to be compiled in a current Mybat-based storage file;
determining a target operation function of the statement to be compiled;
based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled;
and when receiving a confirmation compiling instruction, compiling codes of the statement to be compiled based on the verification parameters.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
displaying alternative functions of the statement to be compiled in a preset mode, wherein the alternative functions comprise functions of the statement to be compiled for user selection operation;
and determining the function selected by the user from the alternative functions as the target operation function of the statement to be compiled.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
generating a verification parameter input prompt matched with the target operation function based on the target operation function;
acquiring verification parameters of the statement to be compiled received based on the verification parameter input prompt;
and displaying the verification parameters according to a preset text format.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
outputting a parameter input identifier when receiving a confirmation compiling instruction;
detecting whether input content exists after the parameter input identification;
if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter;
and acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
acquiring a preset grammar rule and a preset format rule;
and carrying out grammar analysis and format analysis on the statement to be compiled by combining the verification parameters based on the preset grammar rules and the preset format rules.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
generating a code compiling adjustment result based on the updating information when the updating information of the code compiling initial result is received;
and displaying the code compiling and adjusting result.
Further, the processor 1001 may call the Mybatis-based code compiler stored in the memory 1005, and further perform the following operations:
when a verification completion instruction is received, outputting a formatting result of the compiling result based on the compiling result of code compiling of the statement to be compiled;
if the compiling result is a code compiling initial result, formatting the code compiling initial result, and displaying a first formatting result of the code compiling initial result;
if the compiling result is the code compiling adjustment result, formatting the code compiling adjustment result, and displaying a second formatting result of the code compiling adjustment result.
Based on the above hardware structure, various embodiments of the Mybatis-based compiling method are provided.
Referring to fig. 2, a first embodiment of a Mybatis-based compiling method according to the present application provides a Mybatis-based compiling method, where the Mybatis-based compiling method includes:
step S10, obtaining a statement to be compiled in a current Mybatis-based storage file;
in the technical scheme disclosed in the application, myBatis is an excellent persistent layer framework supporting common sql queries (Structured Query Language ), storage procedures and high-level mapping. Currently, the commonly used IDE (Integrated Development Environment ) has no pre-compiling function of codes and no display of pre-compiling results, so after developing the service, a developer needs to deploy the service on a server, compile the service by the server and display the compiling results. When the programming language that constitutes the service is complex, for example, a complex sql, the developer is inevitably written with an erroneous sql statement, and the error may be a logic error (for example, a function printed by the server log, that is, the output of the sql statement is not the function that the developer originally wants to design), or may be a grammar error (for example, the field name is not right, punctuation mark is absent, etc.). When the compiling result displayed by the server shows that the sql statement has logic errors or grammar errors, a developer is required to modify the wrong sql statement in the service, and the new service obtained after modification is uploaded to the server again for compiling and displaying the compiling result. It can be seen that the compiling efficiency of the complex code is low at present. Therefore, the technical scheme disclosed by the application provides a compiling method based on Mybatis, which is used for improving the compiling efficiency of codes based on Mybatis.
In the technical scheme disclosed in the application, the statement to be compiled comprises an sql statement, which is a special purpose programming language, and relates to database query and programming for accessing data and querying, updating and managing a relational database system. Storing a file refers to storing a file of a statement to be compiled.
Step S20, determining a target operation function of the statement to be compiled;
in the technical scheme disclosed in the application, the target operation functions of the statement to be compiled comprise functions of parameter addition, parameter deletion, parameter update and the like.
Step S30, based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled;
in the technical scheme disclosed by the application, users such as a developer and the like can input verification parameters of the statement to be compiled according to the target operation function, so that the statement to be compiled is precompiled by a code compiler based on Mybatis.
And step S40, when a confirmation compiling instruction is received, performing code compiling on the statement to be compiled based on the verification parameters.
In the technical scheme disclosed by the application, after users such as a developer and the like input the verification parameters of the statement to be compiled according to the target operation function, the confirmation compiling instruction can be triggered by clicking the confirmation button and the like, so that when the confirmation compiling instruction is received by the code compiling program based on Mybatis, the code compiling of the statement to be compiled can be performed based on the verification parameters.
In the embodiment, acquiring a statement to be compiled in a storage file based on Mybatis currently; determining a target operation function of the statement to be compiled; based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled; and when receiving a confirmation compiling instruction, compiling codes of the statement to be compiled based on the verification parameters. After the developer develops the service, the developer does not need to deploy the developed service on the server, the server compiles the service and displays the compiling result, the developed service can be precompiled in advance, and the precompiled result is displayed, so that the developer can check the service and correct writing errors according to the precompiled display result, and the code compiling efficiency based on Mybatis is improved.
Further, in a second embodiment of the Mybatis-based compiling method of the present application, referring to fig. 3, step S20 includes:
step S21, displaying alternative functions of the statement to be compiled in a preset mode, wherein the alternative functions comprise functions of the statement to be compiled, which can be selected by a user for operation;
in the technical scheme disclosed by the application, the preset mode comprises list display, namely, the functions are displayed in a list mode.
And S22, determining the function selected by the user from the alternative functions as the target operation function of the statement to be compiled.
In the technical scheme disclosed in the application, the target operation function refers to a function selected by a user from the displayed functions of the sentences to be compiled.
In this embodiment, after the statement to be compiled is obtained, the alternative function of the statement to be compiled is displayed according to a preset manner, and the function selected by the user in the alternative function is determined to be the target operation function of the statement to be compiled, so that the Mybatis-based code compiler can compile the statement to be compiled based on the target operation function and the verification parameters input by the user, and the pre-compiled result is displayed, so that a developer can check the service and correct the writing error according to the pre-compiled display result, and the Mybatis-based code compiling efficiency is improved.
Further, in a third embodiment of the Mybatis-based compiling method of the present application, referring to fig. 4, step S30 includes:
step S31, generating a verification parameter input prompt matched with the target operation function based on the target operation function;
in the technical scheme disclosed by the application, the verification parameter input prompt refers to related information capable of improving the user to input the verification parameter matched with the target operation function. For example, if the target operation function selected by the user is to add a parameter, the generated verification parameter input prompt may be a prompt message with guiding function such as "number", "amount", etc.
Step S32, obtaining verification parameters of the received statement to be compiled based on the verification parameter input prompt;
in the technical scheme disclosed by the application, after a verification parameter input prompt matched with a target operation function is generated, a user inputs verification parameters according to the verification parameter input prompt, for example, the verification parameters input according to the verification parameter input prompt as a number are 1, the verification parameters input according to the verification parameter input prompt as an amount are 100, and then the verification parameters are received based on compiling of Mybatis.
And step S33, displaying the verification parameters according to a preset text format.
In the technical scheme disclosed in the application, the preset text format comprises a JSON format (JavaScript Object Notation, object numbered musical notation), wherein the JSON format is a lightweight data exchange format, and the data is stored and represented by adopting the text format completely independent of programming language. The display effect of the check parameter '1' according to the JSON format is '1', and the display effect of the check parameter '100' according to the JSON format is '100'.
In this embodiment, after determining the target operation function of the statement to be compiled, based on the target operation function selected by the user, the verification parameters of the statement to be compiled are obtained and displayed according to the preset text format, so that the Mybatis-based code compiler can compile the statement to be compiled based on the target operation function and the verification parameters input by the user, and the pre-compiling result is displayed, so that the developer can check the service and correct the compiling error according to the pre-compiling display result, and the Mybatis-based code compiling efficiency is improved.
Further, in a fourth embodiment of the Mybatis-based compiling method of the present application, referring to fig. 5, step S40 includes:
step S41, when a confirmation compiling instruction is received, outputting a parameter input identifier;
in the technical scheme disclosed in the application, the parameter input identifiers comprise prompt input identifiers such as "#" signs and "< >" signs.
Step S42, detecting whether input content exists after the parameter input identification;
in the technical scheme disclosed by the application, after the parameter input identifier is output, a compiler based on Mybatis detects whether input content exists after the parameter input identifier.
Step S43, if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter;
and step S44, acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
In the technical scheme disclosed by the application, when the user is detected to input the verification parameters, acquiring and displaying a code compiling initial result of a statement to be compiled based on the verification parameters; when the user input check parameter is not detected within the preset time, a related prompt for reminding the user to input the check parameter can be output.
In this embodiment, when a confirmation compiling instruction is received, a parameter input identifier is output; detecting whether input content exists after the parameter input identification; if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter; and acquiring and displaying the code compiling initial result of the statement to be compiled based on the verification parameters, so that a developer can check the service and correct the compiling errors according to the display result compiled in advance, and the code compiling efficiency based on Mybatis is improved.
Further, in a fifth embodiment of the Mybatis-based compiling method of the present application, referring to fig. 6, step S42 includes:
step S421, a preset grammar rule and a preset format rule are obtained;
in the technical scheme disclosed in the application, the preset grammar rules refer to relevant specifications of code grammar, such as requirements of field names, requirements of punctuation marks and the like; the preset format rules refer to relevant specifications of code formats and logic, such as consistency of functions achieved by the design completion with functions originally intended to be designed, and the like.
Step S422, performing syntax analysis and format analysis on the statement to be compiled based on the preset syntax rules and the preset format rules in combination with the verification parameters.
In the technical scheme disclosed in the application, the grammar analysis refers to analyzing and checking whether the statement to be compiled meets the requirement of the preset grammar rule according to the preset grammar rule; the format analysis refers to analyzing and checking whether the statement to be compiled meets the requirement of the preset format rule according to the preset format rule.
In this embodiment, the preset grammar rule and the preset format rule are obtained, and based on the preset grammar rule and the preset format rule, the grammar analysis and the format analysis are performed on the statement to be compiled in combination with the verification parameter, and the pre-compiled result is displayed, so that a developer can check the service and correct the writing error according to the pre-compiled display result, and therefore the code compiling efficiency based on Mybatis is improved.
Further, in a sixth embodiment of the Mybatis-based compiling method of the present application, referring to fig. 7, the Mybatis-based compiling method further includes:
step S50, when receiving the updating information of the code compiling initial result, generating a code compiling adjustment result based on the updating information;
in the technical scheme disclosed in the application, the update information refers to the replacement information of error information in the initial result of modifying code compiling.
Step S60, displaying the code compiling and adjusting result.
In this embodiment, when a confirmation compiling instruction is received, after a code is compiled for a statement to be compiled based on a verification parameter, when the verification of the initial result of the code compilation is failed, a user is required to adjust and update the initial result of the compilation, and the result of the code compilation adjustment is displayed, so that a developer can check a service and correct a compiling error according to the display result compiled in advance, and therefore the code compilation efficiency based on Mybatis is improved.
Further, in a seventh embodiment of the Mybatis-based compiling method of the present application, the Mybatis-based compiling method further includes:
step S01, when a verification completion instruction is received, outputting a formatting result of the compiling result based on the compiling result of code compiling of the statement to be compiled;
in the technical scheme disclosed by the application, when the code compiling result passes the verification, a verification completion instruction is triggered. The compiling results of the code compiling of the statement to be compiled include a code compiling initial result (the initial code is compiled and passed, and the initial code is not changed) and a code compiling adjustment result (the initial code is compiled and not passed, and the initial code is updated according to the displayed compiling result).
Step S02, if the compiling result is a code compiling initial result, formatting the code compiling initial result, and displaying a first formatting result of the code compiling initial result;
in the technical scheme disclosed by the application, when the initial code compiling initial result passes verification, namely a user does not modify the initial code compiling initial result, when a verification completion instruction is received, formatting the initial code compiling result, and displaying a first formatting result of the initial code compiling result; after formatting, the code is more visual in display, stronger in readability and convenient for a user to read.
Step S03, if the compiling result is a code compiling adjustment result, formatting the code compiling adjustment result, and displaying a second formatting result of the code compiling adjustment result.
In the technical scheme disclosed by the application, when the initial code compiling initial result is not verified, a user is required to adjust and update the compiling initial result, when a verification completion instruction is received, the code compiling adjustment result passing the verification is formatted, and a second formatting result of the code compiling adjustment result is displayed.
In this embodiment, when a verification completion instruction is received, based on a compiling result of performing code compiling on the statement to be compiled, a formatting result of the compiling result is output; if the compiling result is a code compiling initial result, formatting the code compiling initial result, and displaying a first formatting result of the code compiling initial result; if the compiling result is a code compiling and adjusting result, formatting the code compiling and adjusting result, and displaying a second formatting result of the code compiling and adjusting result, so that after formatting, the code display is more visual, the readability is stronger, and the user can read the code conveniently.
In addition, referring to fig. 8, the embodiment of the present invention further provides a Mybatis-based code compiling apparatus, where the Mybatis-based code compiling apparatus includes:
the first acquisition module is used for acquiring sentences to be compiled in the current Mybatis-based storage file;
the determining module is used for determining the target operation function of the statement to be compiled;
the second acquisition module is used for acquiring and displaying the verification parameters of the statement to be compiled based on the target operation function;
and the compiling module is used for compiling codes of the statement to be compiled based on the verification parameters when receiving the confirmation compiling instruction.
The application also provides a terminal, the terminal includes: the method comprises the steps of a memory, a processor and a Mybat-based code compiler which is stored in the memory and can run on the processor, wherein the Mybat-based code compiler realizes the steps of the Mybat-based compiling method when being executed by the processor.
The present application further provides a computer readable storage medium, where a Mybatis-based code compiler is stored in the computer readable storage medium, where the Mybatis-based code compiler implements the steps of the Mybatis-based compiling method when the Mybatis-based code compiler is executed by a processor.
In the embodiments of the compiling method, the device, the terminal and the readable storage medium based on Mybatis in the present application, all technical features of each embodiment of the compiling method based on Mybatis are included, and the expansion and explanation contents of the description are basically the same as each embodiment of the compiling method based on Mybatis, and are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (8)

1. The compiling method based on Mybatis is characterized by comprising the following steps of:
acquiring a statement to be compiled in a current Mybat-based storage file;
determining a target operation function of the statement to be compiled;
based on the target operation function, acquiring and displaying the verification parameters of the statement to be compiled;
when a confirmation compiling instruction is received, performing code compiling on the statement to be compiled based on the verification parameters;
the step of acquiring and displaying the verification parameters of the statement to be compiled based on the target operation function comprises the following steps:
generating a verification parameter input prompt matched with the target operation function based on the target operation function;
acquiring verification parameters of the statement to be compiled received based on the verification parameter input prompt;
displaying the verification parameters according to a preset text format;
when receiving a confirmation compiling instruction, the step of compiling the code of the statement to be compiled based on the verification parameter comprises the following steps:
outputting a parameter input identifier when receiving a confirmation compiling instruction;
detecting whether input content exists after the parameter input identification;
if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter;
and acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
2. The Mybatis-based compiling method according to claim 1, wherein the step of determining the target operation function of the statement to be compiled includes:
displaying alternative functions of the statement to be compiled in a preset mode, wherein the alternative functions comprise functions of the statement to be compiled for user selection operation;
and determining the function selected by the user from the alternative functions as the target operation function of the statement to be compiled.
3. The Mybatis-based compiling method according to claim 1, wherein the step of compiling the code for the statement to be compiled based on the verification parameter includes:
acquiring a preset grammar rule and a preset format rule;
and carrying out grammar analysis and format analysis on the statement to be compiled by combining the verification parameters based on the preset grammar rules and the preset format rules.
4. The Mybatis-based compiling method according to claim 3, wherein the step of compiling the code of the statement to be compiled based on the verification parameter when receiving the confirmation compiling instruction comprises:
generating a code compiling adjustment result based on the updating information when the updating information of the code compiling initial result is received;
and displaying the code compiling and adjusting result.
5. The Mybatis-based compiling method according to any one of claims 1 to 4, wherein, when receiving the confirmation compiling instruction, after the step of compiling the code for the statement to be compiled based on the verification parameter, further comprises:
when a verification completion instruction is received, outputting a formatting result of the compiling result based on the compiling result of code compiling of the statement to be compiled;
if the compiling result is a code compiling initial result, formatting the code compiling initial result, and displaying a first formatting result of the code compiling initial result;
if the compiling result is the code compiling adjustment result, formatting the code compiling adjustment result, and displaying a second formatting result of the code compiling adjustment result.
6. A Mybatis-based code compiling device, characterized in that the Mybatis-based code compiling device comprises:
the first acquisition module is used for acquiring sentences to be compiled in the current Mybatis-based storage file;
the determining module is used for determining the target operation function of the statement to be compiled;
the second acquisition module is used for acquiring and displaying the verification parameters of the statement to be compiled based on the target operation function;
the compiling module is used for compiling codes of the sentences to be compiled based on the verification parameters when receiving the confirmation compiling instruction;
wherein the second acquisition module is further configured to:
generating a verification parameter input prompt matched with the target operation function based on the target operation function;
acquiring verification parameters of the statement to be compiled received based on the verification parameter input prompt;
displaying the verification parameters according to a preset text format;
when receiving a confirmation compiling instruction, the step of compiling the code of the statement to be compiled based on the verification parameter comprises the following steps:
outputting a parameter input identifier when receiving a confirmation compiling instruction;
detecting whether input content exists after the parameter input identification;
if the input content exists after the parameter input identification, extracting the input content after the parameter input identification as the verification parameter, and performing code compiling on the statement to be compiled based on the verification parameter;
and acquiring and displaying a code compiling initial result of the statement to be compiled based on the verification parameters.
7. A terminal, the terminal comprising: memory, a processor and a Mybatis based code compiler stored on the memory and executable on the processor, which Mybatis based code compiler when executed by the processor implements the steps of the Mybatis based compiling method according to any one of claims 1 to 5.
8. A storage medium having stored thereon a Mybatis based code compiler which when executed by a processor implements the steps of the Mybatis based compiling method according to any one of claims 1 to 5.
CN202010400992.2A 2020-05-12 2020-05-12 Compiling method, device, terminal and medium based on Mybatis Active CN113656036B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010400992.2A CN113656036B (en) 2020-05-12 2020-05-12 Compiling method, device, terminal and medium based on Mybatis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010400992.2A CN113656036B (en) 2020-05-12 2020-05-12 Compiling method, device, terminal and medium based on Mybatis

Publications (2)

Publication Number Publication Date
CN113656036A CN113656036A (en) 2021-11-16
CN113656036B true CN113656036B (en) 2024-03-01

Family

ID=78476744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010400992.2A Active CN113656036B (en) 2020-05-12 2020-05-12 Compiling method, device, terminal and medium based on Mybatis

Country Status (1)

Country Link
CN (1) CN113656036B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471619A (en) * 2018-11-20 2019-03-15 北京千丁互联科技有限公司 Mybatis code generating method, device and terminal
CN110765152A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 SQL extraction method and device, computer equipment and storage medium
CN110989998A (en) * 2019-12-16 2020-04-10 重庆锐云科技有限公司 Method for writing code into dynamic sql statement, program code execution method and platform

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471619A (en) * 2018-11-20 2019-03-15 北京千丁互联科技有限公司 Mybatis code generating method, device and terminal
CN110765152A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 SQL extraction method and device, computer equipment and storage medium
CN110989998A (en) * 2019-12-16 2020-04-10 重庆锐云科技有限公司 Method for writing code into dynamic sql statement, program code execution method and platform

Also Published As

Publication number Publication date
CN113656036A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
CN106951228B (en) Method and device for processing differences in version iteration
US7496828B2 (en) Method and system for mapping tags to classes using namespaces
CN108170809B (en) Table building script generation method, device, equipment and computer readable storage medium
US20140282379A1 (en) Computer-implemented method, system and computer program product for displaying a user interface component
US20130086560A1 (en) Processing automation scripts of software
CN111881019B (en) User interface testing method and device
CN109634841B (en) Electronic device, interface automatic test method and storage medium
CN108959095B (en) Method for verifying XML document based on XML Schema
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN104679500B (en) Method and device for realizing automatic generation of entity class
JP2012073778A (en) Web api creation support device and web api creation support method
CN112083919A (en) YAML template-based target service code generation method and device
CN110795910A (en) Text information processing method and device, server and storage medium
CN113901083A (en) Heterogeneous data source operation resource analysis positioning method and equipment based on multiple analyzers
CN103136100A (en) Method and system for Android test
CN111552480B (en) Cross-platform compiling method, device, equipment and readable storage medium
CN113656036B (en) Compiling method, device, terminal and medium based on Mybatis
CN113672504A (en) Intelligent equipment testing method, device, equipment and storage medium
CN115543324B (en) Method, device, equipment and medium for generating interactive interface
CN111488144A (en) Data processing method and equipment
CN115794214A (en) Application module metadata management method, device, storage medium and device
CN113821496B (en) Database migration method, system, device and computer readable storage medium
CN115291887A (en) Code generation method, device, equipment and storage medium
CN113885924A (en) XML configuration file upgrading method and device and readable storage medium
US7496843B1 (en) Web construction framework controller and model tiers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant