duhanyu
吕天方 1 year ago
parent a0168d3fbc
commit c72dfa994d

@ -60,6 +60,10 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>

@ -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.TcYqxxltj;
import com.ruoyi.tcZz.service.ITcYqxxltjService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-10-12
*/
@RestController
@RequestMapping("/tcZz/yqxxltj")
public class TcYqxxltjController extends BaseController
{
@Autowired
private ITcYqxxltjService tcYqxxltjService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:list')")
@GetMapping("/list")
public TableDataInfo list(TcYqxxltj tcYqxxltj)
{
startPage();
List<TcYqxxltj> list = tcYqxxltjService.selectTcYqxxltjList(tcYqxxltj);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:export')")
@Log(title = "舆情信息量统计", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TcYqxxltj tcYqxxltj)
{
List<TcYqxxltj> list = tcYqxxltjService.selectTcYqxxltjList(tcYqxxltj);
ExcelUtil<TcYqxxltj> util = new ExcelUtil<TcYqxxltj>(TcYqxxltj.class);
util.exportExcel(response, list, "舆情信息量统计数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(tcYqxxltjService.selectTcYqxxltjById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:add')")
@Log(title = "舆情信息量统计", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TcYqxxltj tcYqxxltj)
{
return toAjax(tcYqxxltjService.insertTcYqxxltj(tcYqxxltj));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:edit')")
@Log(title = "舆情信息量统计", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TcYqxxltj tcYqxxltj)
{
return toAjax(tcYqxxltjService.updateTcYqxxltj(tcYqxxltj));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('tcZz:yqxxltj:remove')")
@Log(title = "舆情信息量统计", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tcYqxxltjService.deleteTcYqxxltjByIds(ids));
}
}

@ -0,0 +1,57 @@
package com.ruoyi.tcZz.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
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_yqxxltj
*
* @author ruoyi
* @date 2023-10-12
*/
@Data
@ApiModel("舆情信息量统计对象")
public class TcYqxxltj extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@ApiModelProperty(value = "id")
private Long id;
/** 区域id */
@Excel(name = "区域id")
private String areaId;
/** 启用/禁用 */
@Excel(name = "启用/禁用")
private Long isStatus;
/** 类型 */
@Excel(name = "类型")
private Long type;
/** 标题 */
@Excel(name = "标题")
private String title;
/** 来源 */
@Excel(name = "来源")
private String source;
/** 时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date dateTime;
/** 内容 */
@Excel(name = "内容")
private String content;
}

@ -2,6 +2,9 @@ package com.ruoyi.tcZz.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -13,11 +16,14 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2023-10-12
*/
@Data
@ApiModel("舆情走势图对象")
public class TcYqzs extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@ApiModelProperty(value = "id")
private Long id;
/** 区域id */
@ -36,66 +42,4 @@ public class TcYqzs extends BaseEntity
/** 敏感数量 */
@Excel(name = "敏感数量")
private Long count2;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAreaId(Long areaId)
{
this.areaId = areaId;
}
public Long getAreaId()
{
return areaId;
}
public void setDateTime(Date dateTime)
{
this.dateTime = dateTime;
}
public Date getDateTime()
{
return dateTime;
}
public void setCount1(Long count1)
{
this.count1 = count1;
}
public Long getCount1()
{
return count1;
}
public void setCount2(Long count2)
{
this.count2 = count2;
}
public Long getCount2()
{
return count2;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("areaId", getAreaId())
.append("dateTime", getDateTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("count1", getCount1())
.append("count2", getCount2())
.toString();
}
}

@ -0,0 +1,61 @@
package com.ruoyi.tcZz.mapper;
import java.util.List;
import com.ruoyi.tcZz.domain.TcYqxxltj;
/**
* Mapper
*
* @author ruoyi
* @date 2023-10-12
*/
public interface TcYqxxltjMapper
{
/**
*
*
* @param id
* @return
*/
public TcYqxxltj selectTcYqxxltjById(Long id);
/**
*
*
* @param tcYqxxltj
* @return
*/
public List<TcYqxxltj> selectTcYqxxltjList(TcYqxxltj tcYqxxltj);
/**
*
*
* @param tcYqxxltj
* @return
*/
public int insertTcYqxxltj(TcYqxxltj tcYqxxltj);
/**
*
*
* @param tcYqxxltj
* @return
*/
public int updateTcYqxxltj(TcYqxxltj tcYqxxltj);
/**
*
*
* @param id
* @return
*/
public int deleteTcYqxxltjById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteTcYqxxltjByIds(Long[] ids);
}

@ -0,0 +1,61 @@
package com.ruoyi.tcZz.service;
import java.util.List;
import com.ruoyi.tcZz.domain.TcYqxxltj;
/**
* Service
*
* @author ruoyi
* @date 2023-10-12
*/
public interface ITcYqxxltjService
{
/**
*
*
* @param id
* @return
*/
public TcYqxxltj selectTcYqxxltjById(Long id);
/**
*
*
* @param tcYqxxltj
* @return
*/
public List<TcYqxxltj> selectTcYqxxltjList(TcYqxxltj tcYqxxltj);
/**
*
*
* @param tcYqxxltj
* @return
*/
public int insertTcYqxxltj(TcYqxxltj tcYqxxltj);
/**
*
*
* @param tcYqxxltj
* @return
*/
public int updateTcYqxxltj(TcYqxxltj tcYqxxltj);
/**
*
*
* @param ids
* @return
*/
public int deleteTcYqxxltjByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteTcYqxxltjById(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.TcYqxxltjMapper;
import com.ruoyi.tcZz.domain.TcYqxxltj;
import com.ruoyi.tcZz.service.ITcYqxxltjService;
/**
* Service
*
* @author ruoyi
* @date 2023-10-12
*/
@Service
public class TcYqxxltjServiceImpl implements ITcYqxxltjService
{
@Autowired
private TcYqxxltjMapper tcYqxxltjMapper;
/**
*
*
* @param id
* @return
*/
@Override
public TcYqxxltj selectTcYqxxltjById(Long id)
{
return tcYqxxltjMapper.selectTcYqxxltjById(id);
}
/**
*
*
* @param tcYqxxltj
* @return
*/
@Override
public List<TcYqxxltj> selectTcYqxxltjList(TcYqxxltj tcYqxxltj)
{
return tcYqxxltjMapper.selectTcYqxxltjList(tcYqxxltj);
}
/**
*
*
* @param tcYqxxltj
* @return
*/
@Override
public int insertTcYqxxltj(TcYqxxltj tcYqxxltj)
{
tcYqxxltj.setCreateTime(DateUtils.getNowDate());
return tcYqxxltjMapper.insertTcYqxxltj(tcYqxxltj);
}
/**
*
*
* @param tcYqxxltj
* @return
*/
@Override
public int updateTcYqxxltj(TcYqxxltj tcYqxxltj)
{
tcYqxxltj.setUpdateTime(DateUtils.getNowDate());
return tcYqxxltjMapper.updateTcYqxxltj(tcYqxxltj);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteTcYqxxltjByIds(Long[] ids)
{
return tcYqxxltjMapper.deleteTcYqxxltjByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteTcYqxxltjById(Long id)
{
return tcYqxxltjMapper.deleteTcYqxxltjById(id);
}
}

@ -0,0 +1,106 @@
<?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.TcYqxxltjMapper">
<resultMap type="TcYqxxltj" id="TcYqxxltjResult">
<result property="id" column="id" />
<result property="areaId" column="area_id" />
<result property="isStatus" column="isStatus" />
<result property="type" column="type" />
<result property="title" column="title" />
<result property="source" column="source" />
<result property="dateTime" column="date_time" />
<result property="content" column="content" />
<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="selectTcYqxxltjVo">
select id, area_id, isStatus, type, title, source, date_time, content, create_by, create_time, update_by, update_time, remark from tc_yqxxltj
</sql>
<select id="selectTcYqxxltjList" parameterType="TcYqxxltj" resultMap="TcYqxxltjResult">
<include refid="selectTcYqxxltjVo"/>
<where>
<if test="areaId != null and areaId != ''"> and area_id = #{areaId}</if>
<if test="isStatus != null "> and isStatus = #{isStatus}</if>
<if test="type != null "> and type = #{type}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="dateTime != null "> and date_time = #{dateTime}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
</where>
</select>
<select id="selectTcYqxxltjById" parameterType="Long" resultMap="TcYqxxltjResult">
<include refid="selectTcYqxxltjVo"/>
where id = #{id}
</select>
<insert id="insertTcYqxxltj" parameterType="TcYqxxltj" useGeneratedKeys="true" keyProperty="id">
insert into tc_yqxxltj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaId != null">area_id,</if>
<if test="isStatus != null">isStatus,</if>
<if test="type != null">type,</if>
<if test="title != null">title,</if>
<if test="source != null">source,</if>
<if test="dateTime != null">date_time,</if>
<if test="content != null">content,</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="areaId != null">#{areaId},</if>
<if test="isStatus != null">#{isStatus},</if>
<if test="type != null">#{type},</if>
<if test="title != null">#{title},</if>
<if test="source != null">#{source},</if>
<if test="dateTime != null">#{dateTime},</if>
<if test="content != null">#{content},</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="updateTcYqxxltj" parameterType="TcYqxxltj">
update tc_yqxxltj
<trim prefix="SET" suffixOverrides=",">
<if test="areaId != null">area_id = #{areaId},</if>
<if test="isStatus != null">isStatus = #{isStatus},</if>
<if test="type != null">type = #{type},</if>
<if test="title != null">title = #{title},</if>
<if test="source != null">source = #{source},</if>
<if test="dateTime != null">date_time = #{dateTime},</if>
<if test="content != null">content = #{content},</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="deleteTcYqxxltjById" parameterType="Long">
delete from tc_yqxxltj where id = #{id}
</delete>
<delete id="deleteTcYqxxltjByIds" parameterType="String">
delete from tc_yqxxltj where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save