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
acb2a401
Commit
acb2a401
authored
Jul 16, 2020
by
liuyuanjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改查询接口sql
parent
4bd9d2b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
34 deletions
+18
-34
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+18
-34
No files found.
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
acb2a401
...
@@ -182,9 +182,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -182,9 +182,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and
bl.corp_id = #{curUser.corpId}
"
+
" and
(bl.corp_id = #{curUser.corpId} or blc.corp_id = #{curUser.corpId})
"
+
" and bl.release_state = 2 "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
...
@@ -222,8 +223,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -222,8 +223,8 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where
bl.del_flag != 1 and bl.flag = 1
"
+
" where
(bl.corp_id = #{curUser.corpId} or blc.corp_id = #{curUser.corpId})
"
+
" and
(bl.corp_id = #{curUser.corpId} or blc.corp_id = #{curUser.corpId})
"
+
" and
bl.del_flag != 1 and bl.flag = 1
"
+
" and bl.release_state = 2 "
+
" and bl.release_state = 2 "
+
" and ((brs.type = 0 and brs.target_id = #{curUser.userId}) "
+
" and ((brs.type = 0 and brs.target_id = #{curUser.userId}) "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
" <if test=\"departs != null and departs.size() > 0 \"> "
+
...
@@ -263,10 +264,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -263,10 +264,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and (bl.corp_id = #{curUser.corpId} or blc.corp_id = #{curUser.corpId}) "
+
" and bl.corp_id = #{curUser.corpId} "
+
" and bl.release_state = 2 "
+
" and bl.release_state = 2 "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" and ((bvs.type = 0 and bvs.target_id = #{curUser.userId}) "
+
" or (bl.lecturer_id = #{curUser.userId}) "
+
" or (bl.lecturer_id = #{curUser.userId}) "
+
...
@@ -324,9 +324,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -324,9 +324,10 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and bv.corp_id = #{curUser.corpId} "
+
" and bv.corp_id = #{curUser.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_corp blc on blc.lesson_id = b.business_id and b.corp_id = '###' "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" and
b.corp_id = #{curUser.corpId}
"
+
" and
(b.corp_id = #{curUser.corpId} or blc.corp_id = #{curUser.corpId})
"
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
...
@@ -826,25 +827,18 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -826,25 +827,18 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" from b_lesson bl "
+
" from b_lesson bl "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
" left join s_user su on su.business_id = bl.lecturer_id "
+
// " and su.del_flag != 1 and su.flag = 1 " +
// " and su.del_flag != 1 and su.flag = 1 " +
" and su.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
" left join s_user suc on suc.business_id = bl.create_by "
+
// " and suc.del_flag != 1 and suc.flag = 1 " +
// " and suc.del_flag != 1 and suc.flag = 1 " +
" and suc.corp_id = #{model.corpId} "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" left join b_viewrange bv on bl.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{model.corpId} "
+
" and bv.corp_id = #{model.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "
+
" and bl.corp_id = #{model.corpId} "
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
...
@@ -898,9 +892,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -898,9 +892,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
" left join b_recommend_son brs on br.business_id = brs.recommend_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "
+
" and bl.corp_id = #{model.corpId} "
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
...
@@ -957,9 +951,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -957,9 +951,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
// " left join b_course bc on bc.business_id = bl.course_id " +
// " left join b_course bc on bc.business_id = bl.course_id " +
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "
+
" and bl.corp_id = #{model.corpId} "
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
...
@@ -1016,10 +1010,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -1016,10 +1010,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_corp blc on blc.lesson_id = bl.business_id and bl.corp_id = '###' "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" where bl.del_flag != 1 and bl.flag = 1 "
+
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "
+
" and bl.corp_id = #{model.corpId} "
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.labelId !=null and model.labelId != ''\">and bll.label_id = #{model.labelId}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and bl.lesson_type = #{model.lessonType}</if>"
+
...
@@ -1069,33 +1062,24 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -1069,33 +1062,24 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" bp.person_id = #{model.userId} "
+
" bp.person_id = #{model.userId} "
+
" and b.del_flag != 1 and b.flag = 1 "
+
" and b.del_flag != 1 and b.flag = 1 "
+
" and bp.del_flag != 1 and bp.flag = 1 "
+
" and bp.del_flag != 1 and bp.flag = 1 "
+
" and b.corp_id = #{model.corpId} "
+
" and b.corp_id = #{model.corpId} "
+
" GROUP BY "
+
" GROUP BY "
+
" bla.business_id "
+
" bla.business_id "
+
" ) T ON T.bussinessId = bl.label_id "
+
" ) T ON T.bussinessId = bl.label_id "
+
" left join s_user su on su.business_id = b.lecturer_id "
+
" left join s_user su on su.business_id = b.lecturer_id "
+
// " and su.del_flag != 1 and su.flag = 1 " +
// " and su.del_flag != 1 and su.flag = 1 " +
" and su.corp_id = #{model.corpId} "
+
" and su.corp_id = #{model.corpId} "
+
" left join s_user suc on suc.business_id = b.create_by "
+
" left join s_user suc on suc.business_id = b.create_by "
+
// " and suc.del_flag != 1 and suc.flag = 1 " +
// " and suc.del_flag != 1 and suc.flag = 1 " +
" and suc.corp_id = #{model.corpId} "
+
" and suc.corp_id = #{model.corpId} "
+
" left join b_viewrange bv on b.business_id = bv.lesson_id "
+
" left join b_viewrange bv on b.business_id = bv.lesson_id "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.del_flag != 1 and bv.flag = 1 "
+
" and bv.corp_id = #{model.corpId} "
+
" and bv.corp_id = #{model.corpId} "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_viewrange_son bvs on bv.business_id = bvs.viewrange_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_label bll on bl.business_id = bll.lesson_id "
+
" left join b_lesson_corp blc on blc.lesson_id = b.business_id and b.corp_id = '###' "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" where b.del_flag != 1 and b.flag = 1 "
+
" and (b.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "
+
" and b.corp_id = #{model.corpId} "
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" <if test=\"model.valueScreen !=null and model.valueScreen != ''\"> ${model.valueScreen} </if>"
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" and b.business_id not in (SELECT DISTINCT b.business_id from "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
" b_lesson b left join b_lesson_person blp on b.business_id = blp.lesson_id "
+
...
...
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