设备信息树后端

master
zhouhy 2 years ago
parent 0358650d0d
commit 71d171bf38

@ -3,6 +3,7 @@ package com.aucma.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.base.domain.TreeSelects;
import com.aucma.common.utils.DateUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +44,11 @@ public class BaseMonitorInfoController extends BaseController {
List<BaseMonitorInfo> list = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
return success(list);
}
@PostMapping("/monitorInfoTree")
public AjaxResult getMonitorInfoTree(BaseMonitorInfo baseMonitorInfo) {
List<TreeSelects> list = baseMonitorInfoService.selectBaseMonitorInfoTreeList(baseMonitorInfo);
return success(list);
}
/**
*
@ -98,4 +104,14 @@ public class BaseMonitorInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(baseMonitorInfoService.deleteBaseMonitorInfoByObjIds(objIds));
}
//根据名字模糊查询
@GetMapping("/like/{monitorName}")
public AjaxResult like(@PathVariable("monitorName")String monitorName){
if (monitorName.isEmpty()){
return null;
}
return success(baseMonitorInfoService.selectBaseMonitorInfoByNameLike(monitorName));
}
}

@ -1,12 +1,14 @@
package com.aucma.base.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.TreeEntity;
/**
* base_monitorinfo
@ -14,7 +16,7 @@ import com.aucma.common.core.domain.TreeEntity;
* @author Yinq
* @date 2023-09-21
*/
public class BaseMonitorInfo extends TreeEntity {
public class BaseMonitorInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
@ -113,6 +115,56 @@ public class BaseMonitorInfo extends TreeEntity {
@Excel(name = "是否虚拟设备", readConverterExp = "0=-是1-否")
private Long isAmmeter;
private List<BaseMonitorInfo> children = new ArrayList<BaseMonitorInfo>();
private String parentName;
private Long parentId;
private Integer orderNum;
private String ancestors;
public List<BaseMonitorInfo> getChildren() {
return children;
}
public void setChildren(List<BaseMonitorInfo> children) {
this.children = children;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Integer getOrderNum() {
return orderNum;
}
public void setOrderNum(Integer orderNum) {
this.orderNum = orderNum;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public void setObjId(Long objId) {
this.objId = objId;
}
@ -246,6 +298,7 @@ public class BaseMonitorInfo extends TreeEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("monitorCode", getMonitorCode())
.append("monitorName", getMonitorName())
.append("monitorAddress", getMonitorAddress())
@ -261,6 +314,7 @@ public class BaseMonitorInfo extends TreeEntity {
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.append("isAmmeter", getIsAmmeter())
.append("children", getChildren())
.toString();
}
}

@ -0,0 +1,83 @@
package com.aucma.base.domain;
import com.aucma.common.core.domain.entity.SysDept;
import com.aucma.common.core.domain.entity.SysMenu;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* Treeselect
*
* @author ruoyi
*/
public class TreeSelects implements Serializable
{
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
/** 节点名称 */
private String label;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelects> children;
public TreeSelects()
{
}
public TreeSelects(SysDept dept)
{
this.id = dept.getDeptId();
this.label = dept.getDeptName();
this.children = dept.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
}
public TreeSelects(BaseMonitorInfo baseMonitorInfo){
this.id = baseMonitorInfo.getObjId();
this.label = baseMonitorInfo.getMonitorName();
this.children = baseMonitorInfo.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
}
public TreeSelects(SysMenu menu)
{
this.id = menu.getMenuId();
this.label = menu.getMenuName();
this.children = menu.getChildren().stream().map(TreeSelects::new).collect(Collectors.toList());
}
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public String getLabel()
{
return label;
}
public void setLabel(String label)
{
this.label = label;
}
public List<TreeSelects> getChildren()
{
return children;
}
public void setChildren(List<TreeSelects> children)
{
this.children = children;
}
}

@ -1,19 +1,20 @@
package com.aucma.base.mapper;
import java.lang.management.MonitorInfo;
import java.util.List;
import com.aucma.base.domain.BaseMonitorInfo;
/**
* Mapper
*
*
* @author Yinq
* @date 2023-09-21
*/
public interface BaseMonitorInfoMapper
public interface BaseMonitorInfoMapper
{
/**
*
*
*
* @param objId
* @return
*/
@ -21,7 +22,7 @@ public interface BaseMonitorInfoMapper
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -29,7 +30,7 @@ public interface BaseMonitorInfoMapper
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -37,7 +38,7 @@ public interface BaseMonitorInfoMapper
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -45,7 +46,7 @@ public interface BaseMonitorInfoMapper
/**
*
*
*
* @param objId
* @return
*/
@ -53,9 +54,11 @@ public interface BaseMonitorInfoMapper
/**
*
*
*
* @param objIds
* @return
*/
public int deleteBaseMonitorInfoByObjIds(Long[] objIds);
List<BaseMonitorInfo> selectBaseMonitorInfoByNameLike(String monitorName);
}

@ -2,18 +2,19 @@ package com.aucma.base.service;
import java.util.List;
import com.aucma.base.domain.BaseMonitorInfo;
import com.aucma.base.domain.TreeSelects;
/**
* Service
*
*
* @author Yinq
* @date 2023-09-21
*/
public interface IBaseMonitorInfoService
public interface IBaseMonitorInfoService
{
/**
*
*
*
* @param objId
* @return
*/
@ -21,15 +22,22 @@ public interface IBaseMonitorInfoService
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
public List<BaseMonitorInfo> selectBaseMonitorInfoList(BaseMonitorInfo baseMonitorInfo);
List<TreeSelects> selectBaseMonitorInfoTreeList(BaseMonitorInfo baseMonitorInfo);
public List<TreeSelects> buildMonitorInfoTreeSelect(List<BaseMonitorInfo> baseMonitorInfos);
public List<BaseMonitorInfo> buildMonitorInfoTree(List<BaseMonitorInfo> baseMonitorInfos);
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -37,7 +45,7 @@ public interface IBaseMonitorInfoService
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -45,7 +53,7 @@ public interface IBaseMonitorInfoService
/**
*
*
*
* @param objIds
* @return
*/
@ -53,9 +61,11 @@ public interface IBaseMonitorInfoService
/**
*
*
*
* @param objId
* @return
*/
public int deleteBaseMonitorInfoByObjId(Long objId);
List<BaseMonitorInfo> selectBaseMonitorInfoByNameLike(String monitorName);
}

@ -1,6 +1,13 @@
package com.aucma.base.service.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import com.aucma.base.domain.TreeSelects;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseMonitorInfoMapper;
@ -9,19 +16,19 @@ import com.aucma.base.service.IBaseMonitorInfoService;
/**
* Service
*
*
* @author Yinq
* @date 2023-09-21
*/
@Service
public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
{
@Autowired
private BaseMonitorInfoMapper baseMonitorInfoMapper;
/**
*
*
*
* @param objId
* @return
*/
@ -33,7 +40,7 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -43,9 +50,95 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
return baseMonitorInfoMapper.selectBaseMonitorInfoList(baseMonitorInfo);
}
@Override
public List<TreeSelects> selectBaseMonitorInfoTreeList(BaseMonitorInfo baseMonitorInfo) {
List<BaseMonitorInfo> baseMonitorInfos = selectBaseMonitorInfoList(baseMonitorInfo);
return buildMonitorInfoTreeSelect(baseMonitorInfos);
}
/**
*
*
* @param
* @return
*/
@Override
public List<TreeSelects> buildMonitorInfoTreeSelect(List<BaseMonitorInfo> baseMonitorInfos)
{
List<BaseMonitorInfo> deptTrees = buildMonitorInfoTree(baseMonitorInfos);
return deptTrees.stream().map(TreeSelects::new).collect(Collectors.toList());
}
/**
*
*
* @param
* @return
*/
@Override
public List<BaseMonitorInfo> buildMonitorInfoTree(List<BaseMonitorInfo> baseMonitorInfos)
{
List<BaseMonitorInfo> returnList = new ArrayList<BaseMonitorInfo>();
List<Long> tempList = baseMonitorInfos.stream().map(BaseMonitorInfo::getObjId).collect(Collectors.toList());
for (BaseMonitorInfo baseMonitorInfo : baseMonitorInfos)
{
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(baseMonitorInfo.getParentId()))
{
recursionFn(baseMonitorInfos, baseMonitorInfo);
returnList.add(baseMonitorInfo);
}
}
if (returnList.isEmpty())
{
returnList = baseMonitorInfos;
}
return returnList;
}
/**
*
*/
private void recursionFn(List<BaseMonitorInfo> list, BaseMonitorInfo t)
{
// 得到子节点列表
List<BaseMonitorInfo> childList = getChildList(list, t);
t.setChildren(childList);
for (BaseMonitorInfo tChild : childList)
{
if (hasChild(list, tChild))
{
recursionFn(list, tChild);
}
}
}
/**
*
*/
private List<BaseMonitorInfo> getChildList(List<BaseMonitorInfo> list, BaseMonitorInfo t)
{
List<BaseMonitorInfo> tlist = new ArrayList<BaseMonitorInfo>();
Iterator<BaseMonitorInfo> it = list.iterator();
while (it.hasNext())
{
BaseMonitorInfo n = (BaseMonitorInfo) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getObjId().longValue())
{
tlist.add(n);
}
}
return tlist;
}
/**
*
*/
private boolean hasChild(List<BaseMonitorInfo> list, BaseMonitorInfo t)
{
return getChildList(list, t).size() > 0;
}
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -57,7 +150,7 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
/**
*
*
*
* @param baseMonitorInfo
* @return
*/
@ -69,7 +162,7 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
/**
*
*
*
* @param objIds
* @return
*/
@ -81,7 +174,7 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
/**
*
*
*
* @param objId
* @return
*/
@ -90,4 +183,9 @@ public class BaseMonitorInfoServiceImpl implements IBaseMonitorInfoService
{
return baseMonitorInfoMapper.deleteBaseMonitorInfoByObjId(objId);
}
@Override
public List<BaseMonitorInfo> selectBaseMonitorInfoByNameLike(String monitorName) {
return baseMonitorInfoMapper.selectBaseMonitorInfoByNameLike(monitorName);
}
}

