change - add计量设备信息、能源单价
parent
b7288c3f66
commit
5e573e9c04
@ -0,0 +1,105 @@
|
|||||||
|
package com.os.ems.base.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.common.utils.DateUtils;
|
||||||
|
import com.os.ems.base.domain.EmsBaseEnergyPrice;
|
||||||
|
import com.os.ems.base.service.IEmsBaseEnergyPriceService;
|
||||||
|
import com.os.common.utils.poi.ExcelUtil;
|
||||||
|
import com.os.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源月份单价Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ems/base/baseEnergyPrice")
|
||||||
|
public class EmsBaseEnergyPriceController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IEmsBaseEnergyPriceService emsBaseEnergyPriceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<EmsBaseEnergyPrice> list = emsBaseEnergyPriceService.selectEmsBaseEnergyPriceList(emsBaseEnergyPrice);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出能源月份单价列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:export')")
|
||||||
|
@Log(title = "能源月份单价", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
List<EmsBaseEnergyPrice> list = emsBaseEnergyPriceService.selectEmsBaseEnergyPriceList(emsBaseEnergyPrice);
|
||||||
|
ExcelUtil<EmsBaseEnergyPrice> util = new ExcelUtil<EmsBaseEnergyPrice>(EmsBaseEnergyPrice.class);
|
||||||
|
util.exportExcel(response, list, "能源月份单价数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取能源月份单价详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||||
|
{
|
||||||
|
return success(emsBaseEnergyPriceService.selectEmsBaseEnergyPriceByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增能源月份单价
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:add')")
|
||||||
|
@Log(title = "能源月份单价", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
return toAjax(emsBaseEnergyPriceService.insertEmsBaseEnergyPrice(emsBaseEnergyPrice));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改能源月份单价
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:edit')")
|
||||||
|
@Log(title = "能源月份单价", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
return toAjax(emsBaseEnergyPriceService.updateEmsBaseEnergyPrice(emsBaseEnergyPrice));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除能源月份单价
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseEnergyPrice:remove')")
|
||||||
|
@Log(title = "能源月份单价", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||||
|
{
|
||||||
|
return toAjax(emsBaseEnergyPriceService.deleteEmsBaseEnergyPriceByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
package com.os.ems.base.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.base.domain.EmsBaseMonitorInfo;
|
||||||
|
import com.os.ems.base.service.IEmsBaseMonitorInfoService;
|
||||||
|
import com.os.common.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量设备信息Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ems/base/baseMonitorInfo")
|
||||||
|
public class EmsBaseMonitorInfoController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IEmsBaseMonitorInfoService emsBaseMonitorInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
List<EmsBaseMonitorInfo> list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出计量设备信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:export')")
|
||||||
|
@Log(title = "计量设备信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
List<EmsBaseMonitorInfo> list = emsBaseMonitorInfoService.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||||
|
ExcelUtil<EmsBaseMonitorInfo> util = new ExcelUtil<EmsBaseMonitorInfo>(EmsBaseMonitorInfo.class);
|
||||||
|
util.exportExcel(response, list, "计量设备信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取计量设备信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId)
|
||||||
|
{
|
||||||
|
return success(emsBaseMonitorInfoService.selectEmsBaseMonitorInfoByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增计量设备信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:add')")
|
||||||
|
@Log(title = "计量设备信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
emsBaseMonitorInfo.setCreateBy(getUsername());
|
||||||
|
return toAjax(emsBaseMonitorInfoService.insertEmsBaseMonitorInfo(emsBaseMonitorInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改计量设备信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:edit')")
|
||||||
|
@Log(title = "计量设备信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
emsBaseMonitorInfo.setUpdateBy(getUsername());
|
||||||
|
return toAjax(emsBaseMonitorInfoService.updateEmsBaseMonitorInfo(emsBaseMonitorInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量设备信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('ems/base:baseMonitorInfo:remove')")
|
||||||
|
@Log(title = "计量设备信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds)
|
||||||
|
{
|
||||||
|
return toAjax(emsBaseMonitorInfoService.deleteEmsBaseMonitorInfoByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,160 @@
|
|||||||
|
package com.os.ems.base.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
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.os.common.annotation.Excel;
|
||||||
|
import com.os.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源月份单价对象 ems_base_energy_price
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
public class EmsBaseEnergyPrice extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键标识 */
|
||||||
|
private Long objId;
|
||||||
|
|
||||||
|
/** 能源类型编号 */
|
||||||
|
@Excel(name = "能源类型编号")
|
||||||
|
private Long energyId;
|
||||||
|
|
||||||
|
/** 能源类型名称 */
|
||||||
|
@Excel(name = "能源类型名称")
|
||||||
|
private String energyName;
|
||||||
|
|
||||||
|
/** 单位 */
|
||||||
|
@Excel(name = "单位")
|
||||||
|
private String measureUnit;
|
||||||
|
|
||||||
|
/** 采购月份 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "采购月份", width = 30, dateFormat = "yyyy-MM")
|
||||||
|
private Date monthDate;
|
||||||
|
|
||||||
|
/** 含税单价 */
|
||||||
|
@Excel(name = "含税单价")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
/** 不含税单价 */
|
||||||
|
@Excel(name = "不含税单价")
|
||||||
|
private BigDecimal unTaxPrice;
|
||||||
|
|
||||||
|
/** 开始日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
/** 结束日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
|
public void setObjId(Long objId)
|
||||||
|
{
|
||||||
|
this.objId = objId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjId()
|
||||||
|
{
|
||||||
|
return objId;
|
||||||
|
}
|
||||||
|
public void setEnergyId(Long energyId)
|
||||||
|
{
|
||||||
|
this.energyId = energyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEnergyId()
|
||||||
|
{
|
||||||
|
return energyId;
|
||||||
|
}
|
||||||
|
public void setEnergyName(String energyName)
|
||||||
|
{
|
||||||
|
this.energyName = energyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnergyName()
|
||||||
|
{
|
||||||
|
return energyName;
|
||||||
|
}
|
||||||
|
public void setMeasureUnit(String measureUnit)
|
||||||
|
{
|
||||||
|
this.measureUnit = measureUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMeasureUnit()
|
||||||
|
{
|
||||||
|
return measureUnit;
|
||||||
|
}
|
||||||
|
public void setMonthDate(Date monthDate)
|
||||||
|
{
|
||||||
|
this.monthDate = monthDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getMonthDate()
|
||||||
|
{
|
||||||
|
return monthDate;
|
||||||
|
}
|
||||||
|
public void setPrice(BigDecimal price)
|
||||||
|
{
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrice()
|
||||||
|
{
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
public void setUnTaxPrice(BigDecimal unTaxPrice)
|
||||||
|
{
|
||||||
|
this.unTaxPrice = unTaxPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getUnTaxPrice()
|
||||||
|
{
|
||||||
|
return unTaxPrice;
|
||||||
|
}
|
||||||
|
public void setStartDate(Date startDate)
|
||||||
|
{
|
||||||
|
this.startDate = startDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getStartDate()
|
||||||
|
{
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
public void setEndDate(Date endDate)
|
||||||
|
{
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndDate()
|
||||||
|
{
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objId", getObjId())
|
||||||
|
.append("energyId", getEnergyId())
|
||||||
|
.append("energyName", getEnergyName())
|
||||||
|
.append("measureUnit", getMeasureUnit())
|
||||||
|
.append("monthDate", getMonthDate())
|
||||||
|
.append("price", getPrice())
|
||||||
|
.append("unTaxPrice", getUnTaxPrice())
|
||||||
|
.append("startDate", getStartDate())
|
||||||
|
.append("endDate", getEndDate())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseEnergyPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源月份单价Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
public interface EmsBaseEnergyPriceMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 能源月份单价
|
||||||
|
*/
|
||||||
|
public EmsBaseEnergyPrice selectEmsBaseEnergyPriceByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价列表
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 能源月份单价集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseEnergyPrice> selectEmsBaseEnergyPriceList(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除能源月份单价
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除能源月份单价
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量设备信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
public interface EmsBaseMonitorInfoMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 计量设备信息
|
||||||
|
*/
|
||||||
|
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 计量设备信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量设备信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量设备信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseEnergyPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源月份单价Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
public interface IEmsBaseEnergyPriceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 能源月份单价
|
||||||
|
*/
|
||||||
|
public EmsBaseEnergyPrice selectEmsBaseEnergyPriceByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价列表
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 能源月份单价集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseEnergyPrice> selectEmsBaseEnergyPriceList(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除能源月份单价
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的能源月份单价主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除能源月份单价信息
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjId(Long objId);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.os.ems.base.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量设备信息Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
public interface IEmsBaseMonitorInfoService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 计量设备信息
|
||||||
|
*/
|
||||||
|
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 计量设备信息集合
|
||||||
|
*/
|
||||||
|
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量设备信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的计量设备信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量设备信息信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjId(Long objId);
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package com.os.ems.base.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.os.common.exception.ServiceException;
|
||||||
|
import com.os.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.os.ems.base.mapper.EmsBaseEnergyPriceMapper;
|
||||||
|
import com.os.ems.base.domain.EmsBaseEnergyPrice;
|
||||||
|
import com.os.ems.base.service.IEmsBaseEnergyPriceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 能源月份单价Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmsBaseEnergyPriceServiceImpl implements IEmsBaseEnergyPriceService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EmsBaseEnergyPriceMapper emsBaseEnergyPriceMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 能源月份单价
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmsBaseEnergyPrice selectEmsBaseEnergyPriceByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseEnergyPriceMapper.selectEmsBaseEnergyPriceByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询能源月份单价列表
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 能源月份单价
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmsBaseEnergyPrice> selectEmsBaseEnergyPriceList(EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
return emsBaseEnergyPriceMapper.selectEmsBaseEnergyPriceList(emsBaseEnergyPrice);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
emsBaseEnergyPrice.setCreateTime(DateUtils.getNowDate());
|
||||||
|
emsBaseEnergyPriceMapper.insertEmsBaseEnergyPrice(emsBaseEnergyPrice);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException("能源月份重复!");
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改能源月份单价
|
||||||
|
*
|
||||||
|
* @param emsBaseEnergyPrice 能源月份单价
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEmsBaseEnergyPrice(EmsBaseEnergyPrice emsBaseEnergyPrice)
|
||||||
|
{
|
||||||
|
emsBaseEnergyPrice.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseEnergyPriceMapper.updateEmsBaseEnergyPrice(emsBaseEnergyPrice);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除能源月份单价
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的能源月份单价主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjIds(Long[] objIds)
|
||||||
|
{
|
||||||
|
return emsBaseEnergyPriceMapper.deleteEmsBaseEnergyPriceByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除能源月份单价信息
|
||||||
|
*
|
||||||
|
* @param objId 能源月份单价主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseEnergyPriceByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseEnergyPriceMapper.deleteEmsBaseEnergyPriceByObjId(objId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.os.ems.base.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.os.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.os.ems.base.mapper.EmsBaseMonitorInfoMapper;
|
||||||
|
import com.os.ems.base.domain.EmsBaseMonitorInfo;
|
||||||
|
import com.os.ems.base.service.IEmsBaseMonitorInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量设备信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-05-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private EmsBaseMonitorInfoMapper emsBaseMonitorInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 计量设备信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EmsBaseMonitorInfo selectEmsBaseMonitorInfoByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询计量设备信息列表
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 计量设备信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EmsBaseMonitorInfo> selectEmsBaseMonitorInfoList(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorInfoMapper.selectEmsBaseMonitorInfoList(emsBaseMonitorInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
emsBaseMonitorInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseMonitorInfoMapper.insertEmsBaseMonitorInfo(emsBaseMonitorInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改计量设备信息
|
||||||
|
*
|
||||||
|
* @param emsBaseMonitorInfo 计量设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateEmsBaseMonitorInfo(EmsBaseMonitorInfo emsBaseMonitorInfo)
|
||||||
|
{
|
||||||
|
emsBaseMonitorInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return emsBaseMonitorInfoMapper.updateEmsBaseMonitorInfo(emsBaseMonitorInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除计量设备信息
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的计量设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjIds(Long[] objIds)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除计量设备信息信息
|
||||||
|
*
|
||||||
|
* @param objId 计量设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteEmsBaseMonitorInfoByObjId(Long objId)
|
||||||
|
{
|
||||||
|
return emsBaseMonitorInfoMapper.deleteEmsBaseMonitorInfoByObjId(objId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
<?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.base.mapper.EmsBaseEnergyPriceMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmsBaseEnergyPrice" id="EmsBaseEnergyPriceResult">
|
||||||
|
<result property="objId" column="obj_id"/>
|
||||||
|
<result property="energyId" column="energy_id"/>
|
||||||
|
<result property="energyName" column="energy_name"/>
|
||||||
|
<result property="measureUnit" column="measure_unit"/>
|
||||||
|
<result property="monthDate" column="month_date"/>
|
||||||
|
<result property="price" column="price"/>
|
||||||
|
<result property="unTaxPrice" column="un_tax_price"/>
|
||||||
|
<result property="startDate" column="start_date"/>
|
||||||
|
<result property="endDate" column="end_date"/>
|
||||||
|
<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="selectEmsBaseEnergyPriceVo">
|
||||||
|
select ebep.obj_id,
|
||||||
|
ebep.energy_id,
|
||||||
|
ebet.energy_name energy_name,
|
||||||
|
ebet.measure_unit measure_unit,
|
||||||
|
ebep.month_date,
|
||||||
|
ebep.price,
|
||||||
|
ebep.un_tax_price,
|
||||||
|
ebep.start_date,
|
||||||
|
ebep.end_date,
|
||||||
|
ebep.create_by,
|
||||||
|
ebep.create_time,
|
||||||
|
ebep.update_by,
|
||||||
|
ebep.update_time,
|
||||||
|
ebep.remark
|
||||||
|
from ems_base_energy_price ebep
|
||||||
|
left join ems_base_energy_type ebet on ebet.energy_type_id = ebep.energy_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseEnergyPriceList" parameterType="EmsBaseEnergyPrice" resultMap="EmsBaseEnergyPriceResult">
|
||||||
|
<include refid="selectEmsBaseEnergyPriceVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="energyId != null ">and ebep.energy_id = #{energyId}</if>
|
||||||
|
<if test="energyName != null and energyName != ''">and ebep.energy_name like concat('%', #{energyName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="measureUnit != null and measureUnit != ''">and ebep.measure_unit = #{measureUnit}</if>
|
||||||
|
<if test="params.beginMonthDate != null and params.beginMonthDate != '' and params.endMonthDate != null and params.endMonthDate != ''">
|
||||||
|
and ebep.month_date between #{params.beginMonthDate} and #{params.endMonthDate}
|
||||||
|
</if>
|
||||||
|
<if test="price != null ">and ebep.price = #{price}</if>
|
||||||
|
<if test="unTaxPrice != null ">and ebep.un_tax_price = #{unTaxPrice}</if>
|
||||||
|
<if test="startDate != null ">and ebep.start_date = #{startDate}</if>
|
||||||
|
<if test="endDate != null ">and ebep.end_date = #{endDate}</if>
|
||||||
|
<if test="createBy != null and createBy != ''">and ebep.create_by = #{createBy}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and ebep.create_time = #{createTime}</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">and ebep.update_by = #{updateBy}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and ebep.update_time = #{updateTime}</if>
|
||||||
|
<if test="remark != null and remark != ''">and ebep.remark = #{remark}</if>
|
||||||
|
</where>
|
||||||
|
order by ebep.energy_id, ebep.month_date desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseEnergyPriceByObjId" parameterType="Long" resultMap="EmsBaseEnergyPriceResult">
|
||||||
|
<include refid="selectEmsBaseEnergyPriceVo"/>
|
||||||
|
where ebep.obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmsBaseEnergyPrice" parameterType="EmsBaseEnergyPrice" useGeneratedKeys="true"
|
||||||
|
keyProperty="objId">
|
||||||
|
insert into ems_base_energy_price
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="energyId != null">energy_id,</if>
|
||||||
|
<if test="energyName != null">energy_name,</if>
|
||||||
|
<if test="measureUnit != null">measure_unit,</if>
|
||||||
|
<if test="monthDate != null">month_date,</if>
|
||||||
|
<if test="price != null">price,</if>
|
||||||
|
<if test="unTaxPrice != null">un_tax_price,</if>
|
||||||
|
<if test="startDate != null">start_date,</if>
|
||||||
|
<if test="endDate != null">end_date,</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="energyId != null">#{energyId},</if>
|
||||||
|
<if test="energyName != null">#{energyName},</if>
|
||||||
|
<if test="measureUnit != null">#{measureUnit},</if>
|
||||||
|
<if test="monthDate != null">#{monthDate},</if>
|
||||||
|
<if test="price != null">#{price},</if>
|
||||||
|
<if test="unTaxPrice != null">#{unTaxPrice},</if>
|
||||||
|
<if test="startDate != null">#{startDate},</if>
|
||||||
|
<if test="endDate != null">#{endDate},</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="updateEmsBaseEnergyPrice" parameterType="EmsBaseEnergyPrice">
|
||||||
|
update ems_base_energy_price
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="energyId != null">energy_id = #{energyId},</if>
|
||||||
|
<if test="energyName != null">energy_name = #{energyName},</if>
|
||||||
|
<if test="measureUnit != null">measure_unit = #{measureUnit},</if>
|
||||||
|
<if test="monthDate != null">month_date = #{monthDate},</if>
|
||||||
|
<if test="price != null">price = #{price},</if>
|
||||||
|
<if test="unTaxPrice != null">un_tax_price = #{unTaxPrice},</if>
|
||||||
|
<if test="startDate != null">start_date = #{startDate},</if>
|
||||||
|
<if test="endDate != null">end_date = #{endDate},</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 obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseEnergyPriceByObjId" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from ems_base_energy_price
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseEnergyPriceByObjIds" parameterType="String">
|
||||||
|
delete from ems_base_energy_price where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -0,0 +1,161 @@
|
|||||||
|
<?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.base.mapper.EmsBaseMonitorInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="EmsBaseMonitorInfo" id="EmsBaseMonitorInfoResult">
|
||||||
|
<result property="objId" column="obj_id" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="monitorId" column="monitor_id" />
|
||||||
|
<result property="monitorName" column="monitor_name" />
|
||||||
|
<result property="monitorAddr" column="monitor_addr" />
|
||||||
|
<result property="monitorType" column="monitor_type" />
|
||||||
|
<result property="monitorStatus" column="monitor_status" />
|
||||||
|
<result property="collectDeviceId" column="collect_device_id" />
|
||||||
|
<result property="ancestors" column="ancestors" />
|
||||||
|
<result property="grade" column="grade" />
|
||||||
|
<result property="meterTypeId" column="meter_type_id" />
|
||||||
|
<result property="correctValue" column="correct_value" />
|
||||||
|
<result property="pt" column="pt" />
|
||||||
|
<result property="ct" column="ct" />
|
||||||
|
<result property="isAmmeter" column="is_ammeter" />
|
||||||
|
<result property="isKeyMonitor" column="is_key_monitor" />
|
||||||
|
<result property="isCircuit" column="is_circuit" />
|
||||||
|
<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="publicShareType" column="public_share_type" />
|
||||||
|
<result property="monitorHierarchy" column="monitor_hierarchy" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectEmsBaseMonitorInfoVo">
|
||||||
|
select obj_id, parent_id, monitor_id, monitor_name, monitor_addr, monitor_type, monitor_status, collect_device_id, ancestors, grade, meter_type_id, correct_value, pt, ct, is_ammeter, is_key_monitor, is_circuit, create_by, create_time, update_by, update_time, public_share_type, monitor_hierarchy from ems_base_monitor_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseMonitorInfoList" parameterType="EmsBaseMonitorInfo" resultMap="EmsBaseMonitorInfoResult">
|
||||||
|
<include refid="selectEmsBaseMonitorInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="monitorId != null and monitorId != ''"> and monitor_id = #{monitorId}</if>
|
||||||
|
<if test="monitorName != null and monitorName != ''"> and monitor_name like concat('%', #{monitorName}, '%')</if>
|
||||||
|
<if test="monitorAddr != null and monitorAddr != ''"> and monitor_addr = #{monitorAddr}</if>
|
||||||
|
<if test="monitorType != null "> and monitor_type = #{monitorType}</if>
|
||||||
|
<if test="monitorStatus != null "> and monitor_status = #{monitorStatus}</if>
|
||||||
|
<if test="collectDeviceId != null and collectDeviceId != ''"> and collect_device_id = #{collectDeviceId}</if>
|
||||||
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||||
|
<if test="grade != null "> and grade = #{grade}</if>
|
||||||
|
<if test="meterTypeId != null and meterTypeId != ''"> and meter_type_id = #{meterTypeId}</if>
|
||||||
|
<if test="correctValue != null "> and correct_value = #{correctValue}</if>
|
||||||
|
<if test="pt != null "> and pt = #{pt}</if>
|
||||||
|
<if test="ct != null "> and ct = #{ct}</if>
|
||||||
|
<if test="isAmmeter != null and isAmmeter != ''"> and is_ammeter = #{isAmmeter}</if>
|
||||||
|
<if test="isKeyMonitor != null "> and is_key_monitor = #{isKeyMonitor}</if>
|
||||||
|
<if test="isCircuit != null "> and is_circuit = #{isCircuit}</if>
|
||||||
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
||||||
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
|
||||||
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
||||||
|
<if test="publicShareType != null "> and public_share_type = #{publicShareType}</if>
|
||||||
|
<if test="monitorHierarchy != null "> and monitor_hierarchy = #{monitorHierarchy}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEmsBaseMonitorInfoByObjId" parameterType="Long" resultMap="EmsBaseMonitorInfoResult">
|
||||||
|
<include refid="selectEmsBaseMonitorInfoVo"/>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertEmsBaseMonitorInfo" parameterType="EmsBaseMonitorInfo" useGeneratedKeys="true" keyProperty="objId">
|
||||||
|
insert into ems_base_monitor_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="monitorId != null and monitorId != ''">monitor_id,</if>
|
||||||
|
<if test="monitorName != null">monitor_name,</if>
|
||||||
|
<if test="monitorAddr != null">monitor_addr,</if>
|
||||||
|
<if test="monitorType != null">monitor_type,</if>
|
||||||
|
<if test="monitorStatus != null">monitor_status,</if>
|
||||||
|
<if test="collectDeviceId != null">collect_device_id,</if>
|
||||||
|
<if test="ancestors != null">ancestors,</if>
|
||||||
|
<if test="grade != null">grade,</if>
|
||||||
|
<if test="meterTypeId != null">meter_type_id,</if>
|
||||||
|
<if test="correctValue != null">correct_value,</if>
|
||||||
|
<if test="pt != null">pt,</if>
|
||||||
|
<if test="ct != null">ct,</if>
|
||||||
|
<if test="isAmmeter != null">is_ammeter,</if>
|
||||||
|
<if test="isKeyMonitor != null">is_key_monitor,</if>
|
||||||
|
<if test="isCircuit != null">is_circuit,</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="publicShareType != null">public_share_type,</if>
|
||||||
|
<if test="monitorHierarchy != null">monitor_hierarchy,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="monitorId != null and monitorId != ''">#{monitorId},</if>
|
||||||
|
<if test="monitorName != null">#{monitorName},</if>
|
||||||
|
<if test="monitorAddr != null">#{monitorAddr},</if>
|
||||||
|
<if test="monitorType != null">#{monitorType},</if>
|
||||||
|
<if test="monitorStatus != null">#{monitorStatus},</if>
|
||||||
|
<if test="collectDeviceId != null">#{collectDeviceId},</if>
|
||||||
|
<if test="ancestors != null">#{ancestors},</if>
|
||||||
|
<if test="grade != null">#{grade},</if>
|
||||||
|
<if test="meterTypeId != null">#{meterTypeId},</if>
|
||||||
|
<if test="correctValue != null">#{correctValue},</if>
|
||||||
|
<if test="pt != null">#{pt},</if>
|
||||||
|
<if test="ct != null">#{ct},</if>
|
||||||
|
<if test="isAmmeter != null">#{isAmmeter},</if>
|
||||||
|
<if test="isKeyMonitor != null">#{isKeyMonitor},</if>
|
||||||
|
<if test="isCircuit != null">#{isCircuit},</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="publicShareType != null">#{publicShareType},</if>
|
||||||
|
<if test="monitorHierarchy != null">#{monitorHierarchy},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateEmsBaseMonitorInfo" parameterType="EmsBaseMonitorInfo">
|
||||||
|
update ems_base_monitor_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="monitorId != null and monitorId != ''">monitor_id = #{monitorId},</if>
|
||||||
|
<if test="monitorName != null">monitor_name = #{monitorName},</if>
|
||||||
|
<if test="monitorAddr != null">monitor_addr = #{monitorAddr},</if>
|
||||||
|
<if test="monitorType != null">monitor_type = #{monitorType},</if>
|
||||||
|
<if test="monitorStatus != null">monitor_status = #{monitorStatus},</if>
|
||||||
|
<if test="collectDeviceId != null">collect_device_id = #{collectDeviceId},</if>
|
||||||
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||||
|
<if test="grade != null">grade = #{grade},</if>
|
||||||
|
<if test="meterTypeId != null">meter_type_id = #{meterTypeId},</if>
|
||||||
|
<if test="correctValue != null">correct_value = #{correctValue},</if>
|
||||||
|
<if test="pt != null">pt = #{pt},</if>
|
||||||
|
<if test="ct != null">ct = #{ct},</if>
|
||||||
|
<if test="isAmmeter != null">is_ammeter = #{isAmmeter},</if>
|
||||||
|
<if test="isKeyMonitor != null">is_key_monitor = #{isKeyMonitor},</if>
|
||||||
|
<if test="isCircuit != null">is_circuit = #{isCircuit},</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="publicShareType != null">public_share_type = #{publicShareType},</if>
|
||||||
|
<if test="monitorHierarchy != null">monitor_hierarchy = #{monitorHierarchy},</if>
|
||||||
|
</trim>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseMonitorInfoByObjId" parameterType="Long">
|
||||||
|
delete from ems_base_monitor_info where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteEmsBaseMonitorInfoByObjIds" parameterType="String">
|
||||||
|
delete from ems_base_monitor_info where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue