管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-23 c0869b3fbf71760199750cb208046692a34b3f2d
1
已修改4个文件
30 ■■■■ 文件已修改
src/main/java/com/lf/server/controller/all/BaseQueryController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/DepMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/DepService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/DepMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -460,18 +460,18 @@
    }
    @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) {
src/main/java/com/lf/server/mapper/sys/DepMapper.java
@@ -65,12 +65,12 @@
    public DepEntity selectDep(int id);
    /**
     * 根据单位ID集合查询
     * 根据单位编码数组查询
     *
     * @param ids
     * @param codes
     * @return
     */
    public List<IdNameEntity> selectDepsByIds(Integer[] ids);
    public List<IdNameEntity> selectDepsByCodes(String[] codes);
    /**
     * 查询所有
src/main/java/com/lf/server/service/sys/DepService.java
@@ -50,8 +50,8 @@
    }
    @Override
    public List<IdNameEntity> selectDepsByIds(Integer[] ids) {
        return depMapper.selectDepsByIds(ids);
    public List<IdNameEntity> selectDepsByCodes(String[] codes) {
        return depMapper.selectDepsByCodes(codes);
    }
    @Override
src/main/resources/mapper/sys/DepMapper.xml
@@ -26,10 +26,10 @@
        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>