Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
member-api
Commits
b6fbf201
Commit
b6fbf201
authored
Nov 21, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xxx
parent
8a431caf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
35 deletions
+35
-35
AdminFirstController.java
...n/java/com/egolm/film/api/admin/AdminFirstController.java
+1
-1
AdminAuthServiceImpl.java
...olm/film/api/admin/service/impl/AdminAuthServiceImpl.java
+4
-4
AdminUserServiceImpl.java
...olm/film/api/admin/service/impl/AdminUserServiceImpl.java
+2
-2
MemberServiceImpl.java
...egolm/film/api/member/service/impl/MemberServiceImpl.java
+5
-5
SqlWhere.java
src/main/java/com/egolm/film/util/SqlWhere.java
+23
-23
No files found.
src/main/java/com/egolm/film/api/admin/AdminFirstController.java
View file @
b6fbf201
...
@@ -40,7 +40,7 @@ public class AdminFirstController {
...
@@ -40,7 +40,7 @@ public class AdminFirstController {
@ApiOperation
(
"管理员分页查询"
)
@ApiOperation
(
"管理员分页查询"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
false
,
name
=
"keyword"
,
value
=
"关键字"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"string"
,
required
=
false
,
name
=
"keyword"
,
value
=
"关键字"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"state"
,
value
=
"状态"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"
apply_
state"
,
value
=
"状态"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"film_type"
,
value
=
"影片类型"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"film_type"
,
value
=
"影片类型"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"enroll_type"
,
value
=
"影片性质"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"integer"
,
required
=
false
,
name
=
"enroll_type"
,
value
=
"影片性质"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"index"
,
value
=
"分页编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"index"
,
value
=
"分页编号"
),
...
...
src/main/java/com/egolm/film/api/admin/service/impl/AdminAuthServiceImpl.java
View file @
b6fbf201
...
@@ -35,15 +35,15 @@ public class AdminAuthServiceImpl implements AdminAuthService {
...
@@ -35,15 +35,15 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryGroupList
(
String
keyword
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryGroupList
(
String
keyword
,
Page
page
)
{
SqlWhere
argEdit
=
new
SqlWhere
().
like
(
"group_name"
,
keyword
);
SqlWhere
argEdit
=
new
SqlWhere
().
like
(
"group_name"
,
keyword
);
String
sql
=
"select * from fc_admin_group"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
Args
());
String
sql
=
"select * from fc_admin_group"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
StringList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
s
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
ectList
());
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryAdminList
(
String
keyword
,
Integer
group_id
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryAdminList
(
String
keyword
,
Integer
group_id
,
Page
page
)
{
SqlWhere
argEdit
=
new
SqlWhere
().
olike
(
new
String
[]{
"realname"
,
"username"
},
keyword
).
eq
(
"group_id"
,
group_id
);
SqlWhere
argEdit
=
new
SqlWhere
().
olike
(
new
String
[]{
"realname"
,
"username"
},
keyword
).
eq
(
"group_id"
,
group_id
);
String
sql
=
"select * from fc_admin"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
Args
());
String
sql
=
"select * from fc_admin"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
StringList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
s
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
ectList
());
}
}
@Override
@Override
...
...
src/main/java/com/egolm/film/api/admin/service/impl/AdminUserServiceImpl.java
View file @
b6fbf201
...
@@ -21,8 +21,8 @@ public class AdminUserServiceImpl implements AdminUserService {
...
@@ -21,8 +21,8 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryGroupList
(
String
keyword
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryGroupList
(
String
keyword
,
Page
page
)
{
SqlWhere
argEdit
=
new
SqlWhere
().
like
(
"group_name"
,
keyword
);
SqlWhere
argEdit
=
new
SqlWhere
().
like
(
"group_name"
,
keyword
);
String
sql
=
"select * from fc_user_group"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
Args
());
String
sql
=
"select * from fc_user_group"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
argEdit
.
get
StringList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
s
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
argEdit
.
getObj
ectList
());
}
}
}
}
src/main/java/com/egolm/film/api/member/service/impl/MemberServiceImpl.java
View file @
b6fbf201
...
@@ -496,11 +496,11 @@ public class MemberServiceImpl implements MemberService {
...
@@ -496,11 +496,11 @@ public class MemberServiceImpl implements MemberService {
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
queryChuShenList
(
String
keyword
,
Integer
state
,
String
film_type
,
String
enroll_type
,
Page
page
)
{
public
List
<
Map
<
String
,
Object
>>
queryChuShenList
(
String
keyword
,
Integer
apply_
state
,
String
film_type
,
String
enroll_type
,
Page
page
)
{
S
tring
sql
=
"select * from fc_member_film"
;
S
qlWhere
where
=
new
SqlWhere
().
olike
(
new
String
[]{
"en_name"
,
"cn_name"
},
keyword
).
eq
(
"state"
,
2
).
eq
(
"apply_state"
,
apply_state
).
eq
(
"film_type"
,
film_type
).
eq
(
"enroll_type"
,
enroll_type
)
;
new
SqlWhere
().
like
(
name
,
obj
)
String
sql
=
"select * from fc_member_film"
+
StringUtil
.
join
(
" and "
,
" where "
,
""
,
""
,
where
.
getStringList
());
Object
[]
objs
=
where
.
getObjectList
();
return
null
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
objs
)
;
}
}
}
}
src/main/java/com/egolm/film/util/SqlWhere.java
View file @
b6fbf201
...
@@ -7,58 +7,58 @@ import com.egolm.common.StringUtil;
...
@@ -7,58 +7,58 @@ import com.egolm.common.StringUtil;
public
class
SqlWhere
{
public
class
SqlWhere
{
private
List
<
String
>
args
;
private
List
<
String
>
strList
;
private
List
<
Object
>
obj
s
;
private
List
<
Object
>
obj
List
;
public
SqlWhere
()
{
public
SqlWhere
()
{
this
.
args
=
new
ArrayList
<
String
>();
this
.
strList
=
new
ArrayList
<
String
>();
this
.
obj
s
=
new
ArrayList
<
Object
>();
this
.
obj
List
=
new
ArrayList
<
Object
>();
}
}
public
SqlWhere
eq
(
String
name
,
Object
obj
)
{
public
SqlWhere
eq
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" = ?"
);
this
.
strList
.
add
(
name
+
" = ?"
);
this
.
obj
s
.
add
(
obj
);
this
.
obj
List
.
add
(
obj
);
}
}
return
this
;
return
this
;
}
}
public
SqlWhere
gt
(
String
name
,
Object
obj
)
{
public
SqlWhere
gt
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" > ?"
);
this
.
strList
.
add
(
name
+
" > ?"
);
this
.
obj
s
.
add
(
obj
);
this
.
obj
List
.
add
(
obj
);
}
}
return
this
;
return
this
;
}
}
public
SqlWhere
lt
(
String
name
,
Object
obj
)
{
public
SqlWhere
lt
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" < ?"
);
this
.
strList
.
add
(
name
+
" < ?"
);
this
.
obj
s
.
add
(
obj
);
this
.
obj
List
.
add
(
obj
);
}
}
return
this
;
return
this
;
}
}
public
SqlWhere
gtq
(
String
name
,
Object
obj
)
{
public
SqlWhere
gtq
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" >= ?"
);
this
.
strList
.
add
(
name
+
" >= ?"
);
this
.
obj
s
.
add
(
obj
);
this
.
obj
List
.
add
(
obj
);
}
}
return
this
;
return
this
;
}
}
public
SqlWhere
ltq
(
String
name
,
Object
obj
)
{
public
SqlWhere
ltq
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" <= ?"
);
this
.
strList
.
add
(
name
+
" <= ?"
);
this
.
obj
s
.
add
(
obj
);
this
.
obj
List
.
add
(
obj
);
}
}
return
this
;
return
this
;
}
}
public
SqlWhere
like
(
String
name
,
Object
obj
)
{
public
SqlWhere
like
(
String
name
,
Object
obj
)
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
if
(
StringUtil
.
isNotBlank
(
obj
))
{
this
.
args
.
add
(
name
+
" like ?"
);
this
.
strList
.
add
(
name
+
" like ?"
);
this
.
obj
s
.
add
(
"%"
+
obj
+
"%"
);
this
.
obj
List
.
add
(
"%"
+
obj
+
"%"
);
}
}
return
this
;
return
this
;
}
}
...
@@ -74,7 +74,7 @@ public class SqlWhere {
...
@@ -74,7 +74,7 @@ public class SqlWhere {
sb
.
append
(
name
+
" like '%"
+
obj
+
"%'"
);
sb
.
append
(
name
+
" like '%"
+
obj
+
"%'"
);
}
}
sb
.
append
(
")"
);
sb
.
append
(
")"
);
this
.
args
.
add
(
sb
.
toString
());
this
.
strList
.
add
(
sb
.
toString
());
}
}
return
this
;
return
this
;
}
}
...
@@ -87,20 +87,20 @@ public class SqlWhere {
...
@@ -87,20 +87,20 @@ public class SqlWhere {
str
+=
", "
;
str
+=
", "
;
}
}
str
+=
"?"
;
str
+=
"?"
;
this
.
obj
s
.
add
(
obj
[
i
]);
this
.
obj
List
.
add
(
obj
[
i
]);
}
}
str
+=
")"
;
str
+=
")"
;
this
.
args
.
add
(
name
+
" in ("
+
str
+
")"
);
this
.
strList
.
add
(
name
+
" in ("
+
str
+
")"
);
}
}
return
this
;
return
this
;
}
}
public
List
<
String
>
get
Args
()
{
public
List
<
String
>
get
StringList
()
{
return
args
;
return
strList
;
}
}
public
Object
[]
getObj
s
()
{
public
Object
[]
getObj
ectList
()
{
return
obj
s
.
toArray
();
return
obj
List
.
toArray
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment