소스 검색

驾驶舱处理数据功能

LAPTOP-BJJ3IV5R\SIWEI 11 달 전
부모
커밋
f33507e598

+ 110 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/controller/TJscSqlController.java

@@ -0,0 +1,110 @@
+package com.onemap.system.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.onemap.common.core.utils.poi.ExcelUtil;
+import com.onemap.common.core.web.controller.BaseController;
+import com.onemap.common.core.web.domain.AjaxResult;
+import com.onemap.common.core.web.page.TableDataInfo;
+import com.onemap.common.log.annotation.Log;
+import com.onemap.common.log.enums.BusinessType;
+import com.onemap.common.security.annotation.RequiresPermissions;
+import com.onemap.common.security.utils.SecurityUtils;
+import com.onemap.system.domain.TJscSql;
+import com.onemap.system.service.ITJscSqlService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 驾驶舱数据处理Controller
+ * 
+ * @author ruoyi
+ * @date 2024-05-30
+ */
+@RestController
+@RequestMapping("/jscsql")
+public class TJscSqlController extends BaseController
+{
+    @Autowired
+    private ITJscSqlService tJscSqlService;
+
+    /**
+     * 查询驾驶舱数据处理列表
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TJscSql tJscSql)
+    {
+        startPage();
+        List<TJscSql> list = tJscSqlService.selectTJscSqlList(tJscSql);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出驾驶舱数据处理列表
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:export')")
+    @Log(title = "驾驶舱数据处理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TJscSql tJscSql)
+    {
+        List<TJscSql> list = tJscSqlService.selectTJscSqlList(tJscSql);
+        ExcelUtil<TJscSql> util = new ExcelUtil<TJscSql>(TJscSql.class);
+        util.exportExcel(response, list, "驾驶舱数据处理数据");
+    }
+
+    /**
+     * 获取驾驶舱数据处理详细信息
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(tJscSqlService.selectTJscSqlById(id));
+    }
+
+    /**
+     * 新增驾驶舱数据处理
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:add')")
+    @Log(title = "驾驶舱数据处理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TJscSql tJscSql)
+    {
+        Long userId = SecurityUtils.getUserId();
+        tJscSql.setCreateBy(String.valueOf(userId));
+        return toAjax(tJscSqlService.insertTJscSql(tJscSql));
+    }
+
+    /**
+     * 修改驾驶舱数据处理
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:edit')")
+    @Log(title = "驾驶舱数据处理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TJscSql tJscSql)
+    {
+        Long userId = SecurityUtils.getUserId();
+        tJscSql.setUpdateBy(String.valueOf(userId));
+        return toAjax(tJscSqlService.updateTJscSql(tJscSql));
+    }
+
+    /**
+     * 删除驾驶舱数据处理
+     */
+    @RequiresPermissions("@ss.hasPermi('system:jsc:data:remove')")
+    @Log(title = "驾驶舱数据处理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(tJscSqlService.deleteTJscSqlByIds(ids));
+    }
+}

+ 82 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/domain/TJscSql.java

