parent
11b4c850ef
commit
b122b06488
@ -0,0 +1,106 @@
|
|||||||
|
package com.ruoyi.zongzhi.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
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.zongzhi.domain.TcSafetyCounty;
|
||||||
|
import com.ruoyi.zongzhi.service.ITcSafetyCountyService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全隐患统计Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-09-20
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/zongzhi/county")
|
||||||
|
@Api(tags = " 安全隐患统计")
|
||||||
|
public class TcSafetyCountyController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ITcSafetyCountyService tcSafetyCountyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<TcSafetyCounty> list = tcSafetyCountyService.selectTcSafetyCountyList(tcSafetyCounty);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出安全隐患统计列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:export')")
|
||||||
|
@Log(title = "安全隐患统计", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
List<TcSafetyCounty> list = tcSafetyCountyService.selectTcSafetyCountyList(tcSafetyCounty);
|
||||||
|
ExcelUtil<TcSafetyCounty> util = new ExcelUtil<TcSafetyCounty>(TcSafetyCounty.class);
|
||||||
|
util.exportExcel(response, list, "安全隐患统计数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取安全隐患统计详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(tcSafetyCountyService.selectTcSafetyCountyById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增安全隐患统计
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:add')")
|
||||||
|
@Log(title = "安全隐患统计", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
return toAjax(tcSafetyCountyService.insertTcSafetyCounty(tcSafetyCounty));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改安全隐患统计
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:edit')")
|
||||||
|
@Log(title = "安全隐患统计", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
return toAjax(tcSafetyCountyService.updateTcSafetyCounty(tcSafetyCounty));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除安全隐患统计
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('zongzhi:county:remove')")
|
||||||
|
@Log(title = "安全隐患统计", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(tcSafetyCountyService.deleteTcSafetyCountyByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.zongzhi.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全隐患统计对象 tc_safety_county
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-09-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TcSafetyCounty extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域id
|
||||||
|
*/
|
||||||
|
@Excel(name = "区域id")
|
||||||
|
@ApiModelProperty(value = "区域id")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "类型名称")
|
||||||
|
@ApiModelProperty(value = "类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@Excel(name = "数量")
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private Long totalNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
@Excel(name = "创建人id")
|
||||||
|
@ApiModelProperty(value = "创建人id")
|
||||||
|
private Long createId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人id
|
||||||
|
*/
|
||||||
|
@Excel(name = "修改人id")
|
||||||
|
@ApiModelProperty(value = "修改人id")
|
||||||
|
private Long updateId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.zongzhi.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.zongzhi.domain.TcSafetyCounty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全隐患统计Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-09-20
|
||||||
|
*/
|
||||||
|
public interface TcSafetyCountyMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 安全隐患统计
|
||||||
|
*/
|
||||||
|
public TcSafetyCounty selectTcSafetyCountyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计列表
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 安全隐患统计集合
|
||||||
|
*/
|
||||||
|
public List<TcSafetyCounty> selectTcSafetyCountyList(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTcSafetyCounty(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTcSafetyCounty(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除安全隐患统计
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTcSafetyCountyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除安全隐患统计
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTcSafetyCountyByIds(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.zongzhi.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.zongzhi.domain.TcSafetyCounty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全隐患统计Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-09-20
|
||||||
|
*/
|
||||||
|
public interface ITcSafetyCountyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 安全隐患统计
|
||||||
|
*/
|
||||||
|
public TcSafetyCounty selectTcSafetyCountyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计列表
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 安全隐患统计集合
|
||||||
|
*/
|
||||||
|
public List<TcSafetyCounty> selectTcSafetyCountyList(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertTcSafetyCounty(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateTcSafetyCounty(TcSafetyCounty tcSafetyCounty);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除安全隐患统计
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的安全隐患统计主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTcSafetyCountyByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除安全隐患统计信息
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteTcSafetyCountyById(Long id);
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.zongzhi.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.zongzhi.mapper.TcSafetyCountyMapper;
|
||||||
|
import com.ruoyi.zongzhi.domain.TcSafetyCounty;
|
||||||
|
import com.ruoyi.zongzhi.service.ITcSafetyCountyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全隐患统计Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2023-09-20
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TcSafetyCountyServiceImpl implements ITcSafetyCountyService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private TcSafetyCountyMapper tcSafetyCountyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 安全隐患统计
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TcSafetyCounty selectTcSafetyCountyById(Long id)
|
||||||
|
{
|
||||||
|
return tcSafetyCountyMapper.selectTcSafetyCountyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全隐患统计列表
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 安全隐患统计
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TcSafetyCounty> selectTcSafetyCountyList(TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
return tcSafetyCountyMapper.selectTcSafetyCountyList(tcSafetyCounty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTcSafetyCounty(TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
tcSafetyCounty.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return tcSafetyCountyMapper.insertTcSafetyCounty(tcSafetyCounty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改安全隐患统计
|
||||||
|
*
|
||||||
|
* @param tcSafetyCounty 安全隐患统计
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTcSafetyCounty(TcSafetyCounty tcSafetyCounty)
|
||||||
|
{
|
||||||
|
tcSafetyCounty.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tcSafetyCountyMapper.updateTcSafetyCounty(tcSafetyCounty);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除安全隐患统计
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的安全隐患统计主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTcSafetyCountyByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return tcSafetyCountyMapper.deleteTcSafetyCountyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除安全隐患统计信息
|
||||||
|
*
|
||||||
|
* @param id 安全隐患统计主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTcSafetyCountyById(Long id)
|
||||||
|
{
|
||||||
|
return tcSafetyCountyMapper.deleteTcSafetyCountyById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
<?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.zongzhi.mapper.TcSafetyCountyMapper">
|
||||||
|
|
||||||
|
<resultMap type="TcSafetyCounty" id="TcSafetyCountyResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="areaId" column="area_id" />
|
||||||
|
<result property="typeName" column="type_name" />
|
||||||
|
<result property="totalNum" column="total_num" />
|
||||||
|
<result property="createId" column="create_id" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateId" column="update_id" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectTcSafetyCountyVo">
|
||||||
|
select id, area_id, type_name, total_num, create_id, create_by, create_time, update_id, update_by, update_time, remark from tc_safety_county
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectTcSafetyCountyList" parameterType="TcSafetyCounty" resultMap="TcSafetyCountyResult">
|
||||||
|
<include refid="selectTcSafetyCountyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||||
|
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
|
||||||
|
<if test="totalNum != null "> and total_num = #{totalNum}</if>
|
||||||
|
<if test="createId != null "> and create_id = #{createId}</if>
|
||||||
|
<if test="updateId != null "> and update_id = #{updateId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTcSafetyCountyById" parameterType="Long" resultMap="TcSafetyCountyResult">
|
||||||
|
<include refid="selectTcSafetyCountyVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertTcSafetyCounty" parameterType="TcSafetyCounty" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into tc_safety_county
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="areaId != null">area_id,</if>
|
||||||
|
<if test="typeName != null">type_name,</if>
|
||||||
|
<if test="totalNum != null">total_num,</if>
|
||||||
|
<if test="createId != null">create_id,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateId != null">update_id,</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="typeName != null">#{typeName},</if>
|
||||||
|
<if test="totalNum != null">#{totalNum},</if>
|
||||||
|
<if test="createId != null">#{createId},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateId != null">#{updateId},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateTcSafetyCounty" parameterType="TcSafetyCounty">
|
||||||
|
update tc_safety_county
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="areaId != null">area_id = #{areaId},</if>
|
||||||
|
<if test="typeName != null">type_name = #{typeName},</if>
|
||||||
|
<if test="totalNum != null">total_num = #{totalNum},</if>
|
||||||
|
<if test="createId != null">create_id = #{createId},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateId != null">update_id = #{updateId},</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="deleteTcSafetyCountyById" parameterType="Long">
|
||||||
|
delete from tc_safety_county where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTcSafetyCountyByIds" parameterType="String">
|
||||||
|
delete from tc_safety_county where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue