Commit a7eca626 authored by luben's avatar luben

fix

parent 6795e755
...@@ -191,6 +191,7 @@ public class RegionController extends BaseController { ...@@ -191,6 +191,7 @@ public class RegionController extends BaseController {
}else { }else {
body.setStatus(level); body.setStatus(level);
} }
body.setPosition(gridRegionMapper.selectMaxPosition(body.getWgParentId())+1);
return gridRegionFacadeService.commit(body, "insert"); return gridRegionFacadeService.commit(body, "insert");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -1032,6 +1033,7 @@ public class RegionController extends BaseController { ...@@ -1032,6 +1033,7 @@ public class RegionController extends BaseController {
}else { }else {
body.setStatus(level); body.setStatus(level);
} }
body.setPosition(gridRegionMapper.selectMaxPosition(body.getWgParentId())+1);
return gridRegionFacadeService.commit(body, "insert"); return gridRegionFacadeService.commit(body, "insert");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -92,4 +92,6 @@ public interface GridRegionMapper { ...@@ -92,4 +92,6 @@ public interface GridRegionMapper {
int updatePositionByWgCodes(@Param("wgCode") String wgCode); int updatePositionByWgCodes(@Param("wgCode") String wgCode);
int countByFourthCode(String code); int countByFourthCode(String code);
int selectMaxPosition(@Param("wgCode") String wgCode);
} }
\ No newline at end of file
...@@ -783,5 +783,10 @@ ...@@ -783,5 +783,10 @@
select count(*) from house_resource select count(*) from house_resource
where four = #{code} or three = #{code} where four = #{code} or three = #{code}
</select> </select>
<select id="selectMaxPosition" resultType="java.lang.Integer">
SELECT MAX(position)
FROM grid_region
WHERE wg_parent_id = #{wgCode}
</select>
</mapper> </mapper>
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