The SQL statement in the company's code may be called by multiple methods, but some methods will be associated with other tables, so if the modification is inappropriate, the same method of invoking the SQL statement will cause an error.
Recently done a function of the company, there is such a problem, although this feature is completed, but the other methods of calling the SQL, there are serious errors, although can be different methods of different SQL statements, you can solve the method, but the company's code so, pain another way to solve.
The problem arises from the demand background: This requirement is in the logistics system, this time to the foreground page to display the information to add a field, and to display this field, you have to associate two new tables, so in the foreground page to add a hidden field of input.
This adds an if judgment in the SQL statement in the background
Only when the allocate part is empty can you associate the table in the IF, or query the field, or call the Where condition to judge
In the project, multiple methods call the same SQL statement, and resolve the conflicts by resolving different SQL queries for each method.