生成代码

duhanyu
许宏杰 1 year ago
parent 1dd81fc361
commit 8373805007

@ -0,0 +1,104 @@
package com.ruoyi.tcZz.controller;
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.tcZz.domain.TcSjlytj;
import com.ruoyi.tcZz.service.ITcSjlytjService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* tc_sjlytj Controller
*
* @author ruoyi
* @date 2023-10-12
*/
@RestController
@RequestMapping("/tcZz/networkSecurity/DataSourceTj")
public class TcSjlytjController extends BaseController
{
@Autowired
private ITcSjlytjService tcSjlytjService;
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:list')")
@GetMapping("/list")
public TableDataInfo list(TcSjlytj tcSjlytj)
{
startPage();
List<TcSjlytj> list = tcSjlytjService.selectTcSjlytjList(tcSjlytj);
return getDataTable(list);
}
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:export')")
@Log(title = "数据来源统计tc_sjlytj ", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TcSjlytj tcSjlytj)
{
List<TcSjlytj> list = tcSjlytjService.selectTcSjlytjList(tcSjlytj);
ExcelUtil<TcSjlytj> util = new ExcelUtil<TcSjlytj>(TcSjlytj.class);
util.exportExcel(response, list, "数据来源统计tc_sjlytj 数据");
}
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tcSjlytjService.selectTcSjlytjById(id));
}
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:add')")
@Log(title = "数据来源统计tc_sjlytj ", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TcSjlytj tcSjlytj)
{
return toAjax(tcSjlytjService.insertTcSjlytj(tcSjlytj));
}
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:edit')")
@Log(title = "数据来源统计tc_sjlytj ", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TcSjlytj tcSjlytj)
{
return toAjax(tcSjlytjService.updateTcSjlytj(tcSjlytj));
}
/**
* tc_sjlytj
*/
@PreAuthorize("@ss.hasPermi('tcZz/networkSecurity:DataSourceTj:remove')")
@Log(title = "数据来源统计tc_sjlytj ", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tcSjlytjService.deleteTcSjlytjByIds(ids));
}
}

