ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TPlatform.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-server/src/main/java/com/ycl/platform/controller/TPlatformController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-server/src/main/java/com/ycl/platform/mapper/TPlatformMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-server/src/main/java/com/ycl/platform/service/ITPlatformService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-server/src/main/java/com/ycl/platform/service/impl/TPlatformServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ycl-server/src/main/resources/mapper/zgyw/TPlatformMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/TPlatform.java
New file @@ -0,0 +1,129 @@ package com.ycl.platform.domain.entity; import annotation.Excel; import com.ycl.system.entity.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * 平台运行监控对象 t_platform * * @author gonghl * @date 2024-04-10 */ public class TPlatform extends BaseEntity { private static final long serialVersionUID = 1L; /** * 主键 */ private Long id; /** * 平台编码 */ @Excel(name = "平台编码") private String platformCode; /** * 平台名称 */ @Excel(name = "平台名称") private String platformName; /** * 平台联系人 */ @Excel(name = "平台联系人") private String platformContact; /** * 平台联系人电话 */ @Excel(name = "平台联系人电话") private String platformContactPhone; /** * 状态:1正常 2异常 */ @Excel(name = "状态:1正常 2异常") private String status; /** * 逻辑删除:0未删除 1删除 */ private String deleted; public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setPlatformCode(String platformCode) { this.platformCode = platformCode; } public String getPlatformCode() { return platformCode; } public void setPlatformName(String platformName) { this.platformName = platformName; } public String getPlatformName() { return platformName; } public void setPlatformContact(String platformContact) { this.platformContact = platformContact; } public String getPlatformContact() { return platformContact; } public void setPlatformContactPhone(String platformContactPhone) { this.platformContactPhone = platformContactPhone; } public String getPlatformContactPhone() { return platformContactPhone; } public void setStatus(String status) { this.status = status; } public String getStatus() { return status; } public void setDeleted(String deleted) { this.deleted = deleted; } public String getDeleted() { return deleted; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("platformCode", getPlatformCode()) .append("platformName", getPlatformName()) .append("platformContact", getPlatformContact()) .append("platformContactPhone", getPlatformContactPhone()) .append("status", getStatus()) .append("remark", getRemark()) .append("createTime", getCreateTime()) .append("updateTime", getUpdateTime()) .append("deleted", getDeleted()) .toString(); } } ycl-server/src/main/java/com/ycl/platform/controller/TPlatformController.java
New file @@ -0,0 +1,90 @@ package com.ycl.platform.controller; import annotation.Log; import com.ycl.platform.domain.entity.TPlatform; import com.ycl.platform.service.ITPlatformService; import com.ycl.system.AjaxResult; import com.ycl.system.controller.BaseController; import com.ycl.system.page.TableDataInfo; import com.ycl.utils.poi.ExcelUtil; import enumeration.BusinessType; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 平台运行监控Controller * * @author gonghl * @date 2024-04-10 */ @RestController @RequestMapping("/platform/platformMonitor") public class TPlatformController extends BaseController { @Autowired private ITPlatformService tPlatformService; /** * 查询平台运行监控列表 */ // @PreAuthorize("@ss.hasPermi('platform:platform:list')") @GetMapping("/list") public TableDataInfo list(TPlatform tPlatform) { startPage(); List<TPlatform> list = tPlatformService.selectTPlatformList(tPlatform); return getDataTable(list); } /** * 导出平台运行监控列表 */ // @PreAuthorize("@ss.hasPermi('platform:platform:export')") @Log(title = "平台运行监控", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TPlatform tPlatform) { List<TPlatform> list = tPlatformService.selectTPlatformList(tPlatform); ExcelUtil<TPlatform> util = new ExcelUtil<TPlatform>(TPlatform.class); util.exportExcel(response, list, "平台运行监控数据"); } /** * 获取平台运行监控详细信息 */ // @PreAuthorize("@ss.hasPermi('platform:platform:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tPlatformService.selectTPlatformById(id)); } /** * 新增平台运行监控 */ // @PreAuthorize("@ss.hasPermi('platform:platform:add')") @Log(title = "平台运行监控", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TPlatform tPlatform) { return toAjax(tPlatformService.insertTPlatform(tPlatform)); } /** * 修改平台运行监控 */ // @PreAuthorize("@ss.hasPermi('platform:platform:edit')") @Log(title = "平台运行监控", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TPlatform tPlatform) { return toAjax(tPlatformService.updateTPlatform(tPlatform)); } /** * 删除平台运行监控 */ // @PreAuthorize("@ss.hasPermi('platform:platform:remove')") @Log(title = "平台运行监控", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tPlatformService.deleteTPlatformByIds(ids)); } } ycl-server/src/main/java/com/ycl/platform/mapper/TPlatformMapper.java
New file @@ -0,0 +1,61 @@ package com.ycl.platform.mapper; import com.ycl.platform.domain.entity.TPlatform; import java.util.List; /** * 平台运行监控Mapper接口 * * @author gonghl * @date 2024-04-10 */ public interface TPlatformMapper { /** * 查询平台运行监控 * * @param id 平台运行监控主键 * @return 平台运行监控 */ public TPlatform selectTPlatformById(Long id); /** * 查询平台运行监控列表 * * @param tPlatform 平台运行监控 * @return 平台运行监控集合 */ public List<TPlatform> selectTPlatformList(TPlatform tPlatform); /** * 新增平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ public int insertTPlatform(TPlatform tPlatform); /** * 修改平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ public int updateTPlatform(TPlatform tPlatform); /** * 删除平台运行监控 * * @param id 平台运行监控主键 * @return 结果 */ public int deleteTPlatformById(Long id); /** * 批量删除平台运行监控 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteTPlatformByIds(Long[] ids); } ycl-server/src/main/java/com/ycl/platform/service/ITPlatformService.java
New file @@ -0,0 +1,61 @@ package com.ycl.platform.service; import com.ycl.platform.domain.entity.TPlatform; import java.util.List; /** * 平台运行监控Service接口 * * @author gonghl * @date 2024-04-10 */ public interface ITPlatformService { /** * 查询平台运行监控 * * @param id 平台运行监控主键 * @return 平台运行监控 */ public TPlatform selectTPlatformById(Long id); /** * 查询平台运行监控列表 * * @param tPlatform 平台运行监控 * @return 平台运行监控集合 */ public List<TPlatform> selectTPlatformList(TPlatform tPlatform); /** * 新增平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ public int insertTPlatform(TPlatform tPlatform); /** * 修改平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ public int updateTPlatform(TPlatform tPlatform); /** * 批量删除平台运行监控 * * @param ids 需要删除的平台运行监控主键集合 * @return 结果 */ public int deleteTPlatformByIds(Long[] ids); /** * 删除平台运行监控信息 * * @param id 平台运行监控主键 * @return 结果 */ public int deleteTPlatformById(Long id); } ycl-server/src/main/java/com/ycl/platform/service/impl/TPlatformServiceImpl.java
New file @@ -0,0 +1,90 @@ package com.ycl.platform.service.impl; import com.ycl.platform.domain.entity.TPlatform; import com.ycl.platform.mapper.TPlatformMapper; import com.ycl.platform.service.ITPlatformService; import com.ycl.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 平台运行监控Service业务层处理 * * @author gonghl * @date 2024-04-10 */ @Service public class TPlatformServiceImpl implements ITPlatformService { @Autowired private TPlatformMapper tPlatformMapper; /** * 查询平台运行监控 * * @param id 平台运行监控主键 * @return 平台运行监控 */ @Override public TPlatform selectTPlatformById(Long id) { return tPlatformMapper.selectTPlatformById(id); } /** * 查询平台运行监控列表 * * @param tPlatform 平台运行监控 * @return 平台运行监控 */ @Override public List<TPlatform> selectTPlatformList(TPlatform tPlatform) { return tPlatformMapper.selectTPlatformList(tPlatform); } /** * 新增平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ @Override public int insertTPlatform(TPlatform tPlatform) { tPlatform.setCreateTime(DateUtils.getNowDate()); return tPlatformMapper.insertTPlatform(tPlatform); } /** * 修改平台运行监控 * * @param tPlatform 平台运行监控 * @return 结果 */ @Override public int updateTPlatform(TPlatform tPlatform) { tPlatform.setUpdateTime(DateUtils.getNowDate()); return tPlatformMapper.updateTPlatform(tPlatform); } /** * 批量删除平台运行监控 * * @param ids 需要删除的平台运行监控主键 * @return 结果 */ @Override public int deleteTPlatformByIds(Long[] ids) { return tPlatformMapper.deleteTPlatformByIds(ids); } /** * 删除平台运行监控信息 * * @param id 平台运行监控主键 * @return 结果 */ @Override public int deleteTPlatformById(Long id) { return tPlatformMapper.deleteTPlatformById(id); } } ycl-server/src/main/resources/mapper/zgyw/TPlatformMapper.xml
New file @@ -0,0 +1,103 @@ <?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.ycl.platform.mapper.TPlatformMapper"> <resultMap type="TPlatform" id="TPlatformResult"> <result property="id" column="id" /> <result property="platformCode" column="platform_code" /> <result property="platformName" column="platform_name" /> <result property="platformContact" column="platform_contact" /> <result property="platformContactPhone" column="platform_contact_phone" /> <result property="status" column="status" /> <result property="remark" column="remark" /> <result property="createTime" column="create_time" /> <result property="updateTime" column="update_time" /> <result property="deleted" column="deleted" /> </resultMap> <sql id="selectTPlatformVo"> select id, platform_code, platform_name, platform_contact, platform_contact_phone, status, remark, create_time, update_time, deleted from t_platform </sql> <select id="selectTPlatformList" parameterType="TPlatform" resultMap="TPlatformResult"> <include refid="selectTPlatformVo"/> <where> <if test="platformCode != null and platformCode != ''"> and platform_code = #{platformCode}</if> <if test="platformName != null and platformName != ''"> and platform_name like concat('%', #{platformName}, '%')</if> <if test="platformContact != null and platformContact != ''"> and platform_contact = #{platformContact}</if> <if test="platformContactPhone != null and platformContactPhone != ''"> and platform_contact_phone = #{platformContactPhone}</if> <if test="status != null and status != ''"> and status = #{status}</if> <if test="remark != null and remark != ''"> and remark = #{remark}</if> </where> </select> <select id="selectTPlatformById" parameterType="Long" resultMap="TPlatformResult"> <include refid="selectTPlatformVo"/> where id = #{id} </select> <insert id="insertTPlatform" parameterType="TPlatform" useGeneratedKeys="true" keyProperty="id"> insert into t_platform <trim prefix="(" suffix=")" suffixOverrides=","> <if test="platformCode != null and platformCode != ''">platform_code,</if> <if test="platformName != null and platformName != ''">platform_name,</if> <if test="platformContact != null and platformContact != ''">platform_contact,</if> <if test="platformContactPhone != null and platformContactPhone != ''">platform_contact_phone,</if> <if test="status != null">status,</if> <if test="remark != null">remark,</if> <if test="createTime != null">create_time,</if> <if test="updateTime != null">update_time,</if> <if test="deleted != null">deleted,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="platformCode != null and platformCode != ''">#{platformCode},</if> <if test="platformName != null and platformName != ''">#{platformName},</if> <if test="platformContact != null and platformContact != ''">#{platformContact},</if> <if test="platformContactPhone != null and platformContactPhone != ''">#{platformContactPhone},</if> <if test="status != null">#{status},</if> <if test="remark != null">#{remark},</if> <if test="createTime != null">#{createTime},</if> <if test="updateTime != null">#{updateTime},</if> <if test="deleted != null">#{deleted},</if> </trim> </insert> <update id="updateTPlatform" parameterType="TPlatform"> update t_platform <trim prefix="SET" suffixOverrides=","> <if test="platformCode != null and platformCode != ''">platform_code = #{platformCode},</if> <if test="platformName != null and platformName != ''">platform_name = #{platformName},</if> <if test="platformContact != null and platformContact != ''">platform_contact = #{platformContact},</if> <if test="platformContactPhone != null and platformContactPhone != ''">platform_contact_phone = #{platformContactPhone},</if> <if test="status != null">status = #{status},</if> <if test="remark != null">remark = #{remark},</if> <if test="createTime != null">create_time = #{createTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if> <if test="deleted != null">deleted = #{deleted},</if> </trim> where id = #{id} </update> <delete id="deleteTPlatformById" parameterType="Long"> delete from t_platform where id = #{id} </delete> <delete id="deleteTPlatformByIds" parameterType="String"> delete from t_platform where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>