@ -72,6 +72,10 @@
<include refid="selectBaseMonitorInfoVo"/>
where obj_id = #{objId}
</select>
<select id="selectBaseMonitorInfoByNameLike" parameterType="String" resultMap="BaseMonitorInfoResult">
<include refid="selectBaseMonitorInfoVo"/>
where monitor_name like CONCAT(CONCAT('%',#{monitorName}),'%')
</select>
<insert id="insertBaseMonitorInfo" parameterType="BaseMonitorInfo">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
@ -153,4 +157,4 @@
#{objId}
</foreach>
</delete>
</mapper>
</mapper>

@ -0,0 +1,103 @@
package com.aucma.report.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
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.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.report.domain.ReportDayDnb;
import com.aucma.report.service.IReportDayDnbService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-10-09
*/
@RestController
@RequestMapping("/report/DayDnb" )
public class ReportDayDnbController extends BaseController {
@Autowired
private IReportDayDnbService reportDayDnbService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:list')" )
@GetMapping("/list" )
public TableDataInfo list(ReportDayDnb reportDayDnb) {
startPage();
List<ReportDayDnb> list = reportDayDnbService.selectReportDayDnbList(reportDayDnb);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:export')" )
@Log(title = "电日耗报" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, ReportDayDnb reportDayDnb) {
List<ReportDayDnb> list = reportDayDnbService.selectReportDayDnbList(reportDayDnb);
ExcelUtil<ReportDayDnb> util = new ExcelUtil<ReportDayDnb>(ReportDayDnb. class);
util.exportExcel(response, list, "电日耗报数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(reportDayDnbService.selectReportDayDnbByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:add')" )
@Log(title = "电日耗报" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ReportDayDnb reportDayDnb) {
reportDayDnb.setCreatedBy(getUsername());
reportDayDnb.setCreatedTime(DateUtils.getNowDate());
return toAjax(reportDayDnbService.insertReportDayDnb(reportDayDnb));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:edit')" )
@Log(title = "电日耗报" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ReportDayDnb reportDayDnb) {
reportDayDnb.setUpdatedBy(getUsername());
reportDayDnb.setUpdatedTime(DateUtils.getNowDate());
return toAjax(reportDayDnbService.updateReportDayDnb(reportDayDnb));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:DayDnb:remove')" )
@Log(title = "电日耗报" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(reportDayDnbService.deleteReportDayDnbByObjIds(objIds));
}
}

@ -0,0 +1,104 @@
package com.aucma.report.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.aucma.common.utils.DateUtils;
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.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.enums.BusinessType;
import com.aucma.report.domain.ReportPointDnb;
import com.aucma.report.service.IReportPointDnbService;
import com.aucma.common.utils.poi.ExcelUtil;
import com.aucma.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-10-09
*/
@RestController
@RequestMapping("/report/pointDnb" )
public class ReportPointDnbController extends BaseController {
@Autowired
private IReportPointDnbService reportPointDnbService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:list')" )
@GetMapping("/list" )
public TableDataInfo list(ReportPointDnb reportPointDnb) {
startPage();
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:export')" )
@Log(title = "电整点耗量报表" , businessType = BusinessType.EXPORT)
@PostMapping("/export" )
public void export(HttpServletResponse response, ReportPointDnb reportPointDnb) {
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);
ExcelUtil<ReportPointDnb> util = new ExcelUtil<ReportPointDnb>(ReportPointDnb. class);
util.exportExcel(response, list, "电整点耗量报表数据" );
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:query')" )
@GetMapping(value = "/{objId}" )
public AjaxResult getInfo(@PathVariable("objId" ) Long objId) {
return success(reportPointDnbService.selectReportPointDnbByObjId(objId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:add')" )
@Log(title = "电整点耗量报表" , businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ReportPointDnb reportPointDnb) {
reportPointDnb.setCreatedBy(getUsername());
reportPointDnb.setCreatedTime(DateUtils.getNowDate());
return toAjax(reportPointDnbService.insertReportPointDnb(reportPointDnb));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:edit')" )
@Log(title = "电整点耗量报表" , businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ReportPointDnb reportPointDnb) {
reportPointDnb.setUpdatedBy(getUsername());
reportPointDnb.setUpdatedTime(DateUtils.getNowDate());
return toAjax(reportPointDnbService.updateReportPointDnb(reportPointDnb));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('report:pointDnb:remove')" )
@Log(title = "电整点耗量报表" , businessType = BusinessType.DELETE)
@DeleteMapping("/{objIds}" )
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(reportPointDnbService.deleteReportPointDnbByObjIds(objIds));
}
}

@ -0,0 +1,195 @@
package com.aucma.report.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* report_day_dnb
*
* @author ruoyi
* @date 2023-10-09
*/
public class ReportDayDnb extends BaseEntity
{
private static final long serialVersionUID=1L;
/** 主键标识 */
private Long objId;
/** 计量设备编号 */
@Excel(name = "计量设备编号")
private String monitorCode;
/** 仪表值 */
@Excel(name = "仪表值")
private Long instrumentValue;
/** 耗量 */
@Excel(name = "耗量")
private Long expend;
/** 报表日期 */
@Excel(name = "报表日期")
private String reportDate;
/** 开始时间 */
@Excel(name = "开始时间")
private String beginTime;
/** 结束时间 */
@Excel(name = "结束时间")
private String endTime;
/** 是否标识 */
@Excel(name = "是否标识")
private Long isFlag;
/** 创建人 */
@Excel(name = "创建人")
private String createdBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/** 更新人 */
@Excel(name = "更新人")
private String updatedBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public void setObjId(Long objId)
{
this.objId = objId;
}
public Long getObjId()
{
return objId;
}
public void setMonitorCode(String monitorCode)
{
this.monitorCode = monitorCode;
}
public String getMonitorCode()
{
return monitorCode;
}
public void setInstrumentValue(Long instrumentValue)
{
this.instrumentValue = instrumentValue;
}
public Long getInstrumentValue()
{
return instrumentValue;
}
public void setExpend(Long expend)
{
this.expend = expend;
}
public Long getExpend()
{
return expend;
}
public void setReportDate(String reportDate)
{
this.reportDate = reportDate;
}
public String getReportDate()
{
return reportDate;
}
public void setBeginTime(String beginTime)
{
this.beginTime = beginTime;
}
public String getBeginTime()
{
return beginTime;
}
public void setEndTime(String endTime)
{
this.endTime = endTime;
}
public String getEndTime()
{
return endTime;
}
public void setIsFlag(Long isFlag)
{
this.isFlag = isFlag;
}
public Long getIsFlag()
{
return isFlag;
}
public void setCreatedBy(String createdBy)
{
this.createdBy = createdBy;
}
public String getCreatedBy()
{
return createdBy;
}
public void setCreatedTime(Date createdTime)
{
this.createdTime = createdTime;
}
public Date getCreatedTime()
{
return createdTime;
}
public void setUpdatedBy(String updatedBy)
{
this.updatedBy = updatedBy;
}
public String getUpdatedBy()
{
return updatedBy;
}
public void setUpdatedTime(Date updatedTime)
{
this.updatedTime = updatedTime;
}
public Date getUpdatedTime()
{
return updatedTime;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objId",getObjId())
.append("monitorCode",getMonitorCode())
.append("instrumentValue",getInstrumentValue())
.append("expend",getExpend())
.append("reportDate",getReportDate())
.append("beginTime",getBeginTime())
.append("endTime",getEndTime())
.append("isFlag",getIsFlag())
.append("createdBy",getCreatedBy())
.append("createdTime",getCreatedTime())
.append("updatedBy",getUpdatedBy())
.append("updatedTime",getUpdatedTime())
.toString();
}
}

@ -0,0 +1,207 @@
package com.aucma.report.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
/**
* report_point_dnb
*
* @author ruoyi
* @date 2023-10-09
*/
public class ReportPointDnb extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
@Excel(name = "主键标识")
private Long objId;
/**
*
*/
@Excel(name = "计量设备编号")
private String monitorCode;
/**
*
*/
@Excel(name = "仪表值")
private Long instrumentValue;
/**
*
*/
@Excel(name = "耗量")
private Long expend;
/**
*
*/
@Excel(name = "记录时间")
private String recordTime;
/**
*
*/
@Excel(name = "开始时间")
private String beginTime;
/**
*
*/
@Excel(name = "结束时间")
private String endTime;
/**
*
*/
@Excel(name = "是否标识")
private Long isFlag;
/**
*
*/
@Excel(name = "创建人")
private String createdBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
/**
*
*/
@Excel(name = "更新人")
private String updatedBy;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime;
public void setObjId(Long objId) {
this.objId = objId;
}
public Long getObjId() {
return objId;
}
public void setMonitorCode(String monitorCode) {
this.monitorCode = monitorCode;
}
public String getMonitorCode() {
return monitorCode;
}
public void setInstrumentValue(Long instrumentValue) {
this.instrumentValue = instrumentValue;
}
public Long getInstrumentValue() {
return instrumentValue;
}
public void setExpend(Long expend) {
this.expend = expend;
}
public Long getExpend() {
return expend;
}
public void setRecordTime(String recordTime) {
this.recordTime = recordTime;
}
public String getRecordTime() {
return recordTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getBeginTime() {
return beginTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getEndTime() {
return endTime;
}
public void setIsFlag(Long isFlag) {
this.isFlag = isFlag;
}
public Long getIsFlag() {
return isFlag;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getCreatedTime() {
return createdTime;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Date getUpdatedTime() {
return updatedTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("objId", getObjId())
.append("monitorCode", getMonitorCode())
.append("instrumentValue", getInstrumentValue())
.append("expend", getExpend())
.append("recordTime", getRecordTime())
.append("beginTime", getBeginTime())
.append("endTime", getEndTime())
.append("isFlag", getIsFlag())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.append("updatedBy", getUpdatedBy())
.append("updatedTime", getUpdatedTime())
.toString();
}
}

@ -0,0 +1,61 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.ReportDayDnb;
/**
* Mapper
*
* @author ruoyi
* @date 2023-10-09
*/
public interface ReportDayDnbMapper
{
/**
*
*
* @param objId
* @return
*/
public ReportDayDnb selectReportDayDnbByObjId(Long objId);
/**
*
*
* @param reportDayDnb
* @return
*/
public List<ReportDayDnb> selectReportDayDnbList(ReportDayDnb reportDayDnb);
/**
*
*
* @param reportDayDnb
* @return
*/
public int insertReportDayDnb(ReportDayDnb reportDayDnb);
/**
*
*
* @param reportDayDnb
* @return
*/
public int updateReportDayDnb(ReportDayDnb reportDayDnb);
/**
*
*
* @param objId
* @return
*/
public int deleteReportDayDnbByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportDayDnbByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.report.mapper;
import java.util.List;
import com.aucma.report.domain.ReportPointDnb;
/**
* Mapper
*
* @author ruoyi
* @date 2023-10-09
*/
public interface ReportPointDnbMapper
{
/**
*
*
* @param objId
* @return
*/
public ReportPointDnb selectReportPointDnbByObjId(Long objId);
/**
*
*
* @param reportPointDnb
* @return
*/
public List<ReportPointDnb> selectReportPointDnbList(ReportPointDnb reportPointDnb);
/**
*
*
* @param reportPointDnb
* @return
*/
public int insertReportPointDnb(ReportPointDnb reportPointDnb);
/**
*
*
* @param reportPointDnb
* @return
*/
public int updateReportPointDnb(ReportPointDnb reportPointDnb);
/**
*
*
* @param objId
* @return
*/
public int deleteReportPointDnbByObjId(Long objId);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportPointDnbByObjIds(Long[] objIds);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.ReportDayDnb;
/**
* Service
*
* @author ruoyi
* @date 2023-10-09
*/
public interface IReportDayDnbService
{
/**
*
*
* @param objId
* @return
*/
public ReportDayDnb selectReportDayDnbByObjId(Long objId);
/**
*
*
* @param reportDayDnb
* @return
*/
public List<ReportDayDnb> selectReportDayDnbList(ReportDayDnb reportDayDnb);
/**
*
*
* @param reportDayDnb
* @return
*/
public int insertReportDayDnb(ReportDayDnb reportDayDnb);
/**
*
*
* @param reportDayDnb
* @return
*/
public int updateReportDayDnb(ReportDayDnb reportDayDnb);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportDayDnbByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteReportDayDnbByObjId(Long objId);
}

@ -0,0 +1,61 @@
package com.aucma.report.service;
import java.util.List;
import com.aucma.report.domain.ReportPointDnb;
/**
* Service
*
* @author ruoyi
* @date 2023-10-09
*/
public interface IReportPointDnbService
{
/**
*
*
* @param objId
* @return
*/
public ReportPointDnb selectReportPointDnbByObjId(Long objId);
/**
*
*
* @param reportPointDnb
* @return
*/
public List<ReportPointDnb> selectReportPointDnbList(ReportPointDnb reportPointDnb);
/**
*
*
* @param reportPointDnb
* @return
*/
public int insertReportPointDnb(ReportPointDnb reportPointDnb);
/**
*
*
* @param reportPointDnb
* @return
*/
public int updateReportPointDnb(ReportPointDnb reportPointDnb);
/**
*
*
* @param objIds
* @return
*/
public int deleteReportPointDnbByObjIds(Long[] objIds);
/**
*
*
* @param objId
* @return
*/
public int deleteReportPointDnbByObjId(Long objId);
}

@ -0,0 +1,93 @@
package com.aucma.report.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportDayDnbMapper;
import com.aucma.report.domain.ReportDayDnb;
import com.aucma.report.service.IReportDayDnbService;
/**
* Service
*
* @author ruoyi
* @date 2023-10-09
*/
@Service
public class ReportDayDnbServiceImpl implements IReportDayDnbService
{
@Autowired
private ReportDayDnbMapper reportDayDnbMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ReportDayDnb selectReportDayDnbByObjId(Long objId)
{
return reportDayDnbMapper.selectReportDayDnbByObjId(objId);
}
/**
*
*
* @param reportDayDnb
* @return
*/
@Override
public List<ReportDayDnb> selectReportDayDnbList(ReportDayDnb reportDayDnb)
{
return reportDayDnbMapper.selectReportDayDnbList(reportDayDnb);
}
/**
*
*
* @param reportDayDnb
* @return
*/
@Override
public int insertReportDayDnb(ReportDayDnb reportDayDnb)
{
return reportDayDnbMapper.insertReportDayDnb(reportDayDnb);
}
/**
*
*
* @param reportDayDnb
* @return
*/
@Override
public int updateReportDayDnb(ReportDayDnb reportDayDnb)
{
return reportDayDnbMapper.updateReportDayDnb(reportDayDnb);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteReportDayDnbByObjIds(Long[] objIds)
{
return reportDayDnbMapper.deleteReportDayDnbByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteReportDayDnbByObjId(Long objId)
{
return reportDayDnbMapper.deleteReportDayDnbByObjId(objId);
}
}

@ -0,0 +1,93 @@
package com.aucma.report.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.ReportPointDnbMapper;
import com.aucma.report.domain.ReportPointDnb;
import com.aucma.report.service.IReportPointDnbService;
/**
* Service
*
* @author ruoyi
* @date 2023-10-09
*/
@Service
public class ReportPointDnbServiceImpl implements IReportPointDnbService
{
@Autowired
private ReportPointDnbMapper reportPointDnbMapper;
/**
*
*
* @param objId
* @return
*/
@Override
public ReportPointDnb selectReportPointDnbByObjId(Long objId)
{
return reportPointDnbMapper.selectReportPointDnbByObjId(objId);
}
/**
*
*
* @param reportPointDnb
* @return
*/
@Override
public List<ReportPointDnb> selectReportPointDnbList(ReportPointDnb reportPointDnb)
{
return reportPointDnbMapper.selectReportPointDnbList(reportPointDnb);
}
/**
*
*
* @param reportPointDnb
* @return
*/
@Override
public int insertReportPointDnb(ReportPointDnb reportPointDnb)
{
return reportPointDnbMapper.insertReportPointDnb(reportPointDnb);
}
/**
*
*
* @param reportPointDnb
* @return
*/
@Override
public int updateReportPointDnb(ReportPointDnb reportPointDnb)
{
return reportPointDnbMapper.updateReportPointDnb(reportPointDnb);
}
/**
*
*
* @param objIds
* @return
*/
@Override
public int deleteReportPointDnbByObjIds(Long[] objIds)
{
return reportPointDnbMapper.deleteReportPointDnbByObjIds(objIds);
}
/**
*
*
* @param objId
* @return
*/
@Override
public int deleteReportPointDnbByObjId(Long objId)
{
return reportPointDnbMapper.deleteReportPointDnbByObjId(objId);
}
}

@ -0,0 +1,111 @@
<?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.aucma.report.mapper.ReportDayDnbMapper">
<resultMap type="ReportDayDnb" id="ReportDayDnbResult">
<result property="objId" column="obj_id" />
<result property="monitorCode" column="monitor_code" />
<result property="instrumentValue" column="instrument_value" />
<result property="expend" column="expend" />
<result property="reportDate" column="report_date" />
<result property="beginTime" column="begin_time" />
<result property="endTime" column="end_time" />
<result property="isFlag" column="is_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
</resultMap>
<sql id="selectReportDayDnbVo">
select obj_id, monitor_code, instrument_value, expend, report_date, begin_time, end_time, is_flag, created_by, created_time, updated_by, updated_time from report_day_dnb
</sql>
<select id="selectReportDayDnbList" parameterType="ReportDayDnb" resultMap="ReportDayDnbResult">
<include refid="selectReportDayDnbVo"/>
<where>
<if test="monitorCode != null and monitorCode != ''"> and monitor_code = #{monitorCode}</if>
<if test="instrumentValue != null "> and instrument_value = #{instrumentValue}</if>
<if test="expend != null "> and expend = #{expend}</if>
<if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
<if test="beginTime != null and beginTime != ''"> and begin_time = #{beginTime}</if>
<if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectReportDayDnbByObjId" parameterType="Long" resultMap="ReportDayDnbResult">
<include refid="selectReportDayDnbVo"/>
where obj_id = #{objId}
</select>
<insert id="insertReportDayDnb" parameterType="ReportDayDnb">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_report_day_dnb.NEXTVAL as objId FROM DUAL
</selectKey>
insert into report_day_dnb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="monitorCode != null">monitor_code,</if>
<if test="instrumentValue != null">instrument_value,</if>
<if test="expend != null">expend,</if>
<if test="reportDate != null">report_date,</if>
<if test="beginTime != null">begin_time,</if>
<if test="endTime != null">end_time,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="monitorCode != null">#{monitorCode},</if>
<if test="instrumentValue != null">#{instrumentValue},</if>
<if test="expend != null">#{expend},</if>
<if test="reportDate != null">#{reportDate},</if>
<if test="beginTime != null">#{beginTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateReportDayDnb" parameterType="ReportDayDnb">
update report_day_dnb
<trim prefix="SET" suffixOverrides=",">
<if test="monitorCode != null">monitor_code = #{monitorCode},</if>
<if test="instrumentValue != null">instrument_value = #{instrumentValue},</if>
<if test="expend != null">expend = #{expend},</if>
<if test="reportDate != null">report_date = #{reportDate},</if>
<if test="beginTime != null">begin_time = #{beginTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteReportDayDnbByObjId" parameterType="Long">
delete from report_day_dnb where obj_id = #{objId}
</delete>
<delete id="deleteReportDayDnbByObjIds" parameterType="String">
delete from report_day_dnb where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,113 @@
<?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.aucma.report.mapper.ReportPointDnbMapper">
<resultMap type="ReportPointDnb" id="ReportPointDnbResult">
<result property="objId" column="obj_id" />
<result property="monitorCode" column="monitor_code" />
<result property="instrumentValue" column="instrument_value" />
<result property="expend" column="expend" />
<result property="recordTime" column="record_time" />
<result property="beginTime" column="begin_time" />
<result property="endTime" column="end_time" />
<result property="isFlag" column="is_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
</resultMap>
<sql id="selectReportPointDnbVo">
select obj_id, monitor_code, instrument_value, expend, record_time, begin_time, end_time, is_flag, created_by, created_time, updated_by, updated_time from report_point_dnb
</sql>
<select id="selectReportPointDnbList" parameterType="ReportPointDnb" resultMap="ReportPointDnbResult">
<include refid="selectReportPointDnbVo"/>
<where>
<if test="objId != null "> and obj_id = #{objId}</if>
<if test="monitorCode != null and monitorCode != ''"> and monitor_code = #{monitorCode}</if>
<if test="instrumentValue != null "> and instrument_value = #{instrumentValue}</if>
<if test="expend != null "> and expend = #{expend}</if>
<if test="recordTime != null and recordTime != ''"> and record_time = #{recordTime}</if>
<if test="beginTime != null and beginTime != ''"> and begin_time = #{beginTime}</if>
<if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if>
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
<if test="createdTime != null "> and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
</where>
order by OBJ_ID
</select>
<select id="selectReportPointDnbByObjId" parameterType="Long" resultMap="ReportPointDnbResult">
<include refid="selectReportPointDnbVo"/>
where obj_id = #{objId}
</select>
<insert id="insertReportPointDnb" parameterType="ReportPointDnb">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_deviceledger.NEXTVAL as objId FROM DUAL
</selectKey>
insert into report_point_dnb
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="monitorCode != null">monitor_code,</if>
<if test="instrumentValue != null">instrument_value,</if>
<if test="expend != null">expend,</if>
<if test="recordTime != null">record_time,</if>
<if test="beginTime != null">begin_time,</if>
<if test="endTime != null">end_time,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="monitorCode != null">#{monitorCode},</if>
<if test="instrumentValue != null">#{instrumentValue},</if>
<if test="expend != null">#{expend},</if>
<if test="recordTime != null">#{recordTime},</if>
<if test="beginTime != null">#{beginTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateReportPointDnb" parameterType="ReportPointDnb">
update report_point_dnb
<trim prefix="SET" suffixOverrides=",">
<if test="monitorCode != null">monitor_code = #{monitorCode},</if>
<if test="instrumentValue != null">instrument_value = #{instrumentValue},</if>
<if test="expend != null">expend = #{expend},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="beginTime != null">begin_time = #{beginTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteReportPointDnbByObjId" parameterType="Long">
delete from report_point_dnb where obj_id = #{objId}
</delete>
<delete id="deleteReportPointDnbByObjIds" parameterType="String">
delete from report_point_dnb where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save