duhanyu
parent
a0168d3fbc
commit
c72dfa994d
@ -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;
|
||||
}
|
@ -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…
Reference in new issue