This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11356|Reply: 1

[JavaEE] User Management System_Multi-conditional User Query Requirements!!!!!

[Copy link]
Posted on 3/27/2019 1:39:31 PM | | |
Multi-conditional user query interface1. Basic information of the interface
parameter
value
remark

Interface address/tourBackManager?methodName=searchBackUser根据条件查询后台用户
Request methodpost
Submission methodAsynchronous commits2. Request parameter description【Request Parameters】
Parameter name
type
Whether it is necessary
illustrate

departmentStringN department
numStringN project number
usernameStringN username
phoneStringN phone number
emailStringN email
  • Successful inquiry:

[{
  "user_id":1,
  "department":"commodity department",
  "num":84383,
  "username":"Wang Dammer ",
  "password":"123321
  "phone":"188617954",
  "email":"10058995296@qq.com",
},{
  "user_id":2,
  "department":"sales department",
  "num":84383,
  "username":"Zhang Qiling",
  "password":"123321
  "phone":"188617954",
  "email":"10058995296@qq.com",
}]
  • Query failed:

{
  "flag":false,
  "errorMsg": "This user does not exist"
}



Bosses, tell me about your ideas!






Previous:Network engineer 5-day training third edition
Next:Front-end framework sharing collected includes all mainstream frameworks
Posted on 3/27/2019 5:10:40 PM |
I don't understand what you mean

You bring all the parameters of the post to judge whether the key has a value, and if there is, splice it

string sql="select * from user where 1=1"

Determine whether the username has a value, if there is, sql+="and username = "+value

If there is an ORM, there is no need to splice SQL, of course, it is unreasonable to splicing SQL in this way
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com