管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-04 2b5c7c4ce099728faf6e09b227ea3094b1b10748
1
已修改5个文件
62 ■■■■■ 文件已修改
data/ts.sql 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/all/BaseQueryController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/DepMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/DepService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/DepMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/ts.sql
@@ -108,10 +108,9 @@
select * from lf.sys_download;
select * from bs.m_marker -- 三桩一牌  photono
select * from lf.sys_meta where type='xls' order by id desc
select * from lf.sys_meta where type='xls' order by id desc;
select * from lf.sys_meta where type in ('xls', 'xlsx') and tab is not null and rows > 0 and id in (1209,1180,1387)
src/main/java/com/lf/server/controller/all/BaseQueryController.java
@@ -25,6 +25,7 @@
import com.lf.server.service.data.UploadService;
import com.lf.server.service.show.DataLibService;
import com.lf.server.service.sys.AttachService;
import com.lf.server.service.sys.DepService;
import com.lf.server.service.sys.TokenService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -46,6 +47,9 @@
    @Autowired
    TokenService tokenService;
    @Autowired
    DepService depService;
    @Autowired
    DataLibService dataLibService;
@@ -397,6 +401,26 @@
    }
    @SysLog()
    @ApiOperation(value = "根据单位ID集合查询单位")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "单位ID集合", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1,10")
    })
    @GetMapping(value = "/selectDepsByIds")
    public ResponseMsg<Object> selectDepsByIds(Integer[] ids) {
        try {
            if (null == ids || ids.length == 0) {
                return fail("单位ID集合为空");
            }
            List<IdNameEntity> list = depService.selectDepsByIds(ids);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "请求DB数据下载")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "reqEntity", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body")
src/main/java/com/lf/server/mapper/sys/DepMapper.java
@@ -1,5 +1,6 @@
package com.lf.server.mapper.sys;
import com.lf.server.entity.ctrl.IdNameEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.lf.server.entity.sys.DepEntity;
@@ -17,6 +18,7 @@
public interface DepMapper {
    /**
     * 插入一条
     *
     * @param depEntity
     * @return
     */
@@ -24,12 +26,15 @@
    /**
     * 插入多条
     *
     * @param list
     * @return
     */
    public Integer insertDeps(List<DepEntity> list);
    /**
     * 删除一条
     *
     * @param id
     * @return
     */
@@ -37,6 +42,7 @@
    /**
     * 删除多条
     *
     * @param ids
     * @return
     */
@@ -44,6 +50,7 @@
    /**
     * 更新一条
     *
     * @param depEntity
     * @return
     */
@@ -51,19 +58,30 @@
    /**
     * 查询单条数据
     *
     * @param id
     * @return
     */
    public DepEntity selectDep(int id);
    /**
     * 根据单位ID集合查询
     *
     * @param ids
     * @return
     */
    public List<IdNameEntity> selectDepsByIds(Integer[] ids);
    /**
     * 查询所有
     *
     * @return
     */
    public List<DepEntity> selectDepAll();
    /**
     * 更新多条
     *
     * @param list
     * @return
     */
@@ -71,6 +89,7 @@
    /**
     * 递归查询
     *
     * @param name
     * @return
     */
src/main/java/com/lf/server/service/sys/DepService.java
@@ -1,5 +1,6 @@
package com.lf.server.service.sys;
import com.lf.server.entity.ctrl.IdNameEntity;
import com.lf.server.entity.sys.DepEntity;
import com.lf.server.mapper.sys.DepMapper;
import org.springframework.beans.factory.annotation.Autowired;
@@ -49,6 +50,11 @@
    }
    @Override
    public List<IdNameEntity> selectDepsByIds(Integer[] ids) {
        return depMapper.selectDepsByIds(ids);
    }
    @Override
    public List<DepEntity> selectDepAll() {
        return depMapper.selectDepAll();
    }
src/main/resources/mapper/sys/DepMapper.xml
@@ -21,10 +21,18 @@
        )
        select * FROM rs order by order_num;
    </select>
    <select id="selectDep" resultMap="resultMap" resultType="com.lf.server.entity.sys.DepEntity">
        select * from lf.sys_dep where id = #{id}
    </select>
    <select id="selectDepsByIds" resultType="com.lf.server.entity.ctrl.IdNameEntity">
        select id "id",fn_rec_query(id, 'dep') "name" from lf.sys_dep where id in
        <foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
    <insert id="insertDep"   parameterType="com.lf.server.entity.sys.DepEntity">
       insert into lf.sys_dep
       (pid,name,sname,code,uncode,addr,contact,fax,email,post,website,level,order_num,create_user,create_time,bak)