|
|
@@ -450,6 +450,43 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
Integer size) {
|
|
|
return jtBusinessProjectMapper.getModuleByName(name, isHost, size);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int updateProjectMoveUp(String id) {
|
|
|
+ JtBusinessCategory j1=jtBusinessCategoryMapper.selectByPrimaryKey(id);
|
|
|
+ JtBusinessCategory j2=jtBusinessCategoryMapper.selectFirstLevel(id,j1.getModule(),j1.getLayer(),0);
|
|
|
+ if(null==j1||null==j2){
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ Integer i=j1.getSort();
|
|
|
+ JtBusinessCategory jtBusinessCategory=new JtBusinessCategory();
|
|
|
+ jtBusinessCategory.setId(j1.getId());
|
|
|
+ jtBusinessCategory.setSort(j2.getSort());
|
|
|
+ jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
|
|
|
+ jtBusinessCategory.setId(j2.getId());
|
|
|
+ jtBusinessCategory.setSort(i);
|
|
|
+ jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int updateProjectSetTop(String id) {
|
|
|
+ JtBusinessCategory j1=jtBusinessCategoryMapper.selectByPrimaryKey(id);
|
|
|
+ JtBusinessCategory j2=jtBusinessCategoryMapper.selectFirstLevel(id,j1.getModule(),j1.getLayer(),1);
|
|
|
+ if(null==j1||null==j2){
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ Integer i=j1.getSort();
|
|
|
+ JtBusinessCategory jtBusinessCategory=new JtBusinessCategory();
|
|
|
+ jtBusinessCategory.setId(j1.getId());
|
|
|
+ jtBusinessCategory.setSort(j2.getSort());
|
|
|
+ jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
|
|
|
+ jtBusinessCategory.setId(j2.getId());
|
|
|
+ jtBusinessCategory.setSort(i);
|
|
|
+ jtBusinessCategoryMapper.updateByPrimaryKeySelective(jtBusinessCategory);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|