当前位置: 首页 > news >正文

实现目录数据的上移(up)、下移(down)、置顶(top)、置底(bottom)的操作

@ApiOperation("8-15 交接班-标签设置排序")@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "id", dataType = "string", required = true),@ApiImplicitParam(name = "orgnCode", value = "机构代码", dataType = "string", required = true),@ApiImplicitParam(name = "sortId", value = "排序id", dataType = "string", required = true),@ApiImplicitParam(name = "sectionCode", value = "科室代码", dataType = "string", required = true),@ApiImplicitParam(name = "button", value = "上移(up)、下移(down)、置顶(top)、置底(bottom)", dataType = "string", required = true),})@GetMapping("sortOperate")public ResponseEntity<Object> sortOperate(@RequestParam("id") String id,@RequestParam("orgnCode") String orgnCode,@RequestParam("sortId") String sortId,@RequestParam("sectionCode") String sectionCode,@RequestParam("button") String button) {return shiftService.sortOperate(id, orgnCode, sortId, sectionCode, button);}
ResponseEntity<Object> sortOperate(String id, String orgnCode, String sortId, String sectionCode, String button);
@Overridepublic ResponseEntity<Object> sortOperate(String id, String orgnCode, String sortId, String sectionCode, String button) {ResponseMessage<Object> responseMessage = new ResponseMessage();//上移(up)、下移(down)、置顶(top)、置底(bottom)if (button != null && button.equals("up")) {//查出小于排序id的第一个HashMap<String, String> sortMap = nursingHandoverMapper.infoBySortUp(orgnCode, sectionCode, sortId);if (sortMap != null && !sortMap.isEmpty()) {String upId = sortMap.get("id");String upSortId = sortMap.get("sortId");if (StringUtil.isNotEmpty(upId) && StringUtil.isNotEmpty(upSortId)) {nursingHandoverMapper.updateBySort(upId, sortId);nursingHandoverMapper.updateBySort(id, upSortId);}}} else if (button != null && button.equals("down")) {HashMap<String, String> sortMap = nursingHandoverMapper.infoBySortDown(orgnCode, sectionCode, sortId);if (sortMap != null && !sortMap.isEmpty()) {String downId = sortMap.get("id");String downSortId = sortMap.get("sortId");if (StringUtil.isNotEmpty(downId) && StringUtil.isNotEmpty(downSortId)) {nursingHandoverMapper.updateBySort(downId, sortId);nursingHandoverMapper.updateBySort(id, downSortId);}}} else if (button != null && button.equals("top")) {HashMap<String, String> sortMap = nursingHandoverMapper.infoBySortTop(orgnCode, sectionCode);if (sortMap != null && !sortMap.isEmpty()) {String topId = sortMap.get("id");String topSortId = sortMap.get("sortId");if (StringUtil.isNotEmpty(topId) && StringUtil.isNotEmpty(topSortId)) {nursingHandoverMapper.updateBySort(topId, sortId);nursingHandoverMapper.updateBySort(id, topSortId);}}} else if (button != null && button.equals("bottom")) {HashMap<String, String> sortMap = nursingHandoverMapper.infoBySortTop(orgnCode, sectionCode);if (sortMap != null && !sortMap.isEmpty()) {String bottomId = sortMap.get("id");String bottomSortId = sortMap.get("sortId");if (StringUtil.isNotEmpty(bottomId) && StringUtil.isNotEmpty(bottomSortId)) {nursingHandoverMapper.updateBySort(bottomId, sortId);nursingHandoverMapper.updateBySort(id, bottomSortId);}}}responseMessage.setCode("T").setMessage("success");return new ResponseEntity<>(responseMessage, HttpStatus.OK);}
HashMap<String, String> infoBySortUp(@Param("orgnCode") String orgnCode, @Param("sectionCode") String sectionCode, @Param("sortId") String sortId);<select id="infoBySortUp" resultType="java.util.HashMap">SELECT top 1 ID id, SORT_ID sortIdfrom NEMR_SET_SHIFTWHERE ORGN_CODE = #{orgnCode}AND SECTION_CODE = #{sectionCode}AND SORT_ID &lt; #{sortId}ORDER BY SORT_ID DESC</select>
HashMap<String, String> infoBySortDown(@Param("orgnCode") String orgnCode, @Param("sectionCode") String sectionCode, @Param("sortId") String sortId);<select id="infoBySortDown" resultType="java.util.HashMap">SELECT top 1 ID id, SORT_ID sortIdfrom NEMR_SET_SHIFTWHERE ORGN_CODE = #{orgnCode}AND SECTION_CODE = #{sectionCode}AND SORT_ID &gt; #{sortId}ORDER BY SORT_ID asc</select>
HashMap<String, String> infoBySortTop(@Param("orgnCode") String orgnCode, @Param("sectionCode") String sectionCode);<select id="infoBySortTop" resultType="java.util.HashMap">SELECT top 1 ID id, SORT_ID sortIdFROM NEMR_SET_SHIFT(nolock)WHERE ORGN_CODE = #{orgnCode}AND SECTION_CODE = #{sectionCode}order by SORT_ID asc</select>
HashMap<String, String> infoBySortTop(@Param("orgnCode") String orgnCode, @Param("sectionCode") String sectionCode);<select id="infoBySortTop" resultType="java.util.HashMap">SELECT top 1 ID id, SORT_ID sortIdFROM NEMR_SET_SHIFT(nolock)WHERE ORGN_CODE = #{orgnCode}AND SECTION_CODE = #{sectionCode}order by SORT_ID asc</select>
http://www.lryc.cn/news/204394.html

相关文章:

  • Ubuntu 常用命令
  • 如何空手套白狼?一口气省7K再抓住一个7K起步的工作?
  • 电脑主机如何选择内存条
  • 计算机考研自命题(5)
  • 【原创】c语言4种字符串函数的代码测试
  • 扩散模型学习——代码学习
  • redis 数据结构
  • node.js中express框架cookie-parser包设置cookie的问题
  • Docker命令手册
  • Selenium+Pytest自动化测试框架详解
  • CentOS7安装部署CDH6.2.1
  • 海思Hi3519DV500边缘计算盒子-英码IVP09A,双核A55 64位处理器
  • 理解数据库
  • RHCE---Shell基础 2
  • Git报错解决
  • TechSmith Camtasia 2023 for Mac 屏幕录像视频录制编辑软件
  • 高效MMdetection(3.1.0)环境安装和训练自己数据集教程(实现于Linux(ubuntu),可在windows尝试)
  • 软考-入侵检测技术原理与应用
  • openGaussDatakit让运维如丝般顺滑!
  • 整理MongoDB文档:身份验证
  • 逐字稿 | 视频理解论文串讲(下)【论文精读】
  • 【C++入门:C++世界的奇幻之旅】
  • rancher2.6.4配置管理k8s,docker安装
  • ​​​​​​​Python---练习:使用while嵌套循环打印 9 x 9乘法表
  • 仅手机大小!极空间T2随身数据魔盒发布:既是NAS 又是U盘
  • 设计院图纸加密防泄密方案——天锐绿盾加密软件@德人合科技
  • AD9371 官方例程HDL详解之JESD204B TX侧时钟生成 (二)
  • 实用新型和发明的区别
  • Oracle通过透明网关查询SQL Server 报错ORA-00904
  • MySQL表操作—存储