Commit ccc83c92 authored by root's avatar root

修改接口

parent 308318ee
...@@ -61,8 +61,8 @@ public interface BBannerRepository extends BaseMapper<BBanner> { ...@@ -61,8 +61,8 @@ public interface BBannerRepository extends BaseMapper<BBanner> {
* 获取sort最大值 +1 * 获取sort最大值 +1
* @return * @return
*/ */
@Select("<script>select DISTINCT IFNULL((select max(sort) from b_banner where " + @Select("<script>select DISTINCT IFNULL((select max(banner_sort) from b_banner where " +
"del_flag = 0 and flag = 1 ),0)+1 as sort</script>") "del_flag = 0 and flag = 1 ),0)+1 as banner_sort</script>")
int selectMaxSort(); int selectMaxSort();
/** /**
......
...@@ -22,8 +22,6 @@ import javax.validation.Valid; ...@@ -22,8 +22,6 @@ import javax.validation.Valid;
import org.rcisoft.business.bdictionary.entity.BDictionary; import org.rcisoft.business.bdictionary.entity.BDictionary;
import org.rcisoft.business.bdictionary.service.BDictionaryService; import org.rcisoft.business.bdictionary.service.BDictionaryService;
import java.util.List;
/** /**
* Created by on 2019-9-29 16:21:48. * Created by on 2019-9-29 16:21:48.
*/ */
...@@ -36,29 +34,29 @@ public class BDictionaryController extends PaginationController<BDictionary> { ...@@ -36,29 +34,29 @@ public class BDictionaryController extends PaginationController<BDictionary> {
private BDictionaryService bDictionaryServiceImpl; private BDictionaryService bDictionaryServiceImpl;
@ApiOperation(value="添加", notes="添加") // @ApiOperation(value="添加", notes="添加")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) // //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") // @PostMapping(value = "/add")
public Result add(CurUser curUser,@Valid BDictionary bDictionary, BindingResult bindingResult) { // public Result add(CurUser curUser,@Valid BDictionary bDictionary, BindingResult bindingResult) {
PersistModel data = bDictionaryServiceImpl.save(bDictionary); // PersistModel data = bDictionaryServiceImpl.save(bDictionary);
return Result.builder(data, // return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, // MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, // MessageConstant.MESSAGE_ALERT_ERROR,
bDictionary); // bDictionary);
} // }
//
@ApiOperation(value="逻辑删除", notes="逻辑删除") // @ApiOperation(value="逻辑删除", notes="逻辑删除")
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", required = false, dataType = "varchar")}) // @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", required = false, dataType = "varchar")})
@DeleteMapping("/delete/{id:\\w+}") // @DeleteMapping("/delete/{id:\\w+}")
public Result delete(@PathVariable String id) { // public Result delete(@PathVariable String id) {
BDictionary bDictionary = new BDictionary(); // BDictionary bDictionary = new BDictionary();
bDictionary.setBusinessId(id); // bDictionary.setBusinessId(id);
PersistModel data = bDictionaryServiceImpl.remove(bDictionary); // PersistModel data = bDictionaryServiceImpl.remove(bDictionary);
return Result.builder(data, // return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, // MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, // MessageConstant.MESSAGE_ALERT_ERROR,
id); // id);
} // }
// @ApiOperation(value="修改", notes="修改") // @ApiOperation(value="修改", notes="修改")
// @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) // @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
...@@ -79,7 +77,7 @@ public class BDictionaryController extends PaginationController<BDictionary> { ...@@ -79,7 +77,7 @@ public class BDictionaryController extends PaginationController<BDictionary> {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bDictionaryServiceImpl.findAll(curUser)); bDictionaryServiceImpl.findAllColumnConfig(curUser));
} }
@ApiOperation(value="1102 更新栏目配置", notes="查看栏目配置") @ApiOperation(value="1102 更新栏目配置", notes="查看栏目配置")
......
...@@ -24,11 +24,11 @@ public interface BDictionaryRepository extends BaseMapper<BDictionary> { ...@@ -24,11 +24,11 @@ public interface BDictionaryRepository extends BaseMapper<BDictionary> {
@Select("<script>" + @Select("<script>" +
" select * from b_dictionary where 1=1 "+ " select * from b_dictionary where 1=1 "+
" and del_flag = !1 and flag = 1 "+ " and del_flag = !1 and flag = 1 "+
" <if test=\"configList != null and configList.size()>0 \">and name in " + " <if test=\"configList != null and configList.size()>0 \">and business_id in " +
" <foreach item='item' index='index' collection='configList' open='(' separator=',' close=')'> #{item} </foreach> " + " <foreach item='item' index='index' collection='configList' open='(' separator=',' close=')'> #{item} </foreach> " +
" </if>"+ " </if>"+
" </script>") " </script>")
@ResultMap(value = "BaseResultMap" ) @ResultMap(value = "BaseResultMap" )
List<BDictionary> queryBDictionarys(@Param("curUser") CurUser curUser, @Param("configList") List<String> configList); List<BDictionary> findAllColumnConfig(@Param("curUser") CurUser curUser, @Param("configList") List<String> configList);
} }
...@@ -46,7 +46,7 @@ public interface BDictionaryService { ...@@ -46,7 +46,7 @@ public interface BDictionaryService {
* @param curUser * @param curUser
* @return * @return
*/ */
List<BDictionary> findAll(CurUser curUser); List<BDictionary> findAllColumnConfig(CurUser curUser);
/** /**
......
...@@ -94,12 +94,12 @@ public class BDictionaryServiceImpl implements BDictionaryService { ...@@ -94,12 +94,12 @@ public class BDictionaryServiceImpl implements BDictionaryService {
* @param curUser * @param curUser
* @return * @return
*/ */
public List<BDictionary> findAll(CurUser curUser){ public List<BDictionary> findAllColumnConfig(CurUser curUser){
List<String> configList = new ArrayList<>(); List<String> configList = new ArrayList<>();
configList.add("关注人数"); configList.add("3e3feb5a66244652a1c052b369a7b68a");//关注人数
configList.add("总裁读书会"); configList.add("3e3feb5a66244652a1c052b369a7b68b");//总裁读书会
configList.add("在学人数"); configList.add("3e3feb5a66244652a1c052b369a7b68c");//在学人数
List<BDictionary> DictList = bDictionaryRepository.queryBDictionarys(curUser,configList); List<BDictionary> DictList = bDictionaryRepository.findAllColumnConfig(curUser,configList);
return DictList; return DictList;
} }
......
...@@ -27,12 +27,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -27,12 +27,15 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @param releaseState * @param releaseState
* @return * @return
*/ */
@Select("<script>select * from b_lesson " + @Select("<script>select b.*,su.name lecturerName " +
"where del_flag != 1 and flag = 1 and lecturer_id = #{curUser.userId}" + " from b_lesson b " +
" left join s_user su on b.lecturer_id = su.business_id " +
" where b.del_flag != 1 and b.flag = 1 " +
" and su.del_flag != 1 and su.flag = 1 and b.lecturer_id = #{curUser.userId}" +
// " and corp_id = #{curUser.corpId} "+ // " and b.corp_id = #{curUser.corpId} "+
"<if test=\"releaseState!=null and releaseState != ''\">and release_state = #{releaseState} </if>" + " <if test=\"releaseState!=null and releaseState != ''\">and release_state = #{releaseState} </if>" +
"order by update_date desc</script>") "order by update_date desc</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<BLesson> queryBLessons(@Param("releaseState") String releaseState,@Param("curUser")CurUser curUser); List<BLesson> queryBLessons(@Param("releaseState") String releaseState,@Param("curUser")CurUser curUser);
...@@ -358,14 +361,22 @@ public interface BLessonRepository extends BaseMapper<BLesson> { ...@@ -358,14 +361,22 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
* @return * @return
*/ */
@Select({"<script>", @Select({"<script>",
" select (select COUNT(1) from b_lesson where lecturer_id = #{userId} ) publishAllCount, " + " select (select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
"(select COUNT(1) from b_lesson where lecturer_id = #{userId} and release_state = '0') notPublishCount, " + " and lecturer_id = #{userId} ) publishAllCount, " +
"(select COUNT(1) from b_lesson where lecturer_id = #{userId} and release_state = '2') publishedCount, " + "(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
"(select COUNT(1) from b_lesson where lecturer_id = #{userId} and release_state = '4') closedCount, "+ " and lecturer_id = #{userId} and release_state = '0') notPublishCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} ) learnAllCount, " + "(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '2') finishCount, " + " and lecturer_id = #{userId} and release_state = '2') publishedCount, " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '1') notFinishCount, " + "(select COUNT(1) from b_lesson where del_flag != 1 and flag = 1 " +
"(select COUNT(1) from b_lesson_person where person_id = #{userId} and is_finish = '0') notStartCount " + " and lecturer_id = #{userId} and release_state = '4') closedCount, "+
"(select COUNT(1) from b_lesson_person where del_flag != 1 and flag = 1 " +
" and person_id = #{userId} ) learnAllCount, " +
"(select COUNT(1) from b_lesson_person where del_flag != 1 and flag = 1 " +
" and person_id = #{userId} and is_finish = '2') finishCount, " +
"(select COUNT(1) from b_lesson_person where del_flag != 1 and flag = 1 " +
" and person_id = #{userId} and is_finish = '1') notFinishCount, " +
"(select COUNT(1) from b_lesson_person where del_flag != 1 and flag = 1 " +
" and person_id = #{userId} and is_finish = '0') notStartCount " +
"</script>"}) "</script>"})
ILessonCountDTO iLessonCount(String userId); ILessonCountDTO iLessonCount(String userId);
......
...@@ -35,7 +35,7 @@ public class FindAllLessonDTO { ...@@ -35,7 +35,7 @@ public class FindAllLessonDTO {
@Length(min = 1,max = 64,message = "长度最小为1,最大为50") @Length(min = 1,max = 64,message = "长度最小为1,最大为50")
private String recommend; private String recommend;
@ApiModelProperty(value = "师姓名") @ApiModelProperty(value = "师姓名")
private String lecturerName; private String lecturerName;
@ApiModelProperty(value = "标签集合") @ApiModelProperty(value = "标签集合")
......
...@@ -110,7 +110,7 @@ public class BLesson extends IdEntity<BLesson> { ...@@ -110,7 +110,7 @@ public class BLesson extends IdEntity<BLesson> {
@Transient @Transient
private String learnProgress; private String learnProgress;
@ApiModelProperty(value = "师姓名") @ApiModelProperty(value = "师姓名")
@Transient @Transient
private String lecturerName; private String lecturerName;
......
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