@@ -0,0 +1,82 @@
+package com.onemap.system.domain;
+
+import com.onemap.common.core.annotation.Excel;
+import com.onemap.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+/**
+ * 驾驶舱数据处理对象 t_jsc_sql
+ * 
+ * @author ruoyi
+ * @date 2024-05-30
+ */
+public class TJscSql extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private String id;
+
+    /** 处理数据类型 */
+    @Excel(name = "处理数据类型")
+    private String jscType;
+
+    /** 处理数据视图 */
+    @Excel(name = "处理数据视图")
+    private String jscView;
+
+    /** 处理数据SQL */
+    @Excel(name = "处理数据SQL")
+    private String jscSql;
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+    public void setJscType(String jscType) 
+    {
+        this.jscType = jscType;
+    }
+
+    public String getJscType() 
+    {
+        return jscType;
+    }
+    public void setJscView(String jscView) 
+    {
+        this.jscView = jscView;
+    }
+
+    public String getJscView() 
+    {
+        return jscView;
+    }
+    public void setJscSql(String jscSql) 
+    {
+        this.jscSql = jscSql;
+    }
+
+    public String getJscSql() 
+    {
+        return jscSql;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("jscType", getJscType())
+            .append("jscView", getJscView())
+            .append("jscSql", getJscSql())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 62 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/mapper/TJscSqlMapper.java

@@ -0,0 +1,62 @@
+package com.onemap.system.mapper;
+
+import com.onemap.system.domain.TJscSql;
+
+import java.util.List;
+
+/**
+ * 驾驶舱数据处理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-05-30
+ */
+public interface TJscSqlMapper 
+{
+    /**
+     * 查询驾驶舱数据处理
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 驾驶舱数据处理
+     */
+    public TJscSql selectTJscSqlById(String id);
+
+    /**
+     * 查询驾驶舱数据处理列表
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 驾驶舱数据处理集合
+     */
+    public List<TJscSql> selectTJscSqlList(TJscSql tJscSql);
+
+    /**
+     * 新增驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    public int insertTJscSql(TJscSql tJscSql);
+
+    /**
+     * 修改驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    public int updateTJscSql(TJscSql tJscSql);
+
+    /**
+     * 删除驾驶舱数据处理
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 结果
+     */
+    public int deleteTJscSqlById(String id);
+
+    /**
+     * 批量删除驾驶舱数据处理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTJscSqlByIds(String[] ids);
+}

+ 62 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/service/ITJscSqlService.java

@@ -0,0 +1,62 @@
+package com.onemap.system.service;
+
+
+import com.onemap.system.domain.TJscSql;
+import java.util.List;
+
+/**
+ * 驾驶舱数据处理Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-05-30
+ */
+public interface ITJscSqlService 
+{
+    /**
+     * 查询驾驶舱数据处理
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 驾驶舱数据处理
+     */
+    public TJscSql selectTJscSqlById(String id);
+
+    /**
+     * 查询驾驶舱数据处理列表
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 驾驶舱数据处理集合
+     */
+    public List<TJscSql> selectTJscSqlList(TJscSql tJscSql);
+
+    /**
+     * 新增驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    public int insertTJscSql(TJscSql tJscSql);
+
+    /**
+     * 修改驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    public int updateTJscSql(TJscSql tJscSql);
+
+    /**
+     * 批量删除驾驶舱数据处理
+     * 
+     * @param ids 需要删除的驾驶舱数据处理主键集合
+     * @return 结果
+     */
+    public int deleteTJscSqlByIds(String[] ids);
+
+    /**
+     * 删除驾驶舱数据处理信息
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 结果
+     */
+    public int deleteTJscSqlById(String id);
+}

+ 99 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/service/impl/TJscSqlServiceImpl.java

@@ -0,0 +1,99 @@
+package com.onemap.system.service.impl;
+
+import java.util.List;
+
+import com.onemap.common.core.utils.DateUtils;
+import com.onemap.common.core.utils.uuid.UUID;
+import com.onemap.system.domain.TJscSql;
+import com.onemap.system.mapper.TJscSqlMapper;
+import com.onemap.system.service.ITJscSqlService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 驾驶舱数据处理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-05-30
+ */
+@Service
+public class TJscSqlServiceImpl implements ITJscSqlService
+{
+    @Autowired
+    private TJscSqlMapper tJscSqlMapper;
+
+    /**
+     * 查询驾驶舱数据处理
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 驾驶舱数据处理
+     */
+    @Override
+    public TJscSql selectTJscSqlById(String id)
+    {
+        return tJscSqlMapper.selectTJscSqlById(id);
+    }
+
+    /**
+     * 查询驾驶舱数据处理列表
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 驾驶舱数据处理
+     */
+    @Override
+    public List<TJscSql> selectTJscSqlList(TJscSql tJscSql)
+    {
+        return tJscSqlMapper.selectTJscSqlList(tJscSql);
+    }
+
+    /**
+     * 新增驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    @Override
+    public int insertTJscSql(TJscSql tJscSql)
+    {
+        tJscSql.setId(UUID.randomUUID().toString());
+        tJscSql.setCreateTime(DateUtils.getNowDate());
+        return tJscSqlMapper.insertTJscSql(tJscSql);
+    }
+
+    /**
+     * 修改驾驶舱数据处理
+     * 
+     * @param tJscSql 驾驶舱数据处理
+     * @return 结果
+     */
+    @Override
+    public int updateTJscSql(TJscSql tJscSql)
+    {
+        tJscSql.setUpdateTime(DateUtils.getNowDate());
+        return tJscSqlMapper.updateTJscSql(tJscSql);
+    }
+
+    /**
+     * 批量删除驾驶舱数据处理
+     * 
+     * @param ids 需要删除的驾驶舱数据处理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTJscSqlByIds(String[] ids)
+    {
+        return tJscSqlMapper.deleteTJscSqlByIds(ids);
+    }
+
+    /**
+     * 删除驾驶舱数据处理信息
+     * 
+     * @param id 驾驶舱数据处理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTJscSqlById(String id)
+    {
+        return tJscSqlMapper.deleteTJscSqlById(id);
+    }
+}

+ 84 - 0
onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/TJscSqlMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.onemap.system.mapper.TJscSqlMapper">
+    
+    <resultMap type="TJscSql" id="TJscSqlResult">
+        <result property="id"    column="id"    />
+        <result property="jscType"    column="jsc_type"    />
+        <result property="jscView"    column="jsc_view"    />
+        <result property="jscSql"    column="jsc_sql"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTJscSqlVo">
+        select id, jsc_type, jsc_view, jsc_sql, create_by, create_time, update_by, update_time from t_jsc_sql
+    </sql>
+
+    <select id="selectTJscSqlList" parameterType="TJscSql" resultMap="TJscSqlResult">
+        <include refid="selectTJscSqlVo"/>
+        <where>  
+            <if test="jscType != null  and jscType != ''"> and jsc_type = #{jscType}</if>
+            <if test="jscView != null  and jscView != ''"> and jsc_view = #{jscView}</if>
+            <if test="jscSql != null  and jscSql != ''"> and jsc_sql = #{jscSql}</if>
+        </where>
+    </select>
+    
+    <select id="selectTJscSqlById" parameterType="String" resultMap="TJscSqlResult">
+        <include refid="selectTJscSqlVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTJscSql" parameterType="TJscSql" useGeneratedKeys="true" keyProperty="id">
+        insert into t_jsc_sql
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="jscType != null and jscType != ''">jsc_type,</if>
+            <if test="jscView != null">jsc_view,</if>
+            <if test="jscSql != null and jscSql != ''">jsc_sql,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="jscType != null and jscType != ''">#{jscType},</if>
+            <if test="jscView != null">#{jscView},</if>
+            <if test="jscSql != null and jscSql != ''">#{jscSql},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTJscSql" parameterType="TJscSql">
+        update t_jsc_sql
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="jscType != null and jscType != ''">jsc_type = #{jscType},</if>
+            <if test="jscView != null">jsc_view = #{jscView},</if>
+            <if test="jscSql != null and jscSql != ''">jsc_sql = #{jscSql},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTJscSqlById" parameterType="String">
+        delete from t_jsc_sql where id = #{id}
+    </delete>
+
+    <delete id="deleteTJscSqlByIds" parameterType="String">
+        delete from t_jsc_sql where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 28 - 0
sql/pgsql/t_jsc_sql.sql

@@ -0,0 +1,28 @@
+-- 删除表 "t_jsc_sql"(如果存在)
+DROP TABLE IF EXISTS "t_jsc_sql";
+
+-- 创建表 "t_jsc_sql"
+CREATE TABLE "t_jsc_sql"
+(
+    "id"          VARCHAR(50) NOT NULL PRIMARY KEY,  -- ID,UUID
+    "jsc_type"    VARCHAR(30) NOT NULL UNIQUE,    -- 驾驶舱处理数据类型
+    "jsc_view"    VARCHAR(1000),           -- 驾驶舱处理数据视图
+    "jsc_sql"     VARCHAR(1000)  NOT NULL, -- 驾驶舱处理数据SQL
+    "create_by"   VARCHAR(30) NOT NULL,    -- 创建者
+    "create_time" TIMESTAMP  NOT NULL,     -- 创建时间
+    "update_by"   VARCHAR(30),    -- 更新者
+    "update_time" TIMESTAMP    -- 更新时间
+);
+
+-- 添加表注释
+COMMENT ON TABLE "t_jsc_sql" IS '驾驶舱数据处理表';
+
+-- 添加字段注释
+COMMENT ON COLUMN "t_jsc_sql"."id" IS 'ID,暂用UUID';
+COMMENT ON COLUMN "t_jsc_sql"."jsc_type" IS '驾驶舱处理数据类型';
+COMMENT ON COLUMN "t_jsc_sql"."jsc_view" IS '驾驶舱处理数据视图';
+COMMENT ON COLUMN "t_jsc_sql"."jsc_sql" IS '驾驶舱处理数据SQL';
+COMMENT ON COLUMN "t_jsc_sql"."create_by" IS '创建者';
+COMMENT ON COLUMN "t_jsc_sql"."create_time" IS '创建时间';
+COMMENT ON COLUMN "t_jsc_sql"."update_by" IS '更新者';
+COMMENT ON COLUMN "t_jsc_sql"."update_time" IS '更新时间';