最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

黑馬程序員Java企業(yè)級實戰(zhàn)開發(fā)《學成在線》微服務項目,基于SpringClou

2023-06-09 22:01 作者:小蔡coding  | 我要投稿

課程計劃排序代碼如下:

@Override

??public void orderByUpOrDown(String moveType, Long teachplanId) {

????Teachplan teachplan = teachplanMapper.selectById(teachplanId);

????Integer grade = teachplan.getGrade();


????if (moveType.equals("moveup") || moveType.equals("movedown") && (grade == 1 || grade == 2)) {

??????changePostition(teachplan, moveType);

????}

?????

??}


??private void changePostition(Teachplan teachplan, String moveType) {


//????定位上一個標題或下一個標題

????LambdaQueryWrapper<Teachplan> wrapper = new LambdaQueryWrapper<>();

????int offset = moveType.equals("moveup") ? -1 : 1;


????wrapper.eq(Teachplan::getOrderby, teachplan.getOrderby() + offset)

????????.eq(Teachplan::getCourseId, teachplan.getCourseId())

????????.eq(Teachplan::getGrade, teachplan.getGrade());

????Teachplan beforeTeachPlan = teachplanMapper.selectOne(wrapper);

????if (beforeTeachPlan == null) {

??????throw new XueChengPlusException("不能移動了");

????}

????beforeTeachPlan.setOrderby(teachplan.getOrderby());

????teachplanMapper.updateById(beforeTeachPlan);


//????定位當前標題

????Teachplan currentTachPlan = teachplanMapper.selectById(teachplan.getId());

????currentTachPlan.setOrderby(teachplan.getOrderby() + offset);

????teachplanMapper.updateById(currentTachPlan);


??}

黑馬程序員Java企業(yè)級實戰(zhàn)開發(fā)《學成在線》微服務項目,基于SpringClou的評論 (共 條)

分享到微博請遵守國家法律
化德县| 瓮安县| 漯河市| 长泰县| 江川县| 门头沟区| 滨海县| 花莲县| 清水河县| 安塞县| 岳阳市| 朔州市| 鄂州市| 桃园县| 称多县| 武冈市| 秦安县| 屯昌县| 新丰县| 临泽县| 蓬溪县| 西青区| 云安县| 吉林省| 屯昌县| 邵武市| 界首市| 贺兰县| 佛学| 华池县| 林芝县| 汶上县| 永定县| 汤阴县| 阿克陶县| 吉安县| 华安县| 龙里县| 遂平县| 大同市| 济阳县|