Commit f169ca47 authored by liuyuanjun's avatar liuyuanjun

修改bug29610

parent 16cd60ec
...@@ -14,13 +14,33 @@ public interface BLabelRepository extends BaseMapper<BLabel> { ...@@ -14,13 +14,33 @@ public interface BLabelRepository extends BaseMapper<BLabel> {
// 查询所有数据 // 查询所有数据
@Select("<script>SELECT * FROM b_label where del_flag != 1 and flag = 1 " + @Select("<script>SELECT * FROM b_label where del_flag != 1 and flag = 1 " +
" and corp_id = #{corpId}" + " and corp_id = #{corpId} " +
"<if test=\"lName!=null and lName != ''\"> and l_name like CONCAT('%',#{lName},'%') </if>" + "<if test=\"lName!=null and lName != ''\"> and l_name like CONCAT('%',#{lName},'%') </if>" +
"order by create_date desc </script>") "order by create_date desc </script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<BLabel> queryBlabels(@Param("lName") String lName,@Param("corpId")String corpId); List<BLabel> queryBlabels(@Param("lName") String lName,@Param("corpId")String corpId);
/**
* 根据企业id查询其所属的平台标签
* @param lName
* @param corpId
* @return
*/
@Select("<script>" +
"select distinct bla.business_id,bla.l_name,bla.corp_id " +
"from b_lesson_corp blc \n" +
"left join b_lesson ble on ble.business_id = blc.lesson_id \n" +
"left join b_label bla on FIND_IN_SET(bla.business_id,ble.push_lable) \n" +
"where blc.corp_id = #{corpId} and ble.push_lable &lt;&gt; '' \n" +
"<if test=\"lName!=null and lName != ''\"> " +
"and l_name like CONCAT('%',#{lName},'%') \n" +
"</if>" +
"order by bla.create_date desc " +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLabel> queryBLabelsForPlatform(@Param("lName") String lName,@Param("corpId")String corpId);
// 增加标签是检查标签名重复 // 增加标签是检查标签名重复
@Select("<script>select count(0) from b_label " + @Select("<script>select count(0) from b_label " +
"where l_name = #{lName} " + "where l_name = #{lName} " +
......
...@@ -45,6 +45,8 @@ public class BLabelServiceImpl implements BLabelService { ...@@ -45,6 +45,8 @@ public class BLabelServiceImpl implements BLabelService {
@Override @Override
public List<BLabel> queryBlabels(String lName, CurUser curUser) { public List<BLabel> queryBlabels(String lName, CurUser curUser) {
List<BLabel> labels = bLabelRepository.queryBlabels(lName, curUser.getCorpId()); List<BLabel> labels = bLabelRepository.queryBlabels(lName, curUser.getCorpId());
List<BLabel> labelsForPlatform = bLabelRepository.queryBLabelsForPlatform(lName, curUser.getCorpId());
labels.addAll(labelsForPlatform);
List<BLesson> lessons = addPushLable(bLessonService.queryHomeBLessons(curUser),curUser); List<BLesson> lessons = addPushLable(bLessonService.queryHomeBLessons(curUser),curUser);
log.info("-----------addNewLable----------首页所有课程总个数--"+lessons.size()+"--------------------"); log.info("-----------addNewLable----------首页所有课程总个数--"+lessons.size()+"--------------------");
...@@ -69,7 +71,6 @@ public class BLabelServiceImpl implements BLabelService { ...@@ -69,7 +71,6 @@ public class BLabelServiceImpl implements BLabelService {
log.info("-----------addNewLable----------当前标签--"+label+"--的new课程个数--"+num+"--------------------"); log.info("-----------addNewLable----------当前标签--"+label+"--的new课程个数--"+num+"--------------------");
label.setNewCount(num); label.setNewCount(num);
} }
return labels; return labels;
} }
......
...@@ -840,7 +840,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -840,7 +840,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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} or blc.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} or FIND_IN_SET(#{model.labelId},bl.push_lable)) " +
" </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>" +
" and bl.release_state = 2 " + " and bl.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " + " and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " +
...@@ -897,7 +899,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -897,7 +899,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "+ " and (bl.corp_id = #{model.corpId} or blc.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} or FIND_IN_SET(#{model.labelId},bl.push_lable)) " +
" </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>" +
" and bl.release_state = 2 " + " and bl.release_state = 2 " +
" and ((brs.type = 0 and brs.target_id = #{model.userId}) " + " and ((brs.type = 0 and brs.target_id = #{model.userId}) " +
...@@ -956,7 +960,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -956,7 +960,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" and (bl.corp_id = #{model.corpId} or blc.corp_id = #{model.corpId}) "+ " and (bl.corp_id = #{model.corpId} or blc.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} or FIND_IN_SET(#{model.labelId},bl.push_lable)) " +
" </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>" +
" and bl.release_state = 2 " + " and bl.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " + " and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " +
...@@ -1014,7 +1020,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1014,7 +1020,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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} or blc.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} or FIND_IN_SET(#{model.labelId},bl.push_lable)) " +
" </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>" +
" and bl.release_state = 2 " + " and bl.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " + " and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " +
...@@ -1085,7 +1093,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -1085,7 +1093,9 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" 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 " +
" where blp.del_flag != 1 and blp.flag = 1 " + " where blp.del_flag != 1 and blp.flag = 1 " +
" and blp.person_id = #{model.userId} ) " + " and blp.person_id = #{model.userId} ) " +
" <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} or FIND_IN_SET(#{model.labelId},b.push_lable)) " +
" </if>" +
" <if test=\"model.lessonType !=null and model.lessonType != ''\">and b.lesson_type = #{model.lessonType}</if>" + " <if test=\"model.lessonType !=null and model.lessonType != ''\">and b.lesson_type = #{model.lessonType}</if>" +
" and b.release_state = 2 " + " and b.release_state = 2 " +
" and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " + " and ((bvs.type = 0 and bvs.target_id = #{model.userId}) " +
......
...@@ -1207,7 +1207,7 @@ public class BLessonServiceImpl implements BLessonService { ...@@ -1207,7 +1207,7 @@ public class BLessonServiceImpl implements BLessonService {
List<BLesson> ListAllLesson = null; List<BLesson> ListAllLesson = null;
//根据不同传值 查询列表页内容 searchType:查询类型 0 全部 1 推荐 2在学 3收藏" //根据不同传值 查询列表页内容 searchType:查询类型 0 全部 1 推荐 2在学 3收藏 4兴趣"
switch (model.getSearchType()) { switch (model.getSearchType()) {
case "0": case "0":
ListAllLesson = bLessonRepository.queryListAllLessonByPagination(model); ListAllLesson = bLessonRepository.queryListAllLessonByPagination(model);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment