站点地图修改
This commit is contained in:
@ -30,9 +30,18 @@ public class EmsSiteMonitorController extends BaseController{
|
||||
/**
|
||||
* 单站监控-设备监控-实时运行头部数据
|
||||
*/
|
||||
@GetMapping("/runingHeadInfo")
|
||||
public AjaxResult getRuningHeadInfo(@RequestParam Long siteId)
|
||||
@GetMapping("/runningHeadInfo")
|
||||
public AjaxResult getRunningHeadInfo(@RequestParam Long siteId)
|
||||
{
|
||||
return success(iSingleSiteService.getSiteRuningHeadInfo(siteId));
|
||||
return success(iSingleSiteService.getSiteRunningHeadInfo(siteId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单站监控-设备监控-实时运行曲线图数据
|
||||
*/
|
||||
@GetMapping("/runningGraph")
|
||||
public AjaxResult getRunningGraph(@RequestParam Long siteId)
|
||||
{
|
||||
return success(iSingleSiteService.getRunningGraph(siteId));
|
||||
}
|
||||
}
|
||||
|
@ -1,57 +0,0 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点对象 site
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public class EmsSite extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
private Long id;
|
||||
|
||||
/** 站点名称 */
|
||||
@Excel(name = "站点名称")
|
||||
private String siteName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteName(String siteName)
|
||||
{
|
||||
this.siteName = siteName;
|
||||
}
|
||||
|
||||
public String getSiteName()
|
||||
{
|
||||
return siteName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteName", getSiteName())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
121
ems-system/src/main/java/com/xzzn/ems/domain/EmsSiteSetting.java
Normal file
121
ems-system/src/main/java/com/xzzn/ems/domain/EmsSiteSetting.java
Normal file
@ -0,0 +1,121 @@
|
||||
package com.xzzn.ems.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xzzn.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
/**
|
||||
* 站点对象 ems_site_setting
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
public class EmsSiteSetting extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
private Long id;
|
||||
|
||||
/** 站点名称 */
|
||||
@Excel(name = "站点名称")
|
||||
private String siteName;
|
||||
|
||||
/** 站点地址 */
|
||||
@Excel(name = "站点地址")
|
||||
private String siteAddress;
|
||||
|
||||
/** 运营时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "运营时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date runningTime;
|
||||
|
||||
/** 纬度 */
|
||||
@Excel(name = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
/** 经度 */
|
||||
@Excel(name = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteName(String siteName)
|
||||
{
|
||||
this.siteName = siteName;
|
||||
}
|
||||
|
||||
public String getSiteName()
|
||||
{
|
||||
return siteName;
|
||||
}
|
||||
|
||||
public void setSiteAddress(String siteAddress)
|
||||
{
|
||||
this.siteAddress = siteAddress;
|
||||
}
|
||||
|
||||
public String getSiteAddress()
|
||||
{
|
||||
return siteAddress;
|
||||
}
|
||||
|
||||
public void setRunningTime(Date runningTime)
|
||||
{
|
||||
this.runningTime = runningTime;
|
||||
}
|
||||
|
||||
public Date getRunningTime()
|
||||
{
|
||||
return runningTime;
|
||||
}
|
||||
|
||||
public void setLatitude(BigDecimal latitude)
|
||||
{
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public BigDecimal getLatitude()
|
||||
{
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLongitude(BigDecimal longitude)
|
||||
{
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public BigDecimal getLongitude()
|
||||
{
|
||||
return longitude;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteName", getSiteName())
|
||||
.append("siteAddress", getSiteAddress())
|
||||
.append("runningTime", getRunningTime())
|
||||
.append("latitude", getLatitude())
|
||||
.append("longitude", getLongitude())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -9,6 +8,11 @@ import java.util.List;
|
||||
*
|
||||
*/
|
||||
public class SingleSiteBaseInfo {
|
||||
/**
|
||||
* 站点名称
|
||||
*/
|
||||
private String siteName;
|
||||
|
||||
/**
|
||||
* 今日充电量
|
||||
*/
|
||||
@ -27,12 +31,17 @@ public class SingleSiteBaseInfo {
|
||||
/**
|
||||
* 总放电量
|
||||
*/
|
||||
private BigDecimal totalDischargedCap;
|
||||
private BigDecimal totalDisChargedCap;
|
||||
|
||||
/**
|
||||
* 站点坐标
|
||||
*/
|
||||
private String[] siteLocation;
|
||||
|
||||
/**
|
||||
* 站点位置
|
||||
*/
|
||||
private String siteLocation;
|
||||
private String siteAddress;
|
||||
|
||||
/**
|
||||
* 投运时间
|
||||
@ -52,7 +61,15 @@ public class SingleSiteBaseInfo {
|
||||
/**
|
||||
* 七天放电统计
|
||||
*/
|
||||
private List<SiteMonitorDataVo> SevenDayDischargeStats;
|
||||
private List<SiteMonitorDataVo> sevenDayDisChargeStats;
|
||||
|
||||
public String getSiteName() {
|
||||
return siteName;
|
||||
}
|
||||
|
||||
public void setSiteName(String siteName) {
|
||||
this.siteName = siteName;
|
||||
}
|
||||
|
||||
public BigDecimal getDayChargedCap() {
|
||||
return dayChargedCap;
|
||||
@ -62,14 +79,6 @@ public class SingleSiteBaseInfo {
|
||||
this.dayChargedCap = dayChargedCap;
|
||||
}
|
||||
|
||||
public List<SiteMonitorDataVo> getSevenDayDischargeStats() {
|
||||
return SevenDayDischargeStats;
|
||||
}
|
||||
|
||||
public void setSevenDayDischargeStats(List<SiteMonitorDataVo> sevenDayDischargeStats) {
|
||||
SevenDayDischargeStats = sevenDayDischargeStats;
|
||||
}
|
||||
|
||||
public BigDecimal getInstalledCap() {
|
||||
return installedCap;
|
||||
}
|
||||
@ -94,20 +103,28 @@ public class SingleSiteBaseInfo {
|
||||
this.runningTime = runningTime;
|
||||
}
|
||||
|
||||
public String getSiteLocation() {
|
||||
public String[] getSiteLocation() {
|
||||
return siteLocation;
|
||||
}
|
||||
|
||||
public void setSiteLocation(String siteLocation) {
|
||||
public void setSiteLocation(String[] siteLocation) {
|
||||
this.siteLocation = siteLocation;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDischargedCap() {
|
||||
return totalDischargedCap;
|
||||
public String getSiteAddress() {
|
||||
return siteAddress;
|
||||
}
|
||||
|
||||
public void setTotalDischargedCap(BigDecimal totalDischargedCap) {
|
||||
this.totalDischargedCap = totalDischargedCap;
|
||||
public void setSiteAddress(String siteAddress) {
|
||||
this.siteAddress = siteAddress;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalDisChargedCap() {
|
||||
return totalDisChargedCap;
|
||||
}
|
||||
|
||||
public void setTotalDisChargedCap(BigDecimal totalDisChargedCap) {
|
||||
this.totalDisChargedCap = totalDisChargedCap;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalChargedCap() {
|
||||
@ -125,4 +142,12 @@ public class SingleSiteBaseInfo {
|
||||
public void setDayDisChargedCap(BigDecimal dayDisChargedCap) {
|
||||
this.dayDisChargedCap = dayDisChargedCap;
|
||||
}
|
||||
|
||||
public List<SiteMonitorDataVo> getSevenDayDisChargeStats() {
|
||||
return sevenDayDisChargeStats;
|
||||
}
|
||||
|
||||
public void setSevenDayDisChargeStats(List<SiteMonitorDataVo> sevenDayDisChargeStats) {
|
||||
this.sevenDayDisChargeStats = sevenDayDisChargeStats;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.xzzn.ems.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
/**
|
||||
* 站点Mapper接口
|
||||
*
|
||||
* @author xzzn
|
||||
* @date 2025-06-16
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
public interface EmsSiteMapper
|
||||
public interface EmsSiteSettingMapper
|
||||
{
|
||||
/**
|
||||
* 查询站点
|
||||
@ -18,30 +18,31 @@ public interface EmsSiteMapper
|
||||
* @param id 站点主键
|
||||
* @return 站点
|
||||
*/
|
||||
public EmsSite selectSiteById(Long id);
|
||||
public EmsSiteSetting selectEmsSiteSettingById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点列表
|
||||
*
|
||||
* @param emsSiteSetting 站点
|
||||
* @return 站点集合
|
||||
*/
|
||||
public List<EmsSite> selectSiteList();
|
||||
public List<EmsSiteSetting> selectEmsSiteSettingList(EmsSiteSetting emsSiteSetting);
|
||||
|
||||
/**
|
||||
* 新增站点
|
||||
*
|
||||
* @param site 站点
|
||||
* @param emsSiteSetting 站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSite(EmsSite site);
|
||||
public int insertEmsSiteSetting(EmsSiteSetting emsSiteSetting);
|
||||
|
||||
/**
|
||||
* 修改站点
|
||||
*
|
||||
* @param site 站点
|
||||
* @param emsSiteSetting 站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSite(EmsSite site);
|
||||
public int updateEmsSiteSetting(EmsSiteSetting emsSiteSetting);
|
||||
|
||||
/**
|
||||
* 删除站点
|
||||
@ -49,7 +50,7 @@ public interface EmsSiteMapper
|
||||
* @param id 站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteById(Long id);
|
||||
public int deleteEmsSiteSettingById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点
|
||||
@ -57,7 +58,7 @@ public interface EmsSiteMapper
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSiteByIds(Long[] ids);
|
||||
public int deleteEmsSiteSettingByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取站点总信息
|
@ -1,7 +1,6 @@
|
||||
package com.xzzn.ems.service;
|
||||
|
||||
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
|
||||
import java.util.List;
|
||||
@ -13,7 +12,7 @@ import java.util.List;
|
||||
public interface IEmsSiteService
|
||||
{
|
||||
|
||||
public List<EmsSite> getAllSites();
|
||||
public List<EmsSiteSetting> getAllSites();
|
||||
|
||||
|
||||
public SiteTotalInfoVo getSiteTotalInfo();
|
||||
|
@ -2,6 +2,7 @@ package com.xzzn.ems.service;
|
||||
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorHomeVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorRuningHeadInfoVo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorRuningInfoVo;
|
||||
|
||||
/**
|
||||
* 单点监控 服务层
|
||||
@ -13,5 +14,7 @@ public interface ISingleSiteService
|
||||
public SiteMonitorHomeVo getSiteMonitorDataVo(Long siteId);
|
||||
|
||||
|
||||
public SiteMonitorRuningHeadInfoVo getSiteRuningHeadInfo(Long siteId);
|
||||
public SiteMonitorRuningHeadInfoVo getSiteRunningHeadInfo(Long siteId);
|
||||
|
||||
public SiteMonitorRuningInfoVo getRunningGraph(Long siteId);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsSiteMapper;
|
||||
import com.xzzn.ems.mapper.EmsSiteSettingMapper;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -18,11 +18,11 @@ public class EmsSiteServiceImpl implements IEmsSiteService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private EmsSiteMapper emsSiteMapper;
|
||||
private EmsSiteSettingMapper emsSiteMapper;
|
||||
|
||||
@Override
|
||||
public List<EmsSite> getAllSites() {
|
||||
return emsSiteMapper.selectSiteList();
|
||||
public List<EmsSiteSetting> getAllSites() {
|
||||
return emsSiteMapper.selectEmsSiteSettingList(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,12 +2,12 @@ package com.xzzn.ems.service.impl;
|
||||
|
||||
import com.xzzn.common.utils.DateUtils;
|
||||
import com.xzzn.common.utils.StringUtils;
|
||||
import com.xzzn.ems.domain.EmsSite;
|
||||
import com.xzzn.ems.domain.EmsSiteSetting;
|
||||
import com.xzzn.ems.domain.vo.SingleSiteBaseInfo;
|
||||
import com.xzzn.ems.domain.vo.SiteMonitorDataVo;
|
||||
import com.xzzn.ems.domain.vo.SiteTotalInfoVo;
|
||||
import com.xzzn.ems.mapper.EmsPcsDataMapper;
|
||||
import com.xzzn.ems.mapper.EmsSiteMapper;
|
||||
import com.xzzn.ems.mapper.EmsSiteSettingMapper;
|
||||
import com.xzzn.ems.service.IEmsSiteService;
|
||||
import com.xzzn.ems.service.IHomePageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -15,7 +15,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -31,7 +30,7 @@ public class HomePageServiceImpl implements IHomePageService
|
||||
@Autowired
|
||||
private EmsPcsDataMapper emsPcsDataMapper;
|
||||
@Autowired
|
||||
private EmsSiteMapper emsSiteMapper;
|
||||
private EmsSiteSettingMapper emsSiteMapper;
|
||||
|
||||
@Override
|
||||
public SiteTotalInfoVo getSiteTotalInfo() {
|
||||
@ -44,14 +43,19 @@ public class HomePageServiceImpl implements IHomePageService
|
||||
|
||||
if (siteId != null) {
|
||||
// 站点基本信息
|
||||
EmsSite emsSite = emsSiteMapper.selectSiteById(siteId);
|
||||
EmsSiteSetting emsSite = emsSiteMapper.selectEmsSiteSettingById(siteId);
|
||||
if (emsSite != null) {
|
||||
singleSiteBaseInfo.setSiteLocation(emsSite.getRemark());//站点位置
|
||||
singleSiteBaseInfo.setRunningTime(DateUtils.parseDateToStr("yyyy-MM-dd",emsSite.getCreateTime()));//投运时间
|
||||
singleSiteBaseInfo.setSiteName(emsSite.getSiteName());
|
||||
String[] siteLocation = new String[2];
|
||||
siteLocation[0] = emsSite.getLongitude() == null ? "" : emsSite.getLongitude().toString();
|
||||
siteLocation[1] = emsSite.getLatitude() == null ? "" : emsSite.getLatitude().toString();
|
||||
singleSiteBaseInfo.setSiteLocation(siteLocation);//站点位置
|
||||
singleSiteBaseInfo.setSiteAddress(emsSite.getSiteAddress());
|
||||
singleSiteBaseInfo.setRunningTime(DateUtils.parseDateToStr("yyyy-MM-dd",emsSite.getRunningTime()));//投运时间
|
||||
// 装机功率+装机容量 待定
|
||||
// 七天放电数据统计
|
||||
List<SiteMonitorDataVo> siteMonitorDataVoList = emsPcsDataMapper.getPcsDataBySiteId(siteId);
|
||||
singleSiteBaseInfo.setSevenDayDischargeStats(siteMonitorDataVoList);
|
||||
singleSiteBaseInfo.setSevenDayDisChargeStats(siteMonitorDataVoList);
|
||||
// 充放电基本数据处理
|
||||
dealSitePCSDate(singleSiteBaseInfo,siteMonitorDataVoList);
|
||||
}
|
||||
@ -82,7 +86,7 @@ public class HomePageServiceImpl implements IHomePageService
|
||||
singleSiteBaseInfo.setDayChargedCap(dayChargeCap);
|
||||
singleSiteBaseInfo.setDayDisChargedCap(dayDisChargeCap);
|
||||
singleSiteBaseInfo.setTotalChargedCap(totalChargeCap);
|
||||
singleSiteBaseInfo.setTotalDischargedCap(totalDisChargeCap);
|
||||
singleSiteBaseInfo.setTotalDisChargedCap(totalDisChargeCap);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,23 +86,38 @@ public class SingleSiteServiceImpl implements ISingleSiteService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行头部数据
|
||||
@Override
|
||||
public SiteMonitorRuningHeadInfoVo getSiteRuningHeadInfo(Long siteId) {
|
||||
SiteMonitorRuningHeadInfoVo siteMonitorRuningHeadInfoVo = new SiteMonitorRuningHeadInfoVo();
|
||||
public SiteMonitorRuningHeadInfoVo getSiteRunningHeadInfo(Long siteId) {
|
||||
SiteMonitorRuningHeadInfoVo siteMonitorRunningHeadInfoVo = new SiteMonitorRuningHeadInfoVo();
|
||||
|
||||
if (siteId != null) {
|
||||
// 实时有功功率/实时无功功率/今日充电量/今日放电量
|
||||
siteMonitorRuningHeadInfoVo = emsPcsDataMapper.getSiteRunningHeadInfo(siteId);
|
||||
siteMonitorRunningHeadInfoVo = emsPcsDataMapper.getSiteRunningHeadInfo(siteId);
|
||||
// 电池簇SOC
|
||||
// 电池堆SOH
|
||||
EmsBatteryData emsBatteryData = emsBatteryDataMapper.getBatteryDataBySiteId(siteId);
|
||||
if (emsBatteryData != null) {
|
||||
siteMonitorRuningHeadInfoVo.setSoc(emsBatteryData.getSoc());
|
||||
siteMonitorRuningHeadInfoVo.setSoh(emsBatteryData.getSoh());
|
||||
siteMonitorRunningHeadInfoVo.setSoc(emsBatteryData.getSoc());
|
||||
siteMonitorRunningHeadInfoVo.setSoh(emsBatteryData.getSoh());
|
||||
}
|
||||
}
|
||||
|
||||
return siteMonitorRuningHeadInfoVo;
|
||||
return siteMonitorRunningHeadInfoVo;
|
||||
}
|
||||
|
||||
// 获取单站监控实时运行曲线图数据
|
||||
@Override
|
||||
public SiteMonitorRuningInfoVo getRunningGraph(Long siteId) {
|
||||
SiteMonitorRuningInfoVo siteMonitorRuningInfoVo = new SiteMonitorRuningInfoVo();
|
||||
if (siteId != null) {
|
||||
//储能功率list
|
||||
//pcs平均温度list
|
||||
//电池平均soclist
|
||||
//电池平均温度list
|
||||
|
||||
}
|
||||
return siteMonitorRuningInfoVo;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,11 +2,15 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsSiteMapper">
|
||||
<mapper namespace="com.xzzn.ems.mapper.EmsSiteSettingMapper">
|
||||
|
||||
<resultMap type="EmsSite" id="SiteResult">
|
||||
<resultMap type="EmsSiteSetting" id="EmsSiteSettingResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteName" column="site_name" />
|
||||
<result property="siteAddress" column="site_address" />
|
||||
<result property="runningTime" column="running_time" />
|
||||
<result property="latitude" column="latitude" />
|
||||
<result property="longitude" column="longitude" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
@ -14,26 +18,34 @@
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSiteVo">
|
||||
select id, site_name, remark, create_by, update_by, create_time, update_time from ems_site_setting
|
||||
<sql id="selectEmsSiteSettingVo">
|
||||
select id, site_name, site_address, running_time, latitude, longitude, remark, create_by, update_by, create_time, update_time from ems_site_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectSiteList" parameterType="EmsSite" resultMap="SiteResult">
|
||||
<include refid="selectSiteVo"/>
|
||||
<select id="selectEmsSiteSettingList" parameterType="EmsSiteSetting" resultMap="EmsSiteSettingResult">
|
||||
<include refid="selectEmsSiteSettingVo"/>
|
||||
<where>
|
||||
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
|
||||
<if test="siteAddress != null and siteAddress != ''"> and site_address = #{siteAddress}</if>
|
||||
<if test="runningTime != null "> and running_time = #{runningTime}</if>
|
||||
<if test="latitude != null "> and latitude = #{latitude}</if>
|
||||
<if test="longitude != null "> and longitude = #{longitude}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSiteById" parameterType="Long" resultMap="SiteResult">
|
||||
<include refid="selectSiteVo"/>
|
||||
<select id="selectEmsSiteSettingById" parameterType="Long" resultMap="EmsSiteSettingResult">
|
||||
<include refid="selectEmsSiteSettingVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSite" parameterType="EmsSite" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertEmsSiteSetting" parameterType="EmsSiteSetting" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ems_site_setting
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteName != null and siteName != ''">site_name,</if>
|
||||
<if test="siteAddress != null">site_address,</if>
|
||||
<if test="runningTime != null">running_time,</if>
|
||||
<if test="latitude != null">latitude,</if>
|
||||
<if test="longitude != null">longitude,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
@ -42,6 +54,10 @@
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteName != null and siteName != ''">#{siteName},</if>
|
||||
<if test="siteAddress != null">#{siteAddress},</if>
|
||||
<if test="runningTime != null">#{runningTime},</if>
|
||||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="longitude != null">#{longitude},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
@ -50,10 +66,14 @@
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSite" parameterType="EmsSite">
|
||||
<update id="updateEmsSiteSetting" parameterType="EmsSiteSetting">
|
||||
update ems_site_setting
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
|
||||
<if test="siteAddress != null">site_address = #{siteAddress},</if>
|
||||
<if test="runningTime != null">running_time = #{runningTime},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
@ -63,11 +83,11 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSiteById" parameterType="Long">
|
||||
<delete id="deleteEmsSiteSettingById" parameterType="Long">
|
||||
delete from ems_site_setting where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSiteByIds" parameterType="String">
|
||||
<delete id="deleteEmsSiteSettingByIds" parameterType="String">
|
||||
delete from ems_site_setting where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
Reference in New Issue
Block a user