@ -0,0 +1,98 @@
package com.ruoyi.tcZz.domain;
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;
/**
* tc_sjlytj tc_sjlytj
*
* @author ruoyi
* @date 2023-10-12
*/
public class TcSjlytj extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 云端监测(G) */
@Excel(name = "云端监测(G)")
private String lable1;
/** 云端监测(G)总量 */
@Excel(name = "云端监测(G)总量")
private String lable1Sum;
/** APT(M) */
@Excel(name = "APT(M)")
private String lable2;
/** APT(M) 总量 */
@Excel(name = "APT(M) 总量")
private String lable2Sum;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setLable1(String lable1)
{
this.lable1 = lable1;
}
public String getLable1()
{
return lable1;
}
public void setLable1Sum(String lable1Sum)
{
this.lable1Sum = lable1Sum;
}
public String getLable1Sum()
{
return lable1Sum;
}
public void setLable2(String lable2)
{
this.lable2 = lable2;
}
public String getLable2()
{
return lable2;
}
public void setLable2Sum(String lable2Sum)
{
this.lable2Sum = lable2Sum;
}
public String getLable2Sum()
{
return lable2Sum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("lable1", getLable1())
.append("lable1Sum", getLable1Sum())
.append("lable2", getLable2())
.append("lable2Sum", getLable2Sum())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.tcZz.mapper;
import java.util.List;
import com.ruoyi.tcZz.domain.TcSjlytj;
/**
* tc_sjlytj Mapper
*
* @author ruoyi
* @date 2023-10-12
*/
public interface TcSjlytjMapper
{
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return tc_sjlytj
*/
public TcSjlytj selectTcSjlytjById(Long id);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return tc_sjlytj
*/
public List<TcSjlytj> selectTcSjlytjList(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
public int insertTcSjlytj(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
public int updateTcSjlytj(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return
*/
public int deleteTcSjlytjById(Long id);
/**
* tc_sjlytj
*
* @param ids
* @return
*/
public int deleteTcSjlytjByIds(Long[] ids);
}

@ -0,0 +1,61 @@
package com.ruoyi.tcZz.service;
import java.util.List;
import com.ruoyi.tcZz.domain.TcSjlytj;
/**
* tc_sjlytj Service
*
* @author ruoyi
* @date 2023-10-12
*/
public interface ITcSjlytjService
{
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return tc_sjlytj
*/
public TcSjlytj selectTcSjlytjById(Long id);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return tc_sjlytj
*/
public List<TcSjlytj> selectTcSjlytjList(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
public int insertTcSjlytj(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
public int updateTcSjlytj(TcSjlytj tcSjlytj);
/**
* tc_sjlytj
*
* @param ids tc_sjlytj
* @return
*/
public int deleteTcSjlytjByIds(Long[] ids);
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return
*/
public int deleteTcSjlytjById(Long id);
}

@ -0,0 +1,96 @@
package com.ruoyi.tcZz.service.impl;
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.tcZz.mapper.TcSjlytjMapper;
import com.ruoyi.tcZz.domain.TcSjlytj;
import com.ruoyi.tcZz.service.ITcSjlytjService;
/**
* tc_sjlytj Service
*
* @author ruoyi
* @date 2023-10-12
*/
@Service
public class TcSjlytjServiceImpl implements ITcSjlytjService
{
@Autowired
private TcSjlytjMapper tcSjlytjMapper;
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return tc_sjlytj
*/
@Override
public TcSjlytj selectTcSjlytjById(Long id)
{
return tcSjlytjMapper.selectTcSjlytjById(id);
}
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return tc_sjlytj
*/
@Override
public List<TcSjlytj> selectTcSjlytjList(TcSjlytj tcSjlytj)
{
return tcSjlytjMapper.selectTcSjlytjList(tcSjlytj);
}
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
@Override
public int insertTcSjlytj(TcSjlytj tcSjlytj)
{
tcSjlytj.setCreateTime(DateUtils.getNowDate());
return tcSjlytjMapper.insertTcSjlytj(tcSjlytj);
}
/**
* tc_sjlytj
*
* @param tcSjlytj tc_sjlytj
* @return
*/
@Override
public int updateTcSjlytj(TcSjlytj tcSjlytj)
{
tcSjlytj.setUpdateTime(DateUtils.getNowDate());
return tcSjlytjMapper.updateTcSjlytj(tcSjlytj);
}
/**
* tc_sjlytj
*
* @param ids tc_sjlytj
* @return
*/
@Override
public int deleteTcSjlytjByIds(Long[] ids)
{
return tcSjlytjMapper.deleteTcSjlytjByIds(ids);
}
/**
* tc_sjlytj
*
* @param id tc_sjlytj
* @return
*/
@Override
public int deleteTcSjlytjById(Long id)
{
return tcSjlytjMapper.deleteTcSjlytjById(id);
}
}

@ -0,0 +1,91 @@
<?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.tcZz.mapper.TcSjlytjMapper">
<resultMap type="TcSjlytj" id="TcSjlytjResult">
<result property="id" column="id" />
<result property="lable1" column="lable1" />
<result property="lable1Sum" column="lable1Sum" />
<result property="lable2" column="lable2" />
<result property="lable2Sum" column="lable2Sum" />
<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="selectTcSjlytjVo">
select id, lable1, lable1Sum, lable2, lable2Sum, create_by, create_time, update_by, update_time, remark from tc_sjlytj
</sql>
<select id="selectTcSjlytjList" parameterType="TcSjlytj" resultMap="TcSjlytjResult">
<include refid="selectTcSjlytjVo"/>
<where>
<if test="lable1 != null and lable1 != ''"> and lable1 = #{lable1}</if>
<if test="lable1Sum != null and lable1Sum != ''"> and lable1Sum = #{lable1Sum}</if>
<if test="lable2 != null and lable2 != ''"> and lable2 = #{lable2}</if>
<if test="lable2Sum != null and lable2Sum != ''"> and lable2Sum = #{lable2Sum}</if>
</where>
</select>
<select id="selectTcSjlytjById" parameterType="Long" resultMap="TcSjlytjResult">
<include refid="selectTcSjlytjVo"/>
where id = #{id}
</select>
<insert id="insertTcSjlytj" parameterType="TcSjlytj" useGeneratedKeys="true" keyProperty="id">
insert into tc_sjlytj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="lable1 != null">lable1,</if>
<if test="lable1Sum != null">lable1Sum,</if>
<if test="lable2 != null">lable2,</if>
<if test="lable2Sum != null">lable2Sum,</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="lable1 != null">#{lable1},</if>
<if test="lable1Sum != null">#{lable1Sum},</if>
<if test="lable2 != null">#{lable2},</if>
<if test="lable2Sum != null">#{lable2Sum},</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="updateTcSjlytj" parameterType="TcSjlytj">
update tc_sjlytj
<trim prefix="SET" suffixOverrides=",">
<if test="lable1 != null">lable1 = #{lable1},</if>
<if test="lable1Sum != null">lable1Sum = #{lable1Sum},</if>
<if test="lable2 != null">lable2 = #{lable2},</if>
<if test="lable2Sum != null">lable2Sum = #{lable2Sum},</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="deleteTcSjlytjById" parameterType="Long">
delete from tc_sjlytj where id = #{id}
</delete>
<delete id="deleteTcSjlytjByIds" parameterType="String">
delete from tc_sjlytj where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save