parent
1bad8a04aa
commit
351696c5bc
@ -0,0 +1,106 @@
|
||||
package com.os.ems.record.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.os.common.annotation.Log;
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.enums.BusinessType;
|
||||
import com.os.ems.record.domain.EmsRecordWaterInstant;
|
||||
import com.os.ems.record.service.IEmsRecordWaterInstantService;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 水实时数据Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/record/recordWaterInstant")
|
||||
public class EmsRecordWaterInstantController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmsRecordWaterInstantService emsRecordWaterInstantService;
|
||||
|
||||
/**
|
||||
* 查询水实时数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
startPage();
|
||||
List<EmsRecordWaterInstant> list = emsRecordWaterInstantService.selectEmsRecordWaterInstantList(emsRecordWaterInstant);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出水实时数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:export')")
|
||||
@Log(title = "水实时数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
List<EmsRecordWaterInstant> list = emsRecordWaterInstantService.selectEmsRecordWaterInstantList(emsRecordWaterInstant);
|
||||
ExcelUtil<EmsRecordWaterInstant> util = new ExcelUtil<EmsRecordWaterInstant>(EmsRecordWaterInstant.class);
|
||||
util.exportExcel(response, list, "水实时数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取水实时数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||
{
|
||||
return success(emsRecordWaterInstantService.selectEmsRecordWaterInstantByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:add')")
|
||||
@Log(title = "水实时数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
emsRecordWaterInstant.setCreateBy(getUsername());
|
||||
return toAjax(emsRecordWaterInstantService.insertEmsRecordWaterInstant(emsRecordWaterInstant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改水实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:edit')")
|
||||
@Log(title = "水实时数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
emsRecordWaterInstant.setUpdateBy(getUsername());
|
||||
return toAjax(emsRecordWaterInstantService.updateEmsRecordWaterInstant(emsRecordWaterInstant));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水实时数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ems/record:recordWaterInstant:remove')")
|
||||
@Log(title = "水实时数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||
{
|
||||
return toAjax(emsRecordWaterInstantService.deleteEmsRecordWaterInstantByObjIds(objIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.record.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.record.domain.EmsRecordWaterInstant;
|
||||
|
||||
/**
|
||||
* 水实时数据Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
public interface EmsRecordWaterInstantMapper
|
||||
{
|
||||
/**
|
||||
* 查询水实时数据
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 水实时数据
|
||||
*/
|
||||
public EmsRecordWaterInstant selectEmsRecordWaterInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询水实时数据列表
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 水实时数据集合
|
||||
*/
|
||||
public List<EmsRecordWaterInstant> selectEmsRecordWaterInstantList(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 新增水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 修改水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 删除水实时数据
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordWaterInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除水实时数据
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordWaterInstantByObjIds(Long[] objIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.os.ems.record.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.os.ems.record.domain.EmsRecordWaterInstant;
|
||||
|
||||
/**
|
||||
* 水实时数据Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
public interface IEmsRecordWaterInstantService
|
||||
{
|
||||
/**
|
||||
* 查询水实时数据
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 水实时数据
|
||||
*/
|
||||
public EmsRecordWaterInstant selectEmsRecordWaterInstantByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询水实时数据列表
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 水实时数据集合
|
||||
*/
|
||||
public List<EmsRecordWaterInstant> selectEmsRecordWaterInstantList(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 新增水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 修改水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant);
|
||||
|
||||
/**
|
||||
* 批量删除水实时数据
|
||||
*
|
||||
* @param objIds 需要删除的水实时数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordWaterInstantByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除水实时数据信息
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmsRecordWaterInstantByObjId(Long objId);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.os.ems.record.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.os.ems.record.mapper.EmsRecordWaterInstantMapper;
|
||||
import com.os.ems.record.domain.EmsRecordWaterInstant;
|
||||
import com.os.ems.record.service.IEmsRecordWaterInstantService;
|
||||
|
||||
/**
|
||||
* 水实时数据Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-14
|
||||
*/
|
||||
@Service
|
||||
public class EmsRecordWaterInstantServiceImpl implements IEmsRecordWaterInstantService
|
||||
{
|
||||
@Autowired
|
||||
private EmsRecordWaterInstantMapper emsRecordWaterInstantMapper;
|
||||
|
||||
/**
|
||||
* 查询水实时数据
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 水实时数据
|
||||
*/
|
||||
@Override
|
||||
public EmsRecordWaterInstant selectEmsRecordWaterInstantByObjId(Long objId)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.selectEmsRecordWaterInstantByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询水实时数据列表
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 水实时数据
|
||||
*/
|
||||
@Override
|
||||
public List<EmsRecordWaterInstant> selectEmsRecordWaterInstantList(EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.selectEmsRecordWaterInstantList(emsRecordWaterInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.insertEmsRecordWaterInstant(emsRecordWaterInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改水实时数据
|
||||
*
|
||||
* @param emsRecordWaterInstant 水实时数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEmsRecordWaterInstant(EmsRecordWaterInstant emsRecordWaterInstant)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.updateEmsRecordWaterInstant(emsRecordWaterInstant);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除水实时数据
|
||||
*
|
||||
* @param objIds 需要删除的水实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsRecordWaterInstantByObjIds(Long[] objIds)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.deleteEmsRecordWaterInstantByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水实时数据信息
|
||||
*
|
||||
* @param objId 水实时数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEmsRecordWaterInstantByObjId(Long objId)
|
||||
{
|
||||
return emsRecordWaterInstantMapper.deleteEmsRecordWaterInstantByObjId(objId);
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?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.os.ems.record.mapper.EmsRecordWaterInstantMapper">
|
||||
|
||||
<resultMap type="EmsRecordWaterInstant" id="EmsRecordWaterInstantResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="monitorId" column="monitor_id"/>
|
||||
<result property="monitorCode" column="monitor_code"/>
|
||||
<result property="monitorName" column="monitor_name"/>
|
||||
<result property="collectTime" column="collect_time"/>
|
||||
<result property="fluxFlow" column="flux_flow"/>
|
||||
<result property="waterFlow" column="water_flow"/>
|
||||
<result property="recordTime" column="record_time"/>
|
||||
<result property="collectType" column="collect_type"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsRecordWaterInstantVo">
|
||||
select RWI.obj_id,
|
||||
RWI.monitor_id,
|
||||
RWI.collect_time,
|
||||
RWI.flux_flow,
|
||||
RWI.water_flow,
|
||||
RWI.record_time,
|
||||
RWI.collect_type,
|
||||
BMI.monitor_name,
|
||||
BMI.monitor_code
|
||||
from ems_record_water_instant RWI
|
||||
left join ems_base_monitor_info BMI on RWI.monitor_id = BMI.obj_id
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsRecordWaterInstantList" parameterType="EmsRecordWaterInstant"
|
||||
resultMap="EmsRecordWaterInstantResult">
|
||||
<include refid="selectEmsRecordWaterInstantVo"/>
|
||||
<where>
|
||||
<if test="objId != null and objId != ''">and RWI.obj_id = #{objId}</if>
|
||||
<if test="monitorId != null and monitorId != ''">and RWI.monitor_id = #{monitorId}</if>
|
||||
<if test="beginTime !=null" > and RWI.collect_time>=#{beginTime}</if>
|
||||
<if test="endTime !=null" > and #{endTime} >= RWI.collect_time</if>
|
||||
<if test="fluxFlow != null ">and RWI.flux_flow = #{fluxFlow}</if>
|
||||
<if test="waterFlow != null ">and RWI.water_flow = #{waterFlow}</if>
|
||||
<if test="beginRecordTime != null ">and RWI.record_time >= #{beginRecordTime}</if>
|
||||
<if test="endRecordTime != null ">and #{endRecordTime} >= RWI.record_time</if>
|
||||
<if test="collectType != null ">and RWI.collect_type = #{collectType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmsRecordWaterInstantByObjId" parameterType="Long" resultMap="EmsRecordWaterInstantResult">
|
||||
<include refid="selectEmsRecordWaterInstantVo"/>
|
||||
where RWI.obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEmsRecordWaterInstant" parameterType="EmsRecordWaterInstant" useGeneratedKeys="true"
|
||||
keyProperty="objId">
|
||||
insert into ems_record_water_instant
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitor_id,</if>
|
||||
<if test="collectTime != null">collect_time,</if>
|
||||
<if test="fluxFlow != null">flux_flow,</if>
|
||||
<if test="waterFlow != null">water_flow,</if>
|
||||
<if test="recordTime != null">record_time,</if>
|
||||
<if test="collectType != null">collect_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="monitorId != null">#{monitorId},</if>
|
||||
<if test="collectTime != null">#{collectTime},</if>
|
||||
<if test="fluxFlow != null">#{fluxFlow},</if>
|
||||
<if test="waterFlow != null">#{waterFlow},</if>
|
||||
<if test="recordTime != null">#{recordTime},</if>
|
||||
<if test="collectType != null">#{collectType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmsRecordWaterInstant" parameterType="EmsRecordWaterInstant">
|
||||
update ems_record_water_instant
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="monitorId != null">monitor_id = #{monitorId},</if>
|
||||
<if test="collectTime != null">collect_time = #{collectTime},</if>
|
||||
<if test="fluxFlow != null">flux_flow = #{fluxFlow},</if>
|
||||
<if test="waterFlow != null">water_flow = #{waterFlow},</if>
|
||||
<if test="recordTime != null">record_time = #{recordTime},</if>
|
||||
<if test="collectType != null">collect_type = #{collectType},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmsRecordWaterInstantByObjId" parameterType="Long">
|
||||
delete from ems_record_water_instant where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmsRecordWaterInstantByObjIds" parameterType="String">
|
||||
delete from ems_record_water_instant where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue