水泵使用记录
This commit is contained in:
parent
45535a73bf
commit
a6d4f1a12c
@ -58,14 +58,14 @@ public class DeviceOtherMsgConsumer {
|
||||
reportMsg.put("code",0);
|
||||
reportMsg.put("msg","ok");
|
||||
issueInstructionsProducer.receiveDataReportResponse(productId.toString(),serialNumber,JSONUtil.toJsonStr(reportMsg));
|
||||
} else if ( topic.endsWith("hzlink/info/reply")) {
|
||||
} else if ( topic.endsWith("/info/reply")) {
|
||||
platformDataReportAckHandler(new String(data));
|
||||
|
||||
} else if (topic.endsWith("hzlink/cmd/down")) {
|
||||
platformCmdHandler(new String(data));
|
||||
//回应
|
||||
|
||||
} else if (topic.endsWith("hzlink/cmd/reply")) {
|
||||
} else if (topic.endsWith("/cmd/reply")) {
|
||||
deviceCmdAckHandler(new String(data));
|
||||
}
|
||||
otherMsgHandler.messageHandler(bo);
|
||||
@ -81,45 +81,45 @@ public class DeviceOtherMsgConsumer {
|
||||
private void deviceDataReportHandler(String data){
|
||||
System.err.println("mqtt接收到设备上报数据:"+ data);
|
||||
//回应
|
||||
|
||||
//解析
|
||||
// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}";
|
||||
JSONObject entries = JSONUtil.parseObj(data);
|
||||
// System.err.println("解析后:"+entries);
|
||||
//获取帧标识
|
||||
String type = entries.getStr("type");
|
||||
//获取帧号
|
||||
Long pakSn = entries.getLong("pakSn");
|
||||
//获取数据
|
||||
JSONObject dataObj = entries.getJSONObject("data");
|
||||
//获取水泵状态0=关泵,1=开泵
|
||||
Integer workState = dataObj.getInt("workState");
|
||||
//获取动作
|
||||
String action = dataObj.getStr("action");
|
||||
//获取单片机编码
|
||||
String mcuSn = dataObj.getStr("mcuSn");
|
||||
//获取累计用电量
|
||||
Integer sumEle = dataObj.getInt("sumEle");
|
||||
//获取累计用水量
|
||||
Integer sumFlow = dataObj.getInt("sumFlow");
|
||||
//获取瞬时流量
|
||||
Double insFlow = dataObj.getDouble("insFlow");
|
||||
//当前用户累计用水量
|
||||
Integer userSumFlow = dataObj.getInt("userSumFlow");
|
||||
//获取区域号
|
||||
String areaCode = dataObj.getStr("areaCode");
|
||||
//获取卡号
|
||||
String cardId = dataObj.getStr("cardId");
|
||||
//获取用户余额
|
||||
Double userBalance = dataObj.getDouble("userBalance");
|
||||
//获取用户累计用电量
|
||||
Integer userSumEle = dataObj.getInt("userSumEle");
|
||||
//获取本次用电量
|
||||
Integer curEle = dataObj.getInt("curEle");
|
||||
//获取本次用水量
|
||||
Integer curFlow = dataObj.getInt("curFlow");
|
||||
//获取瞬时功率
|
||||
Integer insPower = dataObj.getInt("insPower");
|
||||
//
|
||||
// //解析
|
||||
//// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}";
|
||||
// JSONObject entries = JSONUtil.parseObj(data);
|
||||
//// System.err.println("解析后:"+entries);
|
||||
// //获取帧标识
|
||||
// String type = entries.getStr("type");
|
||||
// //获取帧号
|
||||
// Long pakSn = entries.getLong("pakSn");
|
||||
// //获取数据
|
||||
// JSONObject dataObj = entries.getJSONObject("data");
|
||||
// //获取水泵状态0=关泵,1=开泵
|
||||
// Integer workState = dataObj.getInt("workState");
|
||||
// //获取动作
|
||||
// String action = dataObj.getStr("action");
|
||||
// //获取单片机编码
|
||||
// String mcuSn = dataObj.getStr("mcuSn");
|
||||
// //获取累计用电量
|
||||
// Integer sumEle = dataObj.getInt("sumEle");
|
||||
// //获取累计用水量
|
||||
// Integer sumFlow = dataObj.getInt("sumFlow");
|
||||
// //获取瞬时流量
|
||||
// Double insFlow = dataObj.getDouble("insFlow");
|
||||
// //当前用户累计用水量
|
||||
// Integer userSumFlow = dataObj.getInt("userSumFlow");
|
||||
// //获取区域号
|
||||
// String areaCode = dataObj.getStr("areaCode");
|
||||
// //获取卡号
|
||||
// String cardId = dataObj.getStr("cardId");
|
||||
// //获取用户余额
|
||||
// Double userBalance = dataObj.getDouble("userBalance");
|
||||
// //获取用户累计用电量
|
||||
// Integer userSumEle = dataObj.getInt("userSumEle");
|
||||
// //获取本次用电量
|
||||
// Integer curEle = dataObj.getInt("curEle");
|
||||
// //获取本次用水量
|
||||
// Integer curFlow = dataObj.getInt("curFlow");
|
||||
// //获取瞬时功率
|
||||
// Integer insPower = dataObj.getInt("insPower");
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.fastbee.data.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.constant.HttpStatus;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.core.domain.AjaxResultPro;
|
||||
import com.fastbee.common.core.domain.entity.SysRole;
|
||||
import com.fastbee.common.core.domain.model.LoginUser;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
@ -16,6 +19,7 @@ import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.data.service.devicedetail.IDeviceDetailService;
|
||||
import com.fastbee.iot.domain.Device;
|
||||
import com.fastbee.iot.domain.JiankongDeviceParam;
|
||||
import com.fastbee.iot.mapper.DeviceMapper;
|
||||
import com.fastbee.iot.model.DeviceAssignmentVO;
|
||||
import com.fastbee.iot.model.DeviceImportVO;
|
||||
import com.fastbee.iot.model.DeviceRelateUserInput;
|
||||
@ -54,6 +58,8 @@ public class DeviceController extends BaseController {
|
||||
@Autowired
|
||||
private IDeviceService deviceService;
|
||||
@Autowired
|
||||
private DeviceMapper deviceMapper;
|
||||
@Autowired
|
||||
private IDeviceDetailService deviceDetailService;
|
||||
// @Lazy
|
||||
@Autowired
|
||||
@ -508,11 +514,19 @@ public class DeviceController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getDeviceIsActivation")
|
||||
@ApiOperation("根据设备编号判断设备是否激活")
|
||||
public AjaxResult getDeviceActivation(String serialNumber) {
|
||||
Device device = deviceService.selectDeviceBySerialNumber(serialNumber);
|
||||
if(device.getStatus().toString().equals("1")){
|
||||
return AjaxResult.success(false);
|
||||
public AjaxResultPro getDeviceActivation(String serialNumber) {
|
||||
List<Device> list = new LambdaQueryChainWrapper<>(deviceMapper)
|
||||
.select(Device::getDeviceId, Device::getStatus)
|
||||
.eq(Device::getSerialNumber, serialNumber)
|
||||
.list();
|
||||
if(list.isEmpty()){
|
||||
return AjaxResultPro.success(204,"设备不存在!",null);
|
||||
}
|
||||
return AjaxResult.success(true);
|
||||
|
||||
Device device = list.get(0);
|
||||
if(device.getStatus().toString().equals("1")){
|
||||
return AjaxResultPro.success(false);
|
||||
}
|
||||
return AjaxResultPro.success(true);
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ public class DeviceOperationController {
|
||||
} else if (deviceOperationDTO.getOperationType().equals("100")) {
|
||||
param.put("cmd",100);
|
||||
Map<String,Object> data = new HashMap<>();
|
||||
//status:0关1开2停止
|
||||
data.put("status",deviceOperationDTO.getOperationCode());
|
||||
param.put("data",data);
|
||||
}
|
||||
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.userRecharge;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||
import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 水泵设备使用记录Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/waterpump/records")
|
||||
@Api(tags = "水泵设备使用记录")
|
||||
public class NgWaterPumpUsageRecordsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private INgWaterPumpUsageRecordsService ngWaterPumpUsageRecordsService;
|
||||
|
||||
/**
|
||||
* 查询水泵设备使用记录列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('rechargecard:records:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询水泵设备使用记录列表")
|
||||
public TableDataInfo list(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
startPage();
|
||||
List<NgWaterPumpUsageRecords> list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出水泵设备使用记录列表
|
||||
*/
|
||||
@ApiOperation("导出水泵设备使用记录列表")
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
List<NgWaterPumpUsageRecords> list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
|
||||
ExcelUtil<NgWaterPumpUsageRecords> util = new ExcelUtil<NgWaterPumpUsageRecords>(NgWaterPumpUsageRecords.class);
|
||||
util.exportExcel(response, list, "水泵设备使用记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取水泵设备使用记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取水泵设备使用记录详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增水泵设备使用记录")
|
||||
public AjaxResult add(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
return toAjax(ngWaterPumpUsageRecordsService.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改水泵设备使用记录")
|
||||
public AjaxResult edit(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
return toAjax(ngWaterPumpUsageRecordsService.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水泵设备使用记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('rechargecard:records:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除水泵设备使用记录")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(ngWaterPumpUsageRecordsService.deleteNgWaterPumpUsageRecordsByIds(ids));
|
||||
}
|
||||
}
|
@ -41,7 +41,7 @@ public class MaGuangaiRecordController extends BaseController
|
||||
/**
|
||||
* 查询灌溉记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询灌溉记录列表")
|
||||
public TableDataInfo list(MaGuangaiRecord maGuangaiRecord)
|
||||
|
@ -0,0 +1,50 @@
|
||||
package com.fastbee.rechargecard.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 水泵设备使用记录对象 ng_water_pump_usage_records
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-19
|
||||
*/
|
||||
@ApiModel(value = "NgWaterPumpUsageRecords",description = "水泵设备使用记录 ng_water_pump_usage_records")
|
||||
@Data
|
||||
public class NgWaterPumpUsageRecords implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 开泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("开泵时间")
|
||||
private Date pumpStartTime;
|
||||
|
||||
/** 关泵时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty("关泵时间")
|
||||
private Date pumpStopTime;
|
||||
|
||||
/** 设备编号 */
|
||||
@Excel(name = "设备编号")
|
||||
@ApiModelProperty("设备编号")
|
||||
private String deviceNumber;
|
||||
|
||||
/** 报文内容 */
|
||||
@Excel(name = "报文内容")
|
||||
@ApiModelProperty("报文内容")
|
||||
private String messageContent;
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.fastbee.rechargecard.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 水泵设备使用记录Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface NgWaterPumpUsageRecordsMapper
|
||||
{
|
||||
/**
|
||||
* 查询水泵设备使用记录
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 水泵设备使用记录
|
||||
*/
|
||||
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询水泵设备使用记录列表
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 水泵设备使用记录集合
|
||||
*/
|
||||
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 新增水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 修改水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 删除水泵设备使用记录
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNgWaterPumpUsageRecordsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除水泵设备使用记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.fastbee.rechargecard.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||
|
||||
/**
|
||||
* 水泵设备使用记录Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-19
|
||||
*/
|
||||
public interface INgWaterPumpUsageRecordsService
|
||||
{
|
||||
/**
|
||||
* 查询水泵设备使用记录
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 水泵设备使用记录
|
||||
*/
|
||||
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询水泵设备使用记录列表
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 水泵设备使用记录集合
|
||||
*/
|
||||
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 新增水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 修改水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords);
|
||||
|
||||
/**
|
||||
* 批量删除水泵设备使用记录
|
||||
*
|
||||
* @param ids 需要删除的水泵设备使用记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除水泵设备使用记录信息
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNgWaterPumpUsageRecordsById(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.fastbee.rechargecard.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper;
|
||||
import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords;
|
||||
import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService;
|
||||
|
||||
/**
|
||||
* 水泵设备使用记录Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-12-19
|
||||
*/
|
||||
@Service
|
||||
public class NgWaterPumpUsageRecordsServiceImpl implements INgWaterPumpUsageRecordsService
|
||||
{
|
||||
@Autowired
|
||||
private NgWaterPumpUsageRecordsMapper ngWaterPumpUsageRecordsMapper;
|
||||
|
||||
/**
|
||||
* 查询水泵设备使用记录
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 水泵设备使用记录
|
||||
*/
|
||||
@Override
|
||||
public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询水泵设备使用记录列表
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 水泵设备使用记录
|
||||
*/
|
||||
@Override
|
||||
public List<NgWaterPumpUsageRecords> selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改水泵设备使用记录
|
||||
*
|
||||
* @param ngWaterPumpUsageRecords 水泵设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除水泵设备使用记录
|
||||
*
|
||||
* @param ids 需要删除的水泵设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除水泵设备使用记录信息
|
||||
*
|
||||
* @param id 水泵设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteNgWaterPumpUsageRecordsById(Long id)
|
||||
{
|
||||
return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?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.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper">
|
||||
|
||||
<resultMap type="NgWaterPumpUsageRecords" id="NgWaterPumpUsageRecordsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="pumpStartTime" column="pump_start_time" />
|
||||
<result property="pumpStopTime" column="pump_stop_time" />
|
||||
<result property="deviceNumber" column="device_number" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNgWaterPumpUsageRecordsVo">
|
||||
select id, pump_start_time, pump_stop_time, device_number, message_content from ng_water_pump_usage_records
|
||||
</sql>
|
||||
|
||||
<select id="selectNgWaterPumpUsageRecordsList" parameterType="NgWaterPumpUsageRecords" resultMap="NgWaterPumpUsageRecordsResult">
|
||||
<include refid="selectNgWaterPumpUsageRecordsVo"/>
|
||||
<where>
|
||||
<if test="pumpStartTime != null "> and pump_start_time = #{pumpStartTime}</if>
|
||||
<if test="pumpStopTime != null "> and pump_stop_time = #{pumpStopTime}</if>
|
||||
<if test="deviceNumber != null and deviceNumber != ''"> and device_number = #{deviceNumber}</if>
|
||||
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNgWaterPumpUsageRecordsById" parameterType="Long" resultMap="NgWaterPumpUsageRecordsResult">
|
||||
<include refid="selectNgWaterPumpUsageRecordsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNgWaterPumpUsageRecords" parameterType="NgWaterPumpUsageRecords" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ng_water_pump_usage_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="pumpStartTime != null">pump_start_time,</if>
|
||||
<if test="pumpStopTime != null">pump_stop_time,</if>
|
||||
<if test="deviceNumber != null and deviceNumber != ''">device_number,</if>
|
||||
<if test="messageContent != null">message_content,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="pumpStartTime != null">#{pumpStartTime},</if>
|
||||
<if test="pumpStopTime != null">#{pumpStopTime},</if>
|
||||
<if test="deviceNumber != null and deviceNumber != ''">#{deviceNumber},</if>
|
||||
<if test="messageContent != null">#{messageContent},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNgWaterPumpUsageRecords" parameterType="NgWaterPumpUsageRecords">
|
||||
update ng_water_pump_usage_records
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="pumpStartTime != null">pump_start_time = #{pumpStartTime},</if>
|
||||
<if test="pumpStopTime != null">pump_stop_time = #{pumpStopTime},</if>
|
||||
<if test="deviceNumber != null and deviceNumber != ''">device_number = #{deviceNumber},</if>
|
||||
<if test="messageContent != null">message_content = #{messageContent},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNgWaterPumpUsageRecordsById" parameterType="Long">
|
||||
delete from ng_water_pump_usage_records where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNgWaterPumpUsageRecordsByIds" parameterType="String">
|
||||
delete from ng_water_pump_usage_records where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user