| | |
| | | ) |
| | | select * FROM rs order by order_num; |
| | | --------------------------------------------------------- 查询单位 |
| | | select * from lf.sys_dep order by order_num;; |
| | | select * from lf.sys_dep order by order_num; |
| | | |
| | | with recursive rs as( |
| | | select * from lf.sys_dep where name='中国石油天然气管道工程有限公司' |
| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.DirService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询数据") |
| | | @ApiImplicitParams({ |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "目录名称", dataType = "String", paramType = "query", required = false, example = "中俄东线管道工程南段") |
| | | }) |
| | | @GetMapping(value = "/selectDirRecursive") |
| | | public ResponseMsg<List<DirEntity>> selectDirRecursive() { |
| | | public ResponseMsg<List<DirEntity>> selectDirRecursive(String name) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirRecursive(); |
| | | if (StringHelper.isEmpty(name)) { |
| | | name = "中俄东线管道工程南段"; |
| | | } |
| | | List<DirEntity> list = dirService.selectDirRecursive(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.DepEntity; |
| | | import com.lf.server.entity.sys.MenusEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.sys.DepService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | |
| | | @Api(tags = "运维管理\\单位管理") |
| | | @RestController |
| | | @RequestMapping("/dep") |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "单位名称", dataType = "String", paramType = "query", required = false, example = "中国石油天然气管道工程有限公司") |
| | | }) |
| | | @GetMapping(value = "/selectDepRecursive") |
| | | public ResponseMsg<List<DepEntity>> selectDepRecursive() { |
| | | public ResponseMsg<List<DepEntity>> selectDepRecursive(String name) { |
| | | try { |
| | | List<DepEntity> list = depService.selectDepRecursive(); |
| | | if (StringHelper.isEmpty(name)) { |
| | | name = "中国石油天然气管道工程有限公司"; |
| | | } |
| | | List<DepEntity> list = depService.selectDepRecursive(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | |
| | | @Api(tags= "运维管理\\菜单管理") |
| | | @RestController |
| | | @RequestMapping("/Menu") |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询数据") |
| | |
| | | |
| | | /** |
| | | * 递归查询 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | public List<DirEntity> selectDirRecursive(); |
| | | public List<DirEntity> selectDirRecursive(String name); |
| | | } |
| | |
| | | * 递归查询 |
| | | * @return |
| | | */ |
| | | public List<DepEntity> selectDepRecursive(); |
| | | public List<DepEntity> selectDepRecursive(String name); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DirEntity> selectDirRecursive() { |
| | | return dirMapper.selectDirRecursive(); |
| | | public List<DirEntity> selectDirRecursive(String name) { |
| | | return dirMapper.selectDirRecursive(name); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DepEntity> selectDepRecursive() { |
| | | return depMapper.selectDepRecursive(); |
| | | public List<DepEntity> selectDepRecursive(String name) { |
| | | return depMapper.selectDepRecursive(name); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectDirRecursive" resultMap="resultMap" resultType="com.lf.server.entity.data.DirEntity"> |
| | | with recursive rs as( |
| | | select * from lf.sys_dir where name='中俄东线管道工程南段' |
| | | select * from lf.sys_dir where name=#{name} |
| | | union |
| | | select a.* from lf.sys_dir a, rs b where a.pid=b.id |
| | | ) |
| | |
| | | |
| | | <update id="updateDir"> |
| | | update lf.sys_dir set pid=#{pid},name=#{name},code=#{code},descr=#{descr},level=#{level},order_num=#{orderNum}, |
| | | update_user=#{updateUser}, update_time=now(),bak=#{bak} where id=#{id} |
| | | update_user=#{updateUser},update_time=now(),bak=#{bak} where id=#{id} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateDirs"> |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_dir |
| | | <set> |
| | | pid=#{item.pid},name=#{item.name},code=#{item.code},descr=#{item.descr},level=#{item.level}, |
| | | order_num=#{item.orderNum},update_user=#{item.updateUser}, update_time=now(),bak=#{item.bak} |
| | | order_num=#{item.orderNum},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak} |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | |
| | | |
| | | <select id="selectDepRecursive" resultMap="resultMap" resultType="com.lf.server.entity.sys.DepEntity"> |
| | | with recursive rs as( |
| | | select * from lf.sys_dep where name='中国石油天然气管道工程有限公司' |
| | | select * from lf.sys_dep where name=#{name} |
| | | union |
| | | select a.* from lf.sys_dep a, rs b where a.pid=b.id |
| | | ) |
| | |
| | | </update> |
| | | |
| | | <update id="updateDeps"> |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_menu |
| | | <set> |
| | | pid=#{item.pid},name=#{item.name},sname=#{item.sname},code=#{item.code},uncode=#{item.uncode},addr=#{item.addr},contact=#{item.contact}, |
| | | fax=#{item.fax},email=#{item.email},post=#{item.post},website=#{item.website},level=#{item.level},order_num =#{item.orderNum}, |
| | | fax=#{item.fax},email=#{item.email},post=#{item.post},website=#{item.website},level=#{item.level},order_num=#{item.orderNum}, |
| | | update_user=#{item.updateUser},update_time=now(),bak=#{item.bak} |
| | | </set> |
| | | where id = #{item.id} |
| | |
| | | </update> |
| | | |
| | | <update id="updateMenus"> |
| | | <foreach collection="list" item="item" index="index" open="" close="" separator=";"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_menu |
| | | <set> |
| | | pid=#{item.pid},cn_name=#{item.cnName},en_name=#{item.enName},url=#{item.url},perms=#{item.perms},type=#{item.type}, |