Commit 5e9be79f authored by luben's avatar luben

Merge branch 'dev-lb' into 'dev'

Dev lb

See merge request !79
parents c4deb26e c8cbe24d
......@@ -791,4 +791,39 @@ public class RegionController extends BaseController {
List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example);
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 {
List<GridRegion> getAllLevelThreeByType(@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 @@
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="selectThirdGridByBaseId" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select * from grid_region where wg_type='1' and level='3'
</select>
......@@ -682,4 +683,9 @@
and wg_code like CONCAT(#{code}, '%')
and wg_code != #{code}
</select>
<update id="changeTreeNodeName">
update grid_region set name=#{name} where id = #{id}
</update>
</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