Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
11a661e7
Commit
11a661e7
authored
Jan 26, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改查询练习接口
parent
e6615292
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
14 deletions
+18
-14
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+3
-3
TQuestionRepository.java
...g/rcisoft/business/tquestion/dao/TQuestionRepository.java
+7
-9
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+8
-2
No files found.
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
11a661e7
...
...
@@ -155,14 +155,14 @@ public class TQuestionController extends PaginationController<TQuestion> {
@GetMapping
(
value
=
"/queryQuestionsByChap_IdAndQtype"
)
public
Result
queryBChapters
(
String
chapterId
)
{
Map
<
String
,
Object
>
map
=
new
HashedMap
();
String
s
=
new
String
()
;
String
num
=
""
;
map
.
put
(
"List1"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"1"
));
map
.
put
(
"List2"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"2"
));
map
.
put
(
"List3"
,
tQuestionServiceImpl
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
"3"
));
s
=
"NumOf1 : "
+
tQuestionServiceImpl
.
queryNumByType
(
"1"
)+
num
=
"NumOf1 : "
+
tQuestionServiceImpl
.
queryNumByType
(
"1"
)+
"NumOf2 : "
+
tQuestionServiceImpl
.
queryNumByType
(
"2"
)+
"NumOf3 : "
+
tQuestionServiceImpl
.
queryNumByType
(
"3"
);
map
.
put
(
"Num"
,
s
);
map
.
put
(
"Num"
,
num
);
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionRepository.java
View file @
11a661e7
...
...
@@ -49,21 +49,19 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
"</foreach></script>"
)
int
insertOptionsList
(
List
<
TQuestionOptions
>
optionList
);
@Select
(
"<script>select q.qtitle,q.qdesc,qo.alias,qo.describe"
+
"from t_paper_chapter pc"
+
"left join t_paper_chapter_section pcs on pcs.pc_id = pc.business_id"
+
"left join t_paper p on p.pc_id = pc.business_id"
+
"left join t_paper_detail pd on pd.p_id = p.business_id"
+
"left join t_paper_section ps on ps.business_id = pd.ps_id"
+
"left join t_question q on q.business_id = pd.q_id"
+
"left join t_question_options qo on qo.qid = q.business_id"
@Select
(
"<script>select q.business_id,q.qtitle,q.qdesc\n"
+
"from t_paper_chapter pc \n"
+
"left join t_paper p on p.pc_id = pc.business_id \n"
+
"left join t_paper_detail pd on pd.p_id = p.business_id \n"
+
"left join t_paper_section ps on ps.business_id = pd.ps_id \n"
+
"left join t_question q on q.business_id = pd.q_id "
+
"where pc.chap_id = #{chapterId} and q.qtype = #{qtype}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
TQuestion
>
queryQuestionsByChap_IdAndQtype
(
@Param
(
"chapterId"
)
String
chapterId
,
@Param
(
"qtype"
)
String
qtype
);
@Select
(
"<script>select q_num from t_paper_chapter_section where q_type = #{qtype}<script>"
)
@Select
(
"<script>select q_num from t_paper_chapter_section where q_type = #{qtype}<
/
script>"
)
String
queryNumByType
(
String
qtype
);
}
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
11a661e7
...
...
@@ -158,8 +158,14 @@ public class TQuestionServiceImpl implements TQuestionService {
@Override
public
List
<
TQuestion
>
queryQuestionsByChap_IdAndQtype
(
String
chapterId
,
String
qtype
)
{
return
tQuestionRepository
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
qtype
);
List
<
TQuestion
>
tQuestions
=
tQuestionRepository
.
queryQuestionsByChap_IdAndQtype
(
chapterId
,
qtype
);
for
(
TQuestion
tQuestion
:
tQuestions
){
if
(!
qtype
.
equals
(
"3"
)){
List
<
TQuestionOptions
>
options
=
tQuestionOptionsRepository
.
queryTQuestionOptions
(
tQuestion
.
getBusinessId
());
tQuestion
.
setOptions
(
options
);
}
}
return
tQuestions
;
}
@Override
...
...
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