田间灌溉项目管理 轮灌组 实现获取未绑定轮灌组的灌溉单元id 接口
| | |
| | | |
| | | //查一个轮灌组绑定的灌溉单元id |
| | | List<Long> getGroupBindUnits(Long groupId); |
| | | //查未绑定轮灌组的灌溉单元id |
| | | List<Long> getNotBindUnits(); |
| | | } |
| | |
| | | <select id="getGroupBindUnits" parameterType="Long" resultType="java.lang.Long"> |
| | | SELECT unit_id AS unitId FROM `ir_group_unit`WHERE group_id = #{groupId,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="getNotBindUnits" resultType="java.lang.Long"> |
| | | SELECT id FROM ir_irrigate_unit WHERE id NOT IN (SELECT unit_id FROM ir_group_unit) |
| | | </select> |
| | | </mapper> |
| | |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping(path = "notBind_units") |
| | | @SsoAop() |
| | | public BaseResponse<List<Long>> getNotBindUnits() { |
| | | try { |
| | | List<Long> res = irrigateGroupSv.getNotBindUnits(); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取未绑定轮灌组的灌溉单元id记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Long> groupBindUnits = irGroupUnitMapper.getGroupBindUnits(groupId); |
| | | return groupBindUnits; |
| | | } |
| | | |
| | | /** |
| | | * //查未绑定轮灌组的灌溉单元id |
| | | * @return |
| | | */ |
| | | public List<Long> getNotBindUnits() { |
| | | List<Long> notBindUnits = irGroupUnitMapper.getNotBindUnits(); |
| | | return notBindUnits; |
| | | } |
| | | } |