Bläddra i källkod

发改委预警配置

LIVE_YE 2 år sedan
förälder
incheckning
fef068269a

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fgw/FgwYjpzController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.fgw;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.fgw.FgwYjpz;
+import com.ruoyi.system.service.fgw.IFgwYjpzService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 发改委_预警配置Controller
+ * 
+ * @author ruoyi
+ * @date 2023-03-30
+ */
+@RestController
+@RequestMapping("/fgw/yjpz")
+public class FgwYjpzController extends BaseController
+{
+    @Autowired
+    private IFgwYjpzService fgwYjpzService;
+
+    /**
+     * 查询发改委_预警配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FgwYjpz fgwYjpz)
+    {
+        startPage();
+        List<FgwYjpz> list = fgwYjpzService.selectFgwYjpzList(fgwYjpz);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出发改委_预警配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:export')")
+    @Log(title = "发改委_预警配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, FgwYjpz fgwYjpz)
+    {
+        List<FgwYjpz> list = fgwYjpzService.selectFgwYjpzList(fgwYjpz);
+        ExcelUtil<FgwYjpz> util = new ExcelUtil<FgwYjpz>(FgwYjpz.class);
+        util.exportExcel(response, list, "发改委_预警配置数据");
+    }
+
+    /**
+     * 获取发改委_预警配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(fgwYjpzService.selectFgwYjpzById(id));
+    }
+
+    /**
+     * 新增发改委_预警配置
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:add')")
+    @Log(title = "发改委_预警配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FgwYjpz fgwYjpz)
+    {
+        return toAjax(fgwYjpzService.insertFgwYjpz(fgwYjpz));
+    }
+
+    /**
+     * 修改发改委_预警配置
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:edit')")
+    @Log(title = "发改委_预警配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody FgwYjpz fgwYjpz)
+    {
+        return toAjax(fgwYjpzService.updateFgwYjpz(fgwYjpz));
+    }
+
+    /**
+     * 删除发改委_预警配置
+     */
+    @PreAuthorize("@ss.hasPermi('fgw:yjpz:remove')")
+    @Log(title = "发改委_预警配置", businessType = BusinessType.DELETE)
+	@GetMapping("/delete/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fgwYjpzService.deleteFgwYjpzByIds(ids));
+    }
+}

+ 70 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwYjpz.java

