Commit f8b7d55b authored by luben's avatar luben

Merge branch 'dev' into 'main'

Dev

See merge request !80
parents df2e004f 5e9be79f
Pipeline #143024 passed with stages
in 3 minutes and 40 seconds
...@@ -791,4 +791,39 @@ public class RegionController extends BaseController { ...@@ -791,4 +791,39 @@ public class RegionController extends BaseController {
List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example); List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example);
return AjaxResult.success(gridRegionList); return AjaxResult.success(gridRegionList);
} }
@RequestMapping(value = "/deleteTreeNode",method = RequestMethod.DELETE)
@ResponseBody
public AjaxResult getTwoThreeRegion(@RequestParam(value = "wgType", required = false) String wgType,
@RequestParam(value = "wgCode", required = false) String wgCode
){
GridRegionExample example1 = new GridRegionExample();
GridRegionExample.Criteria criteria1 = example1.createCriteria();
criteria1.andIsValidEqualTo("1");
criteria1.andWgTypeEqualTo(wgType);
criteria1.andWgParentIdEqualTo(wgCode);
long count = gridRegionMapper.countByExample(example1);
if(count>0){
throw new RuntimeException("当前菜单存在下级菜单,无法删除");
}
GridRegionExample example = new GridRegionExample();
GridRegionExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo("1");
criteria.andWgTypeEqualTo(wgType);
criteria.andWgCodeEqualTo(wgCode);
return AjaxResult.success(gridRegionMapper.deleteByExample(example));
}
@RequestMapping(value = "/changeName",method = RequestMethod.GET)
@ResponseBody
public AjaxResult changeName(@RequestParam(value = "id", required = false) String id,
@RequestParam(value = "name", required = false) String name
){
return AjaxResult.success(gridRegionMapper.changeTreeNodeName(id,name));
}
} }
...@@ -55,4 +55,6 @@ public interface GridRegionMapper { ...@@ -55,4 +55,6 @@ public interface GridRegionMapper {
List<GridRegion> getAllLevelThreeByType(@Param("type") String type,@Param("code") String code); List<GridRegion> getAllLevelThreeByType(@Param("type") String type,@Param("code") String code);
List<GridRegion> getAllLevelFourByType(@Param("type") String type,@Param("code") String code); List<GridRegion> getAllLevelFourByType(@Param("type") String type,@Param("code") String code);
int changeTreeNodeName(@Param("id") String id, @Param("name") String name);
} }
\ No newline at end of file
...@@ -536,6 +536,7 @@ ...@@ -536,6 +536,7 @@
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<select id="selectThirdGridByBaseId" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> <select id="selectThirdGridByBaseId" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select * from grid_region where wg_type='1' and level='3' select * from grid_region where wg_type='1' and level='3'
</select> </select>
...@@ -682,4 +683,9 @@ ...@@ -682,4 +683,9 @@
and wg_code like CONCAT(#{code}, '%') and wg_code like CONCAT(#{code}, '%')
and wg_code != #{code} and wg_code != #{code}
</select> </select>
<update id="changeTreeNodeName">
update grid_region set name=#{name} where id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
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