| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据单位ID集合查询单位") |
| | | @ApiOperation(value = "根据单位编码数组查询单位") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "单位ID集合", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1,10") |
| | | @ApiImplicitParam(name = "codes", value = "单位编码数组", dataType = "String", paramType = "query", allowMultiple = true, example = "00,0001") |
| | | }) |
| | | @GetMapping(value = "/selectDepsByIds") |
| | | public ResponseMsg<Object> selectDepsByIds(Integer[] ids) { |
| | | @GetMapping(value = "/selectDepsByCodes") |
| | | public ResponseMsg<Object> selectDepsByCodes(String[] codes) { |
| | | try { |
| | | if (null == ids || ids.length == 0) { |
| | | if (null == codes || codes.length == 0) { |
| | | return fail("单位ID集合为空"); |
| | | } |
| | | |
| | | List<IdNameEntity> list = depService.selectDepsByIds(ids); |
| | | List<IdNameEntity> list = depService.selectDepsByCodes(codes); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | public DepEntity selectDep(int id); |
| | | |
| | | /** |
| | | * 根据单位ID集合查询 |
| | | * 根据单位编码数组查询 |
| | | * |
| | | * @param ids |
| | | * @param codes |
| | | * @return |
| | | */ |
| | | public List<IdNameEntity> selectDepsByIds(Integer[] ids); |
| | | public List<IdNameEntity> selectDepsByCodes(String[] codes); |
| | | |
| | | /** |
| | | * 查询所有 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<IdNameEntity> selectDepsByIds(Integer[] ids) { |
| | | return depMapper.selectDepsByIds(ids); |
| | | public List<IdNameEntity> selectDepsByCodes(String[] codes) { |
| | | return depMapper.selectDepsByCodes(codes); |
| | | } |
| | | |
| | | @Override |
| | |
| | | select * from lf.sys_dep where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectDepsByIds" resultType="com.lf.server.entity.ctrl.IdNameEntity"> |
| | | select id "id",fn_get_fullname(depcode, 1) "name" from lf.sys_dep where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | <select id="selectDepsByCodes" resultType="com.lf.server.entity.ctrl.IdNameEntity"> |
| | | select id "id",fn_get_fullname(code, 1) "name" from lf.sys_dep where code in |
| | | <foreach item="code" collection="codes" index="index" open="(" separator="," close=")"> |
| | | #{code} |
| | | </foreach> |
| | | </select> |
| | | |