@@ -0,0 +1,70 @@
+package com.ruoyi.system.domain.fgw;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 发改委_预警配置对象 fgw_yjpz
+ * 
+ * @author ruoyi
+ * @date 2023-03-30
+ */
+public class FgwYjpz extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 预警天数 */
+    @Excel(name = "预警天数")
+    private Long yjts;
+
+    /** 严重超期天数(红牌预警) */
+    @Excel(name = "严重超期天数")
+    private Long yzcqts;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setYjts(Long yjts) 
+    {
+        this.yjts = yjts;
+    }
+
+    public Long getYjts() 
+    {
+        return yjts;
+    }
+    public void setYzcqts(Long yzcqts) 
+    {
+        this.yzcqts = yzcqts;
+    }
+
+    public Long getYzcqts() 
+    {
+        return yzcqts;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("yjts", getYjts())
+            .append("yzcqts", getYzcqts())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwYjpzMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper.fgw;
+
+import java.util.List;
+import com.ruoyi.system.domain.fgw.FgwYjpz;
+
+/**
+ * 发改委_预警配置Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-30
+ */
+public interface FgwYjpzMapper 
+{
+    /**
+     * 查询发改委_预警配置
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 发改委_预警配置
+     */
+    public FgwYjpz selectFgwYjpzById(Long id);
+
+    /**
+     * 查询发改委_预警配置列表
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 发改委_预警配置集合
+     */
+    public List<FgwYjpz> selectFgwYjpzList(FgwYjpz fgwYjpz);
+
+    /**
+     * 新增发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    public int insertFgwYjpz(FgwYjpz fgwYjpz);
+
+    /**
+     * 修改发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    public int updateFgwYjpz(FgwYjpz fgwYjpz);
+
+    /**
+     * 删除发改委_预警配置
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 结果
+     */
+    public int deleteFgwYjpzById(Long id);
+
+    /**
+     * 批量删除发改委_预警配置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteFgwYjpzByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwYjpzService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service.fgw;
+
+import java.util.List;
+import com.ruoyi.system.domain.fgw.FgwYjpz;
+
+/**
+ * 发改委_预警配置Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-30
+ */
+public interface IFgwYjpzService 
+{
+    /**
+     * 查询发改委_预警配置
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 发改委_预警配置
+     */
+    public FgwYjpz selectFgwYjpzById(Long id);
+
+    /**
+     * 查询发改委_预警配置列表
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 发改委_预警配置集合
+     */
+    public List<FgwYjpz> selectFgwYjpzList(FgwYjpz fgwYjpz);
+
+    /**
+     * 新增发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    public int insertFgwYjpz(FgwYjpz fgwYjpz);
+
+    /**
+     * 修改发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    public int updateFgwYjpz(FgwYjpz fgwYjpz);
+
+    /**
+     * 批量删除发改委_预警配置
+     * 
+     * @param ids 需要删除的发改委_预警配置主键集合
+     * @return 结果
+     */
+    public int deleteFgwYjpzByIds(Long[] ids);
+
+    /**
+     * 删除发改委_预警配置信息
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 结果
+     */
+    public int deleteFgwYjpzById(Long id);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwYjpzServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl.fgw;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.fgw.FgwYjpzMapper;
+import com.ruoyi.system.domain.fgw.FgwYjpz;
+import com.ruoyi.system.service.fgw.IFgwYjpzService;
+
+/**
+ * 发改委_预警配置Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-03-30
+ */
+@Service
+public class FgwYjpzServiceImpl implements IFgwYjpzService 
+{
+    @Autowired
+    private FgwYjpzMapper fgwYjpzMapper;
+
+    /**
+     * 查询发改委_预警配置
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 发改委_预警配置
+     */
+    @Override
+    public FgwYjpz selectFgwYjpzById(Long id)
+    {
+        return fgwYjpzMapper.selectFgwYjpzById(id);
+    }
+
+    /**
+     * 查询发改委_预警配置列表
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 发改委_预警配置
+     */
+    @Override
+    public List<FgwYjpz> selectFgwYjpzList(FgwYjpz fgwYjpz)
+    {
+        return fgwYjpzMapper.selectFgwYjpzList(fgwYjpz);
+    }
+
+    /**
+     * 新增发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    @Override
+    public int insertFgwYjpz(FgwYjpz fgwYjpz)
+    {
+        fgwYjpz.setCreateTime(DateUtils.getNowDate());
+        return fgwYjpzMapper.insertFgwYjpz(fgwYjpz);
+    }
+
+    /**
+     * 修改发改委_预警配置
+     * 
+     * @param fgwYjpz 发改委_预警配置
+     * @return 结果
+     */
+    @Override
+    public int updateFgwYjpz(FgwYjpz fgwYjpz)
+    {
+        fgwYjpz.setUpdateTime(DateUtils.getNowDate());
+        return fgwYjpzMapper.updateFgwYjpz(fgwYjpz);
+    }
+
+    /**
+     * 批量删除发改委_预警配置
+     * 
+     * @param ids 需要删除的发改委_预警配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFgwYjpzByIds(Long[] ids)
+    {
+        return fgwYjpzMapper.deleteFgwYjpzByIds(ids);
+    }
+
+    /**
+     * 删除发改委_预警配置信息
+     * 
+     * @param id 发改委_预警配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFgwYjpzById(Long id)
+    {
+        return fgwYjpzMapper.deleteFgwYjpzById(id);
+    }
+}

+ 81 - 0
ruoyi-system/src/main/resources/mapper/system/fgw/FgwYjpzMapper.xml

@@ -0,0 +1,81 @@
+<?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.ruoyi.system.mapper.fgw.FgwYjpzMapper">
+    
+    <resultMap type="FgwYjpz" id="FgwYjpzResult">
+        <result property="id"    column="id"    />
+        <result property="yjts"    column="yjts"    />
+        <result property="yzcqts"    column="yzcqts"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectFgwYjpzVo">
+        select id, yjts, yzcqts, create_by, create_time, update_by, update_time, remark from fgw_yjpz
+    </sql>
+
+    <select id="selectFgwYjpzList" parameterType="FgwYjpz" resultMap="FgwYjpzResult">
+        <include refid="selectFgwYjpzVo"/>
+        <where>  
+            <if test="yjts != null "> and yjts = #{yjts}</if>
+            <if test="yzcqts != null "> and yzcqts = #{yzcqts}</if>
+        </where>
+    </select>
+    
+    <select id="selectFgwYjpzById" parameterType="Long" resultMap="FgwYjpzResult">
+        <include refid="selectFgwYjpzVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFgwYjpz" parameterType="FgwYjpz" useGeneratedKeys="true" keyProperty="id">
+        insert into fgw_yjpz
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="yjts != null">yjts,</if>
+            <if test="yzcqts != null">yzcqts,</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>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="yjts != null">#{yjts},</if>
+            <if test="yzcqts != null">#{yzcqts},</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>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFgwYjpz" parameterType="FgwYjpz">
+        update fgw_yjpz
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="yjts != null">yjts = #{yjts},</if>
+            <if test="yzcqts != null">yzcqts = #{yzcqts},</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>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFgwYjpzById" parameterType="Long">
+        delete from fgw_yjpz where id = #{id}
+    </delete>
+
+    <delete id="deleteFgwYjpzByIds" parameterType="String">
+        delete from fgw_yjpz where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>