This commit is contained in:
glj 2024-01-30 18:09:38 +08:00
commit 044ba6ddee
7 changed files with 231 additions and 1 deletions

View File

@ -0,0 +1,72 @@
package com.kening.vordm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 减灾网址对应关系
* @TableName websites
*/
@TableName(value ="website_link")
@Data
public class WebsiteLink implements Serializable {
/**
* 数据自增列
*/
@TableId
private Long id;
/**
* 减灾网站名称
*/
private String name;
/**
* 减灾网站链接
*/
private String websiteLink;
/**
* 数据条目创建时间
*/
private Date createTime;
/**
* 数据条目创建时间
*/
private Date updateTime;
/**
* 数据条目更新人
*/
private Long updateUser;
/**
* 数据条目创建人
*/
private Long createUser;
/**
* 数据条目创建部门
*/
private Long createDept;
/**
* 状态
*/
private Integer status;
/**
* 是否删除
*/
private Integer isDeleted;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,60 @@
package com.kening.vordm.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.WebsiteLink;
import com.kening.vordm.entity.Websites;
import com.kening.vordm.service.WebsiteLinkService;
import com.kening.vordm.service.WebsitesService;
import lombok.RequiredArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/ui/websiteLink")
public class WebsiteLinkController {
private final WebsiteLinkService websiteLinkService;
@GetMapping("/websitesPage")
public R<IPage<WebsiteLink>> websitesPage(Query query, WebsiteLink websites){
return R.data(websiteLinkService.websitesPage(Condition.getPage(query),websites));
}
/**
* 获取全部数据
* @return
*/
@GetMapping("/getData")
public R<List<WebsiteLink>> websitesPage(){
return R.data(websiteLinkService.list());
}
@PostMapping("/saveWebsites")
public R saveWebsites(@RequestBody WebsiteLink websites){
websites.setCreateTime(new Date());
return R.status(websiteLinkService.save(websites));
}
@DeleteMapping("/remove")
public R remove(@RequestParam String id){
return R.status(websiteLinkService.removeByIds(Func.toLongList(id)));
}
@PostMapping("/updateWebsites")
public R updateWebsites(@RequestBody WebsiteLink websites){
return R.status(websiteLinkService.updateById(websites));
}
@GetMapping("/getWebsitesById")
public R<WebsiteLink> getWebsitesById(Long id){
return R.data(websiteLinkService.getById(id));
}
}

View File

@ -896,7 +896,7 @@
<where>
gmdr.manager_id = #{userId}
and di.respond_status = #{respondStatus}
and di.is_end_apply = 0
<!-- and di.is_end_apply = 0-->
</where>
</select>
<select id="disasterInfoType" resultType="java.util.Map">

View File

@ -0,0 +1,20 @@
package com.kening.vordm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kening.vordm.entity.WebsiteLink;
import com.kening.vordm.entity.Websites;
import org.apache.ibatis.annotations.Param;
/**
* @author G1393
* @description 针对表websites(减灾网址)的数据库操作Mapper
* @createDate 2023-04-04 15:54:31
* @Entity new.domain.Websites
*/
public interface WebsiteLinkMapper extends BaseMapper<WebsiteLink> {
IPage<WebsiteLink> websitesPage(IPage<Object> page, @Param("websites") WebsiteLink websites);
}

View File

@ -0,0 +1,35 @@
<?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.kening.vordm.mapper.WebsiteLinkMapper">
<resultMap id="BaseResultMap" type="com.kening.vordm.entity.Websites">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="link" column="link" jdbcType="VARCHAR"/>
<result property="provider" column="provider" jdbcType="VARCHAR"/>
<result property="disasterId" column="disaster_id" jdbcType="BIGINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="websiteId" column="website_id" jdbcType="BIGINT"/>
<result property="uploadId" column="upload_id" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id,name,website_link,
is_deleted,create_time,update_time,
create_user,update_user,create_dept,status
</sql>
<select id="websitesPage" resultType="com.kening.vordm.entity.WebsiteLink">
SELECT id,name,website_link,
is_deleted,create_time,update_time,
create_user,update_user,create_dept,status
FROM website_link
<where>
<if test="websites.disasterId!=null">
and disaster_id = #{websites.disasterId}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,17 @@
package com.kening.vordm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kening.vordm.entity.WebsiteLink;
import com.kening.vordm.entity.Websites;
/**
* @author G1393
* @description 针对表websites(减灾网址)的数据库操作Service
* @createDate 2023-04-04 15:54:31
*/
public interface WebsiteLinkService extends IService<WebsiteLink> {
IPage<WebsiteLink> websitesPage(IPage<Object> page, WebsiteLink websites);
}

View File

@ -0,0 +1,26 @@
package com.kening.vordm.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kening.vordm.entity.WebsiteLink;
import com.kening.vordm.entity.Websites;
import com.kening.vordm.mapper.WebsiteLinkMapper;
import com.kening.vordm.mapper.WebsitesMapper;
import com.kening.vordm.service.WebsiteLinkService;
import com.kening.vordm.service.WebsitesService;
import org.springframework.stereotype.Service;
/**
* @author G1393
* @description 针对表websites(减灾网址)的数据库操作Service实现
* @createDate 2023-04-04 15:54:31
*/
@Service
public class WebsiteLinkServiceImpl extends ServiceImpl<WebsiteLinkMapper, WebsiteLink>
implements WebsiteLinkService {
@Override
public IPage<WebsiteLink> websitesPage(IPage<Object> page, WebsiteLink websites) {
return this.baseMapper.websitesPage(page, websites);